added car5+6 to trackswitch detector

Fri, 09 Dec 2011 19:53:20 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Fri, 09 Dec 2011 19:53:20 +0100
changeset 62
66dd5763dfb3
parent 61
040b6b2094fb
child 63
ea1e8dcbec44

added car5+6 to trackswitch detector

blackbox/main.c file | annotate | diff | comparison | revisions
trackswitch/main.c file | annotate | diff | comparison | revisions
--- a/blackbox/main.c	Fri Dec 09 19:41:28 2011 +0100
+++ b/blackbox/main.c	Fri Dec 09 19:53:20 2011 +0100
@@ -27,8 +27,8 @@
 
 #define MAX_SLOTS       6
 #define FUEL_FULL       10000
-//#define FUEL_DIVISOR    25
-#define FUEL_DIVISOR    10
+#define FUEL_DIVISOR    25
+//#define FUEL_DIVISOR    10
 typedef struct {
     unsigned speedlimit:4; // 4bits speedlimit
     unsigned speedminimum:4; // 4bits speedminimum
--- a/trackswitch/main.c	Fri Dec 09 19:41:28 2011 +0100
+++ b/trackswitch/main.c	Fri Dec 09 19:53:20 2011 +0100
@@ -162,6 +162,8 @@
         if ( (tmp > 118) && (tmp < 138) ) car0 = 2;
         if ( (tmp > 186) && (tmp < 206) ) car0 = 3;
         if ( (tmp > 246) && (tmp < 266) ) car0 = 4;
+        if ( (tmp > 310) && (tmp < 330) ) car0 = 5;
+        if ( (tmp > 374) && (tmp < 394) ) car0 = 6;
     }
     car0_old = car0_new;
 }
@@ -179,6 +181,8 @@
         if ( (tmp > 114) && (tmp < 146) ) car1 = 2;
         if ( (tmp > 183) && (tmp < 210) ) car1 = 3;
         if ( (tmp > 242) && (tmp < 270) ) car1 = 4;
+        if ( (tmp > 310) && (tmp < 330) ) car1 = 5;
+        if ( (tmp > 374) && (tmp < 394) ) car1 = 6;
     }
     car1_old = car1_new;
 }
@@ -195,6 +199,8 @@
         if ( (tmp > 114) && (tmp < 146) ) car1 = 2;
         if ( (tmp > 183) && (tmp < 210) ) car1 = 3;
         if ( (tmp > 242) && (tmp < 270) ) car1 = 4;
+        if ( (tmp > 310) && (tmp < 330) ) car1 = 5;
+        if ( (tmp > 374) && (tmp < 394) ) car1 = 6;
     }
     car1_old = car1_new;
 }

mercurial