diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-05-12 22:25:52 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-05-12 22:25:52 (GMT) |
| commit | 0315ea7b8f51ccd480dc56da4ec114a1b9008e3c (patch) | |
| tree | 81a3e79e6d1bfb8644b3d1e7fea893ebd89f81bb | |
| parent | 3941af20f5814ecd8e3d992cc4dd8b97baa4ae19 (diff) | |
rm chance for dynamic allocation during firmware update
| -rw-r--r-- | src/displayapp/screens/FirmwareUpdate.cpp | 3 | ||||
| -rw-r--r-- | src/displayapp/screens/FirmwareUpdate.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/displayapp/screens/FirmwareUpdate.cpp b/src/displayapp/screens/FirmwareUpdate.cpp index 0a8544b..c20af38 100644 --- a/src/displayapp/screens/FirmwareUpdate.cpp +++ b/src/displayapp/screens/FirmwareUpdate.cpp @@ -81,7 +81,8 @@ void FirmwareUpdate::DisplayProgression() const { float current = bleController.FirmwareUpdateCurrentBytes() / 1024.0f; float total = bleController.FirmwareUpdateTotalBytes() / 1024.0f; int16_t pc = (current / total) * 100.0f; - lv_label_set_text_fmt(percentLabel, "%d %%", pc); + sprintf(percentStr, "%d %%", pc); + lv_label_set_text_static(percentLabel, percentStr); lv_bar_set_value(bar1, pc, LV_ANIM_OFF); } diff --git a/src/displayapp/screens/FirmwareUpdate.h b/src/displayapp/screens/FirmwareUpdate.h index 5156b7e..a61178c 100644 --- a/src/displayapp/screens/FirmwareUpdate.h +++ b/src/displayapp/screens/FirmwareUpdate.h @@ -24,6 +24,7 @@ namespace Pinetime { lv_obj_t* bar1; lv_obj_t* percentLabel; lv_obj_t* titleLabel; + mutable char percentStr[10]; States state = States::Idle; |
