InfiniTimeOrg / InfiniTimeOrg/InfiniTime

Watch faces display obviously bogus 0 as heart rate

Open
#2,362 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

UI/UX
Dominant language
C
Stars
3.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Verification
  • I searched for similar issues (including closed issues) and found none was relevant.
Introduce the issue

In the source code it appears that 0 bpm is being used as part of the state machine for the heart rate tracker, and also an error value. However this ends up translating into the value returned and displayed on screen (at least of 1.15).
See:
https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/components/heartrate/Ppg.cpp#L156
and:
https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/heartratetask/HeartRateTask.cpp#L201

The code should probably be reworked such that 0 is a valid state (although ideally NONE of us should see such a number for real). Also a visual indicator that the heart rate tracker "needs to collect more information" would also make sense. Maybe a pulsing heart icon, piece of text like dots . .. ... etc.

This likely means watch face code should be able to check enoughData in addition to whether the tracker is running. https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp#L295

Preferred solution

No response

Version

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the heart-rate state and returned value in src/components/heartrate/Ppg.cpp and src/heartratetask/HeartRateTask.cpp. Then inspect how src/displayapp/screens/WatchFaceCasioStyleG7710.cpp uses the tracker state and enoughData. Done means the watch face no longer displays a bogus zero while data is unavailable and provides an appropriate unavailable-state indicator.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.