Skip to content

Conversation

@mark9064
Copy link
Member

@mark9064 mark9064 commented Jun 27, 2025

Polling the sensor every 100ms uses very little power, and handling out of date motion data causes excess complexity. This fixes correctness for reading (not notifications) steps/motion characteristics also
Closes #1379
Closes #1270
Closes #787
Closes #2268
Closes #2271
Closes #2272

@mark9064 mark9064 added this to the 1.16.0 milestone Jun 27, 2025
@mark9064 mark9064 added the maintenance Background work label Jun 27, 2025
@github-actions
Copy link

github-actions bot commented Jun 27, 2025

Build size and comparison to main:

Section Size Difference
text 379032B -80B
data 944B 0B
bss 22536B 0B

Run in InfiniEmu

@mark9064
Copy link
Member Author

Actually we can fix shake wake calibration as well. I'll push a new commit soon

@NeroBurner
Copy link
Contributor

what do you mean with "(not notifications)" in your issue description?

@mark9064
Copy link
Member Author

mark9064 commented Jun 28, 2025

With the existing code, the motion values will be updated if anything is subscribed to notifications on the BLE characteristic, but it won't update it when a characteristic is only read. Sorry that wasn't super clear, I should've specified I meant BLE read/notify

@mark9064 mark9064 force-pushed the unconditional-motion branch from 3aaa588 to 614440f Compare June 28, 2025 19:07
@mark9064
Copy link
Member Author

Removed the ShouldShakeWake method as a method which just did one comparison felt like overabstracting

@NeroBurner
Copy link
Contributor

still looking good

@mark9064
Copy link
Member Author

@geekbozu I remember you mentioned in the pinetime channel that you've got power measurement kit set up, could I take you up on your offer with this PR? :)

Testing configuration: digital watchface, sleep notification mode, all wake triggers disabled, BLE off, screen off
Refs to compare are:
614440f (HEAD here)
c1b9967 (current main)

Looking to know average power consumption in each configuration so we can decide if this PR is feasible

No worries at all if you're busy at the moment, just let me know somewhere

@mark9064
Copy link
Member Author

mark9064 commented Jun 29, 2025

Measurements are complete! Thanks so much taking a look Tim :)

With no BLE:

Main: 188μA ~= 40d idle
This PR: 210μA ~= 36d idle
So the change is ~22μA

I think this is a reasonable sacrifice given the complexity of working around it. In reality most the energy of the battery is consumed by screen on time, and BLE is on, so the impact to real usage is probably no more than 1 day in the worst case and a few hours in most cases.

@geekbozu
Copy link
Member

geekbozu commented Jun 29, 2025

Main Branch
image

This PR
image

Marks summary sums it up well!

@mark9064
Copy link
Member Author

Going to merge soon unless any other comments :)

@mark9064 mark9064 merged commit 7ea36e8 into InfiniTimeOrg:main Oct 15, 2025
7 checks passed
// AOD needs motion on to show up to date step counts
if (state == SystemTaskState::Sleeping && !(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) ||
motionController.GetService()->IsMotionNotificationSubscribed())) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Second I merged I realised this method can be removed... will draft a fixup soon

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #2352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Background work

Projects

None yet

3 participants