Skip to content

Conversation

@Andersama
Copy link

@Andersama Andersama commented Nov 18, 2025

This does not appear to actually disable heart rate monitoring. I think it may be worth adding new message states to communicate to the heart rate task via SystemTask.cpp.

Conceptually, the idea here was to force the task into a waiting state if the battery controller indicated power was present.

A similar idea would apply to the step tracker. I did not add a boolean flag to control whether this feature was on or off, but conceptually if someone built an external wearable battery or charger then this would be incomplete.

See #2369

Edit: Do not use as is in 0e67cff, this introduces a crash when the heart rate setting is turned on in the heart rate app.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Build size and comparison to main:

Section Size Difference
text 382460B 32B
data 944B 0B
bss 22640B 8B

Run in InfiniEmu

@mark9064 mark9064 added the enhancement Enhancement to an existing app/feature label Nov 19, 2025
@Andersama Andersama force-pushed the disable_tracking_while_charging branch 3 times, most recently from 3187f28 to 71ee078 Compare November 22, 2025 03:36
@Andersama Andersama force-pushed the disable_tracking_while_charging branch from 85415e7 to 0e67cff Compare November 23, 2025 06:43
@Andersama
Copy link
Author

Andersama commented Nov 24, 2025

The best guess I can make for the crash, which I'll test I guess tomorrow is that the slight change to the state machine now allows going from the foreground measuring state (enabled) directly to the waiting state. There is a comment about an assumption being made in the switch statement for handling events. I'll test a modification to the state machine to see if this works smoothly if background measuring. Hopefully there's another approach because otherwise this will mean the heart rate checks will continue while the watch face is on.

Update: My change to keep the modifications to the new state to the background tracking states did fix the crash. However now the watch appears to rewake itself, staying in the foreground state, never allowing the tracker to disable.

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

Labels

enhancement Enhancement to an existing app/feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants