[WIP] Disable heart rate tracking while power is connected (charging)#2376
[WIP] Disable heart rate tracking while power is connected (charging)#2376Andersama wants to merge 1 commit intoInfiniTimeOrg:mainfrom
Conversation
|
Build size and comparison to main:
|
3187f28 to
71ee078
Compare
85415e7 to
0e67cff
Compare
|
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. |
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.