summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/WatchFaceDigital.cpp
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-10 18:09:33 (GMT)
committerJoaquim <joaquim.org@gmail.com>2021-04-10 18:09:33 (GMT)
commit012c246e401c0745d4b6765217ce7137680070da (patch)
treef5ac127917689dd57a36d7152f44bb923e2a9e9e /src/displayapp/screens/WatchFaceDigital.cpp
parenteb769fb60ecb8f96ecf6901082ec3f0610842af8 (diff)
0.16.0 TWI problems fix
More memory for freertos heap and timer stack Fix warning in watchface Fix number of bytes read by cst816 Debug app to show freertos tasks Increased the number of bytes of the twi write buffer
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index c085b0b..b1e2192 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -227,12 +227,10 @@ bool WatchFaceDigital::Refresh() {
heartbeat = heartRateController.HeartRate();
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
if(heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
- char heartbeatBuffer[4];
if(heartbeatRunning.Get())
- sprintf(heartbeatBuffer, "%d", heartbeat.Get());
+ lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
else
- sprintf(heartbeatBuffer, "---");
-
+ lv_label_set_text_static(heartbeatValue, "---");
lv_label_set_text(heartbeatValue, heartbeatBuffer);
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
@@ -242,11 +240,7 @@ bool WatchFaceDigital::Refresh() {
stepCount = motionController.NbSteps();
motionSensorOk = motionController.IsSensorOk();
if(stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
- char stepBuffer[5];
- if(motionSensorOk.Get())
- sprintf(stepBuffer, "%lu", stepCount.Get());
- else
- sprintf(stepBuffer, "---", stepCount.Get());
+ lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get());
lv_label_set_text(stepValue, stepBuffer);
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);