mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2025-04-21 12:27:27 +03:00
fw/sweep.c (TIMER1_OVF_vect): turn off the LEDs when done
This means that the image no longer has to contain terminating all-zero rows.
This commit is contained in:
17
fw/sweep.c
17
fw/sweep.c
@@ -49,8 +49,14 @@ ISR(TIMER1_OVF_vect)
|
|||||||
|
|
||||||
/* if at the end of the image, only update the time */
|
/* if at the end of the image, only update the time */
|
||||||
|
|
||||||
if (curr_line == end_line)
|
if (curr_line == end_line) {
|
||||||
|
PORTB &= 0x3f;
|
||||||
|
PORTC = 0;
|
||||||
|
PORTD = 0;
|
||||||
|
ICR1 = 0xffff;
|
||||||
|
sweeping = 0;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* wait before starting the image */
|
/* wait before starting the image */
|
||||||
|
|
||||||
@@ -60,6 +66,8 @@ ISR(TIMER1_OVF_vect)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if done, lights out and slow down */
|
||||||
|
|
||||||
/* output the next line */
|
/* output the next line */
|
||||||
|
|
||||||
PORTB = (PORTB & 0x3f) | (curr_line->cb & 0xc0);
|
PORTB = (PORTB & 0x3f) | (curr_line->cb & 0xc0);
|
||||||
@@ -73,15 +81,10 @@ ISR(TIMER1_OVF_vect)
|
|||||||
else
|
else
|
||||||
curr_line--;
|
curr_line--;
|
||||||
|
|
||||||
/* wait until the next pixel (or slow down if we're done) */
|
/* wait until the next pixel */
|
||||||
|
|
||||||
if (curr_line == end_line) {
|
|
||||||
ICR1 = 0xffff;
|
|
||||||
sweeping = 0;
|
|
||||||
} else {
|
|
||||||
ICR1 = pixel_ticks;
|
ICR1 = pixel_ticks;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t uptime_irq(void)
|
uint32_t uptime_irq(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user