|
DovesLapTimer 4.3.0
GPS-based lap timing Arduino library — go-karts to race cars
|
Include dependency graph for SprintTimer.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | SprintTimer |
Macros | |
| #define | SPRINT_MAX_SPLITS 2 |
| #define SPRINT_MAX_SPLITS 2 |
SprintTimer - point-to-point run timing ("sprint mode": autocross, hillclimb, rally-stage style events).
Unlike DovesLapTimer there are no laps: a run begins at a START line and ends at a SEPARATE FINISH line, with up to two optional split (sector) lines between them. Multiple runs happen per session — the driver loops back around to the start and goes again.
Run semantics (deliberately simple, two states):
ALL lines are monitored on every fix — there is no mutual exclusion. Every line owns its own CrossingEngine (buffer + interpolation), so the start and finish zones may sit arbitrarily close together (common at autocross paddocks) without contending for a shared buffer. The cost is RAM: ~2.9 KB per configured line's buffer on 32-bit targets (~11.6 KB for a fully-configured instance). SprintTimer is meant to be instantiated once, not pooled like CourseManager's 8-slot timer array. Not suitable for AVR Uno; tight on Mega.
Sector/split model: segments are numbered 1..N in crossing order, where N = 1 + (number of configured splits). Sector 2 (if configured) always closes segment 1; sector 3 closes the next segment; the finish closes the last. A split crossed out of order, or missed entirely, invalidates the run's SECTOR data (best-segment tracking skips that run) but never the run time itself. Zero, one, or two splits are all legal — unlike the circuit timer there is no both-or-nothing sector gate.
Direction note: crossing detection is direction-agnostic. A backward start crossing on the return loop opens a bogus run, which the cancel-and-restart rule self-heals at the real launch. A backward FINISH crossing while RUNNING is the only truly bogus completion; it requires re-entering the finish zone mid-run, which a one-way sprint course doesn't do.
Duck-typed to DovesLapTimer's public getter surface (laps == runs) so displays/loggers can consume either timer interchangeably; run-native aliases (getRuns, getBestRunTime, ...) are provided for new code.