Correct OTA update process show message on display

This commit is contained in:
Phat Nguyen
2024-05-16 21:12:02 +07:00
parent f505b39247
commit ed02f66ca2
4 changed files with 64 additions and 6 deletions

View File

@ -381,6 +381,31 @@ void OledDisplay::showNewFirmwareFailed(void) {
DISP()->setFont(u8g2_font_t0_16_tf);
setCentralText(20, "Firmware Update");
setCentralText(40, "Failed");
setCentralText(60, String("Retry after 24h"));
} while (DISP()->nextPage());
}
void OledDisplay::showNewFirmwareSkipped(void) {
if (isDisplayOff) {
return;
}
DISP()->firstPage();
do {
DISP()->setFont(u8g2_font_t0_16_tf);
setCentralText(20, "Firmware Update");
setCentralText(40, "skipped");
} while (DISP()->nextPage());
}
void OledDisplay::showNewFirmwareUpToDate(void) {
if (isDisplayOff) {
return;
}
DISP()->firstPage();
do {
DISP()->setFont(u8g2_font_t0_16_tf);
setCentralText(20, "Firmware Update");
setCentralText(40, "up to date");
} while (DISP()->nextPage());
}

View File

@ -40,6 +40,8 @@ public:
void showNewFirmwareUpdating(String percent);
void showNewFirmwareSuccess(String count);
void showNewFirmwareFailed(void);
void showNewFirmwareSkipped(void);
void showNewFirmwareUpToDate(void);
};
#endif /** _AG_OLED_DISPLAY_H_ */