implemented remote startampel

Sat, 21 Dec 2013 14:54:21 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sat, 21 Dec 2013 14:54:21 +0100
changeset 144
8f07a8d15826
parent 143
cb514887cf17
child 145
80be5eb283d3

implemented remote startampel

blackbox/main.c file | annotate | diff | comparison | revisions
--- a/blackbox/main.c	Sat Dec 21 13:49:46 2013 +0100
+++ b/blackbox/main.c	Sat Dec 21 14:54:21 2013 +0100
@@ -533,6 +533,13 @@
     sysclk.value = 0;
 }
 
+void LED_REMOTE(uint8_t led) {
+    program_id = 6;
+    program_command = 0;
+    program_parameter = led;
+    program_count = 1;
+}
+
 void countdown_progress(void) {
     // decrement COUNTDOWN_LOOPS
     if (countdown_loops>0) {
@@ -542,15 +549,16 @@
         countdown_loops = COUNTDOWN_DELAY;
     }
     switch (countdown) {
-        case 5: LED(1, 1); break;
-        case 4: LED(2, 1); break;
-        case 3: LED(3, 1); break;
-        case 2: LED(4, 1); break;
-        case 1: LED(5, 1); break;
+        case 5: LED(1, 1); LED_REMOTE(1); break;
+        case 4: LED(2, 1); LED_REMOTE(2); break;
+        case 3: LED(3, 1); LED_REMOTE(3); break;
+        case 2: LED(4, 1); LED_REMOTE(4); break;
+        case 1: LED(5, 1); LED_REMOTE(5); break;
         case 0: { // RACE START!
             sysclk.value = 0;
             LEDS_OFF();
             LED(3, 1);
+            LED_REMOTE(0);
             mode = 3;
             } break;
     }
@@ -708,10 +716,14 @@
             // issue reset command to lap counter
             mode = 0;
             RS232_puts_p(racestart);
+
+            /* BUG??
             program_command = 6;
             program_parameter = 9;
             program_id = 0;
             program_count = 1;
+            */
+            
             LAP_COUNTER_PORT |= _BV(LAP_COUNTER);
             // TODO: beep long
             _delay_us(50);

mercurial