# HG changeset patch # User Malte Bayer # Date 1355609732 -3600 # Node ID 0b12a8bf23b2e19aca62c794ac04cf55e7ebf163 # Parent ec623e5fcbca78731f560365ea926de9e0990644 new option to set pitlane entry as finish line too to increase laps diff -r ec623e5fcbca -r 0b12a8bf23b2 blackbox/main.c --- a/blackbox/main.c Sat Dec 15 22:55:30 2012 +0100 +++ b/blackbox/main.c Sat Dec 15 23:15:32 2012 +0100 @@ -32,7 +32,7 @@ #define FUEL_FULL 10000 #define FUEL_JUMPSTART 5000 #define FUEL_DIV_DEFAULT 25 -#define PITLANE_SPEEDLIMIT 15 +#define PITLANE_SPEEDLIMIT 10 volatile uint8_t fuel_divisor = FUEL_DIV_DEFAULT; // default, can be set via serial command typedef struct { @@ -63,9 +63,10 @@ extern uint8_t btn_start = _BV(SW_START); extern uint8_t old_start = _BV(SW_START); - +// todo: pack as bit structure: uint8_t liveinfo = 0; uint8_t fuel_enabled = 1; +uint8_t pitlane_finishline = 0; volatile u32 sysclk; volatile uint8_t sysclk_packettimer = 0; @@ -151,7 +152,10 @@ uint8_t type = (data & 0b111); if (type == 4) { // pitlane response - if (status == 5) slot[car].canrefuel = 1; + if (status == 5) { + slot[car].canrefuel = 1; + if (pitlane_finishline) slot[car].laps++; + } if (status == 6) for (data=0; data