Skip to content

Commit

Permalink
Merge branch 'InfiniTimeOrg:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SadAlexa authored Apr 18, 2024
2 parents 1d3b3db + 6b5235c commit 6cc7cb4
Showing 1 changed file with 7 additions and 3 deletions.
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, "---");
} else {
lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
}
}

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

0 comments on commit 6cc7cb4

Please sign in to comment.