mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-09-26 13:48:01 +00:00
Two answers to "does the compass app matter for battery life", both yes-ish and both now fixed. The driver put the QMC6309 into normal mode at boot and left it there, so it converted continuously from power-on whether or not anything read it: ~1 mA at 100 Hz / OSR 8, forever, on a 2300 mAh battery. It is now parked in suspend after configuration and woken on demand, with m9CompassIdleTick() (called from the M9's existing per-loop branch) suspending it again two seconds after the last read. Waking is a single register write since suspend preserves the configuration; the waking call reports "nothing fresh" and the caller's next poll gets data, which callers already handle because the chip may be absent. Separately, lv_timer_handler() runs unconditionally, so a Lua app's timer kept firing while the display slept -- GPS Compass polled the magnetometer at 10 Hz into a dark screen, which would have held the sensor awake even after the fix above. The host now skips the tick while the screen is off and resumes on wake; dt comes from millis(), so an app sees one long frame rather than a broken clock. Documented on the SDK page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>