# HG changeset patch # User Malte Bayer # Date 1387634061 -3600 # Node ID 8f07a8d15826b240fc685bfa48aa8029558603c2 # Parent cb514887cf17d6f6c51433a56598d3e1a4bdcf6d implemented remote startampel diff -r cb514887cf17 -r 8f07a8d15826 blackbox/main.c --- 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);