diff -r 0b12a8bf23b2 -r edaf6a50276a blackbox/main.c --- a/blackbox/main.c Sat Dec 15 23:15:32 2012 +0100 +++ b/blackbox/main.c Sat Dec 15 23:21:19 2012 +0100 @@ -33,6 +33,7 @@ #define FUEL_JUMPSTART 5000 #define FUEL_DIV_DEFAULT 25 #define PITLANE_SPEEDLIMIT 10 +#define FINISHLINE_DIFF_BLOCK 1500 // minimum 750 ms between laps (prevents double counted lapt on finish crossing) volatile uint8_t fuel_divisor = FUEL_DIV_DEFAULT; // default, can be set via serial command typedef struct { @@ -545,7 +546,7 @@ car0_state = car0; if (car0_state != 0) { diff.value = clk.value - slot[car0-1].lap_time_start.value; - if ( diff.value > 3000 ) { // minimum 1.5 second for 1 lap! + if ( diff.value > FINISHLINE_DIFF_BLOCK ) { if (slot[car0-1].lap_time_start.value != 0) { slot[car0-1].lap_time.value = diff.value; slot[car0-1].laps++; @@ -572,7 +573,7 @@ car1_state = car1; if (car1_state != 0) { diff.value = clk.value - slot[car1-1].lap_time_start.value; - if ( diff.value > 3000 ) { // minimum 1.5 second for 1 lap! + if ( diff.value > FINISHLINE_DIFF_BLOCK ) { if (slot[car1-1].lap_time_start.value != 0) { slot[car1-1].lap_time.value = diff.value; slot[car1-1].laps++;