Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartrate app displays --- instead of 000 #1887

Merged
merged 4 commits into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/displayapp/screens/HeartRate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ HeartRate::HeartRate(Controllers::HeartRateController& heartRateController, Syst
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
}

lv_label_set_text_static(label_hr, "000");
lv_label_set_text_static(label_hr, "---");
lv_obj_align(label_hr, nullptr, LV_ALIGN_CENTER, 0, -40);

label_bpm = lv_label_create(lv_scr_act(), nullptr);
Expand Down Expand Up @@ -82,10 +82,14 @@ void HeartRate::Refresh() {
case Controllers::HeartRateController::States::NoTouch:
case Controllers::HeartRateController::States::NotEnoughData:
// case Controllers::HeartRateController::States::Stopped:
lv_label_set_text_static(label_hr, "000");
lv_label_set_text_static(label_hr, "---");
break;
default:
lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
if (heartRateController.HeartRate() == 0) {
lv_label_set_text_static(label_hr, "---");
FintasticMan marked this conversation as resolved.
Show resolved Hide resolved
} else {
lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
}
}

lv_label_set_text_static(label_status, ToString(state));
Expand Down