Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ble): Only update BAS when active #2022

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

ReFil
Copy link
Contributor

@ReFil ReFil commented Nov 15, 2023

As a further mitigation against spurious wakeups (in addition to #1973) without having to disable the battery service entirely, the battery percentage can only be updated when the board is active i.e. when in use, which infers the computer is also in use

@ReFil ReFil requested a review from a team as a code owner November 15, 2023 20:38
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One high level comment on the implementation of this. Thanks!

app/src/battery.c Outdated Show resolved Hide resolved
@ReFil ReFil force-pushed the bas-update-active branch from 1b2e214 to e3f8010 Compare November 16, 2023 09:22
@caksoylar caksoylar added enhancement New feature or request bluetooth Bluetooth related items labels Nov 23, 2023
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One code organization comment.

app/src/battery.c Outdated Show resolved Hide resolved
Subscribes to the activity changing event, will stop the battery work timer when in idle or deep sleep, restart when board goes active
@ReFil ReFil force-pushed the bas-update-active branch from e3f8010 to 233c4f8 Compare November 24, 2023 17:10
@ReFil ReFil requested a review from petejohanson November 24, 2023 17:10
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@petejohanson petejohanson merged commit 6276e97 into zmkfirmware:main Nov 27, 2023
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bluetooth Bluetooth related items enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants