Fri, 27 Dec 2013 11:56:22 +0100
addedd car activity packet to receiver in car firmware
car004f/main.c | file | annotate | diff | comparison | revisions |
--- a/car004f/main.c Fri Dec 27 11:43:40 2013 +0100 +++ b/car004f/main.c Fri Dec 27 11:56:22 2013 +0100 @@ -34,7 +34,7 @@ volatile uint16_t bitbuf = 0; volatile uint8_t car_speed[MAX_SLOTS]; volatile uint8_t car_switch[MAX_SLOTS]; -volatile uint8_t car_act[MAX_SLOTS]; +volatile uint8_t car_act; volatile uint8_t car_timeout[MAX_SLOTS]; volatile uint8_t timeout = 0; @@ -94,6 +94,14 @@ */ } + if (data_len == 8) { // activity data packet + car_act = (bitbuf >> 1) & 0b00111111; + for (clock = 0; clock<MAX_SLOTS; clock++) { + if (((car_act >> clock) & 1) == 0) car_speed[MAX_SLOTS-1-clock] = 0; + } + } + + GICR |= _BV(INT0) ; // Enable INT0 } else {