← Back to the chapter · Previous detail
Technical detail · Maintainable Firmware Practices
Power-aware CI and review gate
Power behavior is a software quality concern, not a late hardware cleanup. Add these checks when firmware controls sleep, wake, radio, sensor polling, or logging:
First, Build evidence: compile every intended board profile, record warnings, binary size, dependency versions, and configuration inputs. Next, Host evidence: run tests for hardware-independent logic such as thresholds, retry state, payload formatting, and configuration validation. Then, Board smoke evidence: capture boot log, firmware version, reset reason, sample interval, publish interval, and one successful sleep/wake cycle. After that, Power evidence: measure active, idle, transmit, and sleep current with the production logging level, not a chatty debug build. Finally, Review trigger: require review when a change affects pins, power states, network behavior, persistent storage, watchdogs, or OTA/update flow.
Record the duty-cycle shape before trusting a battery-life number. A prototype with a realistic current trace and an honest limitation note is more useful than one precise estimate copied from a datasheet.