Browse files

disable output during low-brightness stages

  • Loading branch information...
1 parent b52d6b8 commit 8a36317df3c4e29e58c554dc209d4de8f048da3b @osresearch committed Dec 31, 1999
Showing with 22 additions and 3 deletions.
  1. +19 −0 matrix-test.c
  2. +3 −3 matrix.p
View
19 matrix-test.c
@@ -121,6 +121,24 @@ rainbow(
}
+static void
+gradient(
+ uint32_t * const pixels,
+ unsigned width,
+ unsigned height,
+ unsigned phaseShift,
+ unsigned cycle
+)
+{
+ cycle >>= 3;
+ for (unsigned x=0; x < width; x++) {
+ for (unsigned y=0; y < height; y++) {
+ uint8_t * const out = &pixels[x + y*width];
+ out[2] = 0x80 * (1 & (((x+cycle) >> 2) ^ ((y+cycle) >> 2)));
+ }
+ }
+}
+
int
main(void)
{
@@ -146,6 +164,7 @@ main(void)
while (1)
{
rainbow(p, width, height, 10, i++);
+ //gradient(p, width, height, 10, i++);
ledscape_draw(leds, p);
usleep(20000);
View
6 matrix.p
@@ -419,10 +419,10 @@ PWM_LOOP:
// \todo: Test turning OE on and off every other,
// every fourth, every eigth, etc pixel based on
// the current brightness.
-#if 0
- LSL out_sel, offset, 1
+#if 1
+ LSR out_set, offset, 2
- QBLT no_blank, bright, p2
+ QBLT no_blank, bright, out_set
DISPLAY_OFF
no_blank:
#endif

0 comments on commit 8a36317

Please sign in to comment.