timing finetune default tip

Fri, 27 Dec 2013 12:16:58 +0100

author
mbayer
date
Fri, 27 Dec 2013 12:16:58 +0100
changeset 155
9e27eb837d3f
parent 154
46822de910ff

timing finetune

car004f/main.c file | annotate | diff | comparison | revisions
--- 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

mercurial