mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-22 02:17:31 +02:00
fw/sweep.c (set_line): export line setting (output on LEDs) function
This commit is contained in:
parent
69d9013a0d
commit
a4eeb43963
@ -70,9 +70,7 @@ ISR(TIMER1_OVF_vect)
|
||||
|
||||
/* output the next line */
|
||||
|
||||
PORTB = (PORTB & 0x3f) | (curr_line->cb & 0xc0);
|
||||
PORTC = curr_line->cb;
|
||||
PORTD = curr_line->d;
|
||||
set_line(*curr_line);
|
||||
|
||||
/* move to the next line */
|
||||
|
||||
|
13
fw/sweep.h
13
fw/sweep.h
@ -17,6 +17,10 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "image.h"
|
||||
|
||||
|
||||
struct sweep {
|
||||
uint32_t start_ticks; /* absolute start time */
|
||||
@ -29,6 +33,15 @@ struct sweep {
|
||||
|
||||
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(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user