Project

General

Profile

Revision 1085ef77

ID1085ef7751b530b21865d0ca7d23786578749364
Parent 1b054655
Child 215b2fa6

Added by Thomas Mullins over 11 years ago

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

View differences:

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