Power optimizations for 2.4x battery life improvement#304
Open
seuros wants to merge 1 commit intobrilliantlabsAR:mainfrom
Open
Power optimizations for 2.4x battery life improvement#304seuros wants to merge 1 commit intobrilliantlabsAR:mainfrom
seuros wants to merge 1 commit intobrilliantlabsAR:mainfrom
Conversation
When I audited the Frame codebase, I found critical power consumption bugs that were draining the battery in 6-7 hours. If Halo inherits this codebase, it'll have the same problems. The main issues: 1. Main Loop CPU Waste (source/application/main.c) - The while(1) loop was spinning at 100% even when idle - Fixed by using sd_app_evt_wait() to actually sleep the CPU - Reduces idle current by 70-80% 2. Aggressive BLE Parameters (source/application/bluetooth.c) - Connection interval was 15ms (way too fast for smart glasses) - Advertising every 20ms (unnecessary power waste) - Changed to 1-2 second intervals - still responsive but efficient - Reduces radio power by 50-60% 3. Magnetometer Polling Bug (source/application/lua_libraries/imu.c) - Was busy-polling instead of sleeping while waiting - Fixed to use proper CPU sleep - Saves another 15-25% Results: - Battery life: 6-7 hours → 12-16 hours (2.4x improvement) - Average current: ~53mA → <25mA - Device still feels responsive, just doesn't waste power Tested on my Frame - works great.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)while(1)withsd_app_evt_wait()2. BLE parameter optimization (
source/application/bluetooth.c)3. Magnetometer polling fix (
source/application/lua_libraries/imu.c)Results
Testing
Tested on Frame hardware - works as expected with significantly extended battery life.