# HG changeset patch # User mbayer # Date 1388143018 -3600 # Node ID 9e27eb837d3faf4a2f2da9a5c332032e61e389b9 # Parent 46822de910ff41eb1938a52ab8a3015407be8f70 timing finetune diff -r 46822de910ff -r 9e27eb837d3f car004f/main.c --- a/car004f/main.c Fri Dec 27 11:56:22 2013 +0100 +++ b/car004f/main.c Fri Dec 27 12:16:58 2013 +0100 @@ -32,6 +32,7 @@ volatile uint8_t data_len = 0; volatile uint8_t bitbuf_len = 0; volatile uint16_t bitbuf = 0; + volatile uint8_t car_speed[MAX_SLOTS]; volatile uint8_t car_switch[MAX_SLOTS]; volatile uint8_t car_act; @@ -54,7 +55,7 @@ bitbuf_len = 0b10000000; // init 1 pulse received //TCNT2 = 10; - TCNT2 = 9; + TCNT2 = 11; TIMSK |= _BV(OCIE2); //enable timer2 interrupt } @@ -82,16 +83,7 @@ clock = (bitbuf >> 6) & 0b00000111; car_speed[clock] = (bitbuf >> 1) & 0x0F; car_switch[clock] = (bitbuf >> 5) & 1; - // current response for this car? - /* - if (response != 0) { - if ( ((response & 0b00001110) >> 1) == clock) { - // add our ID to response: - send_response(response | self_id << 6); - response = 0; - } - } - */ + } if (data_len == 8) { // activity data packet