diff options
author | JF002 <JF002@users.noreply.github.com> | 2021-04-16 19:57:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 19:57:35 +0200 |
commit | 36e27842e146ddcfbcd5dcef4ebb2c92955242be (patch) | |
tree | 54c2b4f658a82d5effc5f1a19f5937006aa748cd /src/displayapp/screens/WatchFaceDigital.cpp | |
parent | eb769fb60ecb8f96ecf6901082ec3f0610842af8 (diff) | |
parent | 3c413bdd5283f6ef95d23a4b7274722da680f039 (diff) |
Merge pull request #263 from joaquimorg/0.16.0Update
Fix Issue #262 for 0.16.0 version
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
-rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index c085b0b4..15f73e8b 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -227,13 +227,11 @@ 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(heartbeatValue, heartbeatBuffer); + lv_label_set_text_static(heartbeatValue, "---"); + 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); lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0); @@ -242,12 +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(stepValue, stepBuffer); + lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get()); 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); } |