Many things, including a log timing report in the test

Timing report:

I (52322) LOG_TEST: === WRITE TIMING REPORT ===
I (52322) LOG_TEST:   Iterations:       200
I (52322) LOG_TEST:   Payload size:     39 bytes
I (52322) LOG_TEST:   Min:              49960 us
I (52332) LOG_TEST:   Max:              54476 us
I (52332) LOG_TEST:   Avg:              50005 us
I (52342) LOG_TEST:   Sector crossings: 2 (max 49983 us)
I (52342) LOG_TEST:   WDT margin:       4.9s (WDT=5s, worst=54476us)
I (52352) LOG_TEST: ===========================

so a write takes up to 54ms - not negligible!
This commit is contained in:
Thaddeus Hughes
2026-03-12 19:58:39 -05:00
parent 59e7071023
commit ff1ea6615c
13 changed files with 279 additions and 154 deletions

View File

@@ -32,14 +32,15 @@
static QueueHandle_t fsm_cmd_queue = NULL;
// AUDIT: fsm_init() does not zero these — they persist across panics/WDT resets.
// Only cleared by explicit user action (fsm_clear_error, fsm_set_remaining_distance).
RTC_DATA_ATTR esp_err_t fsm_error = ESP_OK;
esp_err_t fsm_get_error() { return fsm_error; }
void fsm_clear_error() { fsm_error = ESP_OK; }
int64_t override_time = -1;
fsm_override_t override_cmd;
//int64_t override_cooldown[8] = {-1};
bool enabled = false;
float this_move_dist = 0.0f;
@@ -182,7 +183,7 @@ void control_task(void *param) {
const TickType_t xFrequency = pdMS_TO_TICKS(20);
enabled = true;
sensors_init(); // TODO: Why is this *here* rather than in main?
// sensors_init() is called from main.c as a critical init (before FSM starts)
while (enabled) {
vTaskDelayUntil(&xLastWakeTime, xFrequency);