1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-25 19:10:18 +02:00

fw/sweep.c (set_line): export line setting (output on LEDs) function

This commit is contained in:
Werner Almesberger 2012-07-01 10:24:18 -03:00
parent 69d9013a0d
commit a4eeb43963
2 changed files with 14 additions and 3 deletions

View File

@ -70,9 +70,7 @@ ISR(TIMER1_OVF_vect)
/* output the next line */ /* output the next line */
PORTB = (PORTB & 0x3f) | (curr_line->cb & 0xc0); set_line(*curr_line);
PORTC = curr_line->cb;
PORTD = curr_line->d;
/* move to the next line */ /* move to the next line */

View File

@ -17,6 +17,10 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <avr/io.h>
#include "image.h"
struct sweep { struct sweep {
uint32_t start_ticks; /* absolute start time */ uint32_t start_ticks; /* absolute start time */
@ -29,6 +33,15 @@ struct sweep {
extern volatile bool sweeping; extern volatile bool sweeping;
static inline void set_line(struct line line)
{
PORTB = (PORTB & 0x3f) | (line.cb & 0xc0);
PORTC = line.cb;
PORTD = line.d;
}
uint32_t uptime_irq(void); uint32_t uptime_irq(void);
uint32_t uptime(void); uint32_t uptime(void);