Skip to content

ESP/Speaker: Harden polling, logging, and amplifier startup - #170

Merged
ao-david merged 4 commits into
speaker/pr06-cleanupsfrom
speaker/pr07-runtime-hardening
Oct 29, 2026
Merged

ao-david merged 4 commits into
speaker/pr06-cleanupsfrom
speaker/pr07-runtime-hardening

Conversation

@ao-david

Copy link
Copy Markdown
Member

Stacked on #169.

  • Use a 5 second retry period when no monitoring period is configured, and reject a configured monPeriod of zero, so an unconfigured device no longer polls every loop iteration.
  • Stop ESP_ERROR_CHECK from aborting the firmware when a new log file cannot be opened; return an error to the log reader instead (ESP/Speaker: SD card fail after time #121).
  • Explicitly initialise all I2C device configuration fields.
  • Size the config parameter buffer from both the IO and WiFi field limits so lowering the pin count does not break the build.

Use a 5 second retry period when no monitoring period is available, and
reject a configured monPeriod of zero. This prevents an unconfigured or
zero-configured device from issuing poll requests every loop iteration.
get_logs() previously used ESP_ERROR_CHECK when rotating log files, so an
SD card write failure would abort the firmware. Return -1 instead and let
the log reader handle the failure gracefully, which is important when the
SD card is failing at runtime (#121).
Explicitly initialise scl_wait_us and flags so the build is clean under
-Wmissing-designated-field-initializers. A zero timeout uses the driver
default.
Avoid a build-time assertion when the pin count is configured low by
sizing the temporary config buffer to the larger of the IO and WiFi
field lengths.
@ao-david
ao-david added this pull request to stack #173 October 29, 2026 06:47
@ao-david
ao-david merged commit 4d03067 into main Oct 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant