Firmware flow
Report one finish result for each track
The same visible branch appears in two finish handlers. This diagram follows the screenshot-transcribed code; it is not a hardware test.
A positive start timestamp and a clear finish flag allow the handler to format a track-tagged elapsed time and call WebSocket send. The flag is then set; repeated calls skip this branch while it remains set.
The send result is not checked. These lines do not establish successful delivery, timing accuracy or safe interrupt-context operation.
Read the visible handlers
Transcribed from setup-document screenshots of main.cpp. Only the fully visible handlers are reproduced; the original source files were not available. Indentation is normalized.
Track 1: finishISR
void IRAM_ATTR finishISR() {
if (!finished1 && startTime1 > 0) {
float t = (millis() - startTime1) / 1000.0;
char buf[16];
int n = snprintf(buf, sizeof(buf), "F1,%.2f", t);
webSocket.send(buf);
finished1 = true;
}
}Track 2: finish2ISR
void IRAM_ATTR finish2ISR() {
if (!finished2 && startTime2 > 0) {
float t = (millis() - startTime2) / 1000.0;
char buf[16];
int n = snprintf(buf, sizeof(buf), "F2,%.2f", t);
webSocket.send(buf);
finished2 = true;
}
}Technical notes and evidence limits
Four board roles
The setup document separates the system across four ESP32-C3 boards: a race host, a first-track sensor, a second-track starter and a second-track sensor. These are documented board roles, not evidence of a completed end-to-end test.
Servo and sensor signals
The wiring instructions assign GPIO 10 to the servo signals and GPIO 9 to the sensor signals. The selected source screenshots also declare each sensor input on GPIO 9; they do not establish the sensor technology or electrical validation.
State visible around the handlers
Each finished flag is declared false above its handler. Each start timestamp is declared without an explicit initializer in that visible declaration. Start-event assignment, later reset and rearming are outside the selected code, as are the WebSocket connection setup and interrupt attachment.
Runtime and evidence limits
The IRAM_ATTR-labelled handlers format text and call network I/O. If attached to a hardware interrupt, those operations require an interrupt-safety review. The formatting result is stored but not checked, the send result is unchecked, and the finished flag is set after the call regardless of its returned result. The screenshots do not establish debounce, delivery acknowledgement, race-start coordination, measured timing accuracy or physical test results.