decreased finishline blocking time

Sat, 15 Dec 2012 23:21:19 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sat, 15 Dec 2012 23:21:19 +0100
changeset 125
edaf6a50276a
parent 124
0b12a8bf23b2
child 126
0d6fbfaae49b

decreased finishline blocking time

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

mercurial