Skip to content

Background HR#2322

Merged
mark9064 merged 2 commits intoInfiniTimeOrg:mainfrom
mark9064:background-hr
Nov 5, 2025
Merged

Background HR#2322
mark9064 merged 2 commits intoInfiniTimeOrg:mainfrom
mark9064:background-hr

Conversation

@mark9064
Copy link
Member

@mark9064 mark9064 commented Jun 26, 2025

Largely based on #1718

Changes:

  • 4 state machine
  • Heart rate display avoids stale values being shown for a long time in some scenarios
    • does not cover all scenarios, but hopefully good enough and as close to the current behaviour as possible while still making sense for background measurement
  • Constant frequency HR measurements that take into account successful screen on measurements (and also long periods of unsuccessful screen on measurements)
  • Refactored a few annoying bits of the PPG code like lastBpm and the bodge to get correct not enough data messages
  • Removed the 15s mode. The sensor already takes ~6s to get a measurement in ideal conditions so it makes sense to use continuous - the sensor on time will be very similar and proper history averaging with continuous means measurement accuracy is better
  • Misc code bits such as using std::optional more where sensible. I haven't used it in the settings struct as the layout is compiler dependent AFAIK

Accuracy improvements (second commit)

  • Sampling is constant frequency instead of delay based
  • Raised the priority of the HR task to 1 so that it does not get out-competed by DisplayApp

This is still more complex than I'd like it to be

Loading
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.

7 participants