Thu, 15 Dec 2011 22:36:00 +0100
added pitlane speedlimit
blackbox/main.c | file | annotate | diff | comparison | revisions |
--- a/blackbox/main.c Thu Dec 15 18:27:06 2011 +0100 +++ b/blackbox/main.c Thu Dec 15 22:36:00 2011 +0100 @@ -28,6 +28,7 @@ #define FUEL_FULL 10000 #define FUEL_JUMPSTART 5000 #define FUEL_DIV_DEFAULT 25 +#define PITLANE_SPEEDLIMIT 4 volatile uint8_t fuel_divisor = FUEL_DIV_DEFAULT; // default, can be set via serial command typedef struct { @@ -311,6 +312,7 @@ if (tmp < slot[controller].speedminimum) tmp = slot[controller].speedminimum; if ((mode == 2) && (tmp != 0)) { jumpstart(controller); tmp = 0; } if (tmp > slot[controller].speedlimit) tmp = slot[controller].speedlimit; + if (slot[controller].canrefuel && (tmp > PITLANE_SPEEDLIMIT)) tmp = PITLANE_SPEEDLIMIT; speed = tmp; tmp = tmp << 1; } else { @@ -498,6 +500,7 @@ } } car0 = 0; + if (car1 != car1_state) { car1_state = car1; if (car1_state != 0) { @@ -523,6 +526,7 @@ } } } car1 = 0; + } void slot_liveinfo(uint8_t idx) {