summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/displayapp/screens/WatchFaceAnalog24.cpp7
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/displayapp/screens/WatchFaceAnalog24.cpp b/src/displayapp/screens/WatchFaceAnalog24.cpp
index 875c0f1..5e37e7b 100644
--- a/src/displayapp/screens/WatchFaceAnalog24.cpp
+++ b/src/displayapp/screens/WatchFaceAnalog24.cpp
@@ -241,7 +241,12 @@ void WatchFaceAnalog24::Refresh() {
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
if (heartbeatRunning.Get()) {
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x770505));
- lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
+ auto v = heartbeat.Get();
+ if (v != 0) {
+ lv_label_set_text_fmt(heartbeatValue, "%d", v);
+ } else {
+ lv_label_set_text_static(heartbeatValue, "");
+ }
} else {
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
lv_label_set_text_static(heartbeatValue, "");
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index fa81418..76283e2 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -262,7 +262,12 @@ void WatchFaceDigital::Refresh() {
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
if (heartbeatRunning.Get()) {
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
- lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
+ auto v = heartbeat.Get();
+ if (v) {
+ lv_label_set_text_fmt(heartbeatValue, "%d", v);
+ } else {
+ lv_label_set_text_static(heartbeatValue, "");
+ }
} else {
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
lv_label_set_text_static(heartbeatValue, "");