summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/FirmwareUpdate.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-20 04:33:46 (GMT)
committerGitHub <noreply@github.com>2022-04-20 04:33:46 (GMT)
commitbe01602fcb6dc9cd91df702658c0b52da74023a9 (patch)
treebd0813acb88165deb7322201c52a259b242c49da /src/displayapp/screens/FirmwareUpdate.cpp
parent28f45caa11e0adbb208ba65b88b7ea399d584ba7 (diff)
parent5a13c5215c5022f036947838975c5c16b9ab268c (diff)
Merge branch 'InfiniTimeOrg:develop' into develop
Diffstat (limited to 'src/displayapp/screens/FirmwareUpdate.cpp')
-rw-r--r--src/displayapp/screens/FirmwareUpdate.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/displayapp/screens/FirmwareUpdate.cpp b/src/displayapp/screens/FirmwareUpdate.cpp
index 373fcae..0a8544b 100644
--- a/src/displayapp/screens/FirmwareUpdate.cpp
+++ b/src/displayapp/screens/FirmwareUpdate.cpp
@@ -15,7 +15,7 @@ FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, Pinetime
lv_label_set_text_static(backgroundLabel, "");
titleLabel = lv_label_create(lv_scr_act(), nullptr);
- lv_label_set_text(titleLabel, "Firmware update");
+ lv_label_set_text_static(titleLabel, "Firmware update");
lv_obj_set_auto_realign(titleLabel, true);
lv_obj_align(titleLabel, nullptr, LV_ALIGN_IN_TOP_MID, 0, 50);
@@ -27,7 +27,7 @@ FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, Pinetime
lv_bar_set_value(bar1, 0, LV_ANIM_OFF);
percentLabel = lv_label_create(lv_scr_act(), nullptr);
- lv_label_set_text(percentLabel, "Waiting...");
+ lv_label_set_text_static(percentLabel, "Waiting...");
lv_obj_set_auto_realign(percentLabel, true);
lv_obj_align(percentLabel, bar1, LV_ALIGN_OUT_TOP_MID, 0, 60);
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
@@ -81,20 +81,19 @@ void FirmwareUpdate::DisplayProgression() const {
float current = bleController.FirmwareUpdateCurrentBytes() / 1024.0f;
float total = bleController.FirmwareUpdateTotalBytes() / 1024.0f;
int16_t pc = (current / total) * 100.0f;
- sprintf(percentStr, "%d %%", pc);
- lv_label_set_text(percentLabel, percentStr);
+ lv_label_set_text_fmt(percentLabel, "%d %%", pc);
lv_bar_set_value(bar1, pc, LV_ANIM_OFF);
}
void FirmwareUpdate::UpdateValidated() {
lv_label_set_recolor(percentLabel, true);
- lv_label_set_text(percentLabel, "#00ff00 Image Ok!#");
+ lv_label_set_text_static(percentLabel, "#00ff00 Image Ok!#");
}
void FirmwareUpdate::UpdateError() {
lv_label_set_recolor(percentLabel, true);
- lv_label_set_text(percentLabel, "#ff0000 Error!#");
+ lv_label_set_text_static(percentLabel, "#ff0000 Error!#");
startTime = xTaskGetTickCount();
}