frame-codebase icon indicating copy to clipboard operation
frame-codebase copied to clipboard

Power optimizations for 2.4x battery life improvement

Open seuros opened this issue 2 months ago • 0 comments

Summary

Fixes critical power consumption bugs that drain battery in 6-7 hours. These issues were found during codebase audit and will affect Halo if this code is inherited.

Changes

1. Main loop CPU sleep (source/application/main.c)

  • Replaced busy-wait while(1) with sd_app_evt_wait()
  • CPU now sleeps between events instead of spinning at 100%
  • Impact: 70-80% idle current reduction

2. BLE parameter optimization (source/application/bluetooth.c)

  • Connection interval: 15ms → 1000-2000ms
  • Advertising interval: 20ms → 2000ms
  • Smart glasses don't need gamepad-level latency
  • Impact: 50-60% radio power reduction

3. Magnetometer polling fix (source/application/lua_libraries/imu.c)

  • Fixed busy-polling to use proper CPU sleep
  • Impact: 15-25% power reduction

Results

  • Battery life: 6-7 hours → 12-16 hours (2.4x improvement)
  • Average current: ~53mA → <25mA
  • Total power reduction: 60-75%
  • Device remains responsive

Testing

Tested on Frame hardware - works as expected with significantly extended battery life.

seuros avatar Oct 06 '25 03:10 seuros