Revision 1085ef77
Made rfid.c more robust against false negatives
Also changed LED code to be more generally usable, and changed mainbox
to grant access to a particular user id instead of randomly choosing
toolbox/led.h | ||
---|---|---|
3 | 3 |
|
4 | 4 |
#include <avr/io.h> |
5 | 5 |
|
6 |
enum color_t { |
|
7 |
OFF, RED, YELLOW, GREEN |
|
8 |
}; |
|
9 |
|
|
6 | 10 |
static inline void led_init() {DDRC |= _BV(DDC1) | _BV(DDC0);} |
7 | 11 |
static inline void led_off() {PORTC &= ~(_BV(PC1) | _BV(PC0));} |
8 | 12 |
static inline void led_red() {PORTC = (PORTC & ~_BV(PC0)) | _BV(PC1);} |
... | ... | |
10 | 14 |
static inline void led_green() {PORTC = (PORTC & ~_BV(PC1)) | _BV(PC0);} |
11 | 15 |
|
12 | 16 |
/* Starts LED blinking */ |
13 |
void led_blink_start(unsigned int period_ms, char n_times); |
|
17 |
void led_blink_start(unsigned int period_ms, char n_times, enum color_t color);
|
|
14 | 18 |
|
15 | 19 |
/* Returns nonzero if blinking has finished */ |
16 | 20 |
char led_blink_done(); |
Also available in: Unified diff