diff --git a/main/rp2040_updater.c b/main/rp2040_updater.c index 78cc013..0b2687a 100644 --- a/main/rp2040_updater.c +++ b/main/rp2040_updater.c @@ -202,10 +202,6 @@ void rp2040_updater(RP2040* rp2040, pax_buf_t* pax_buffer, ILI9341* ili9341) { bool sealRes = rp2040_bl_seal(0x10010000, 0x10010000, totalLength, totalCrc); - snprintf(message, sizeof(message) - 1, "%s", sealRes ? "OK" : "FAIL"); - pax_draw_text(pax_buffer, 0xFF000000, NULL, 18, 0, 20*1, message); - ili9341_write(ili9341, pax_buffer->buf); - if (sealRes) { vTaskDelay(2000 / portTICK_PERIOD_MS); pax_noclip(pax_buffer); @@ -213,9 +209,11 @@ void rp2040_updater(RP2040* rp2040, pax_buf_t* pax_buffer, ILI9341* ili9341) { memset(message, 0, sizeof(message)); display_rp2040_update_state(pax_buffer, ili9341, "Update completed"); rp2040_bl_go(0x10010000); + } else { + display_rp2040_update_state(pax_buffer, ili9341, "Update failed"); + vTaskDelay(1000 / portTICK_PERIOD_MS); + restart(); } - - display_rp2040_update_state(pax_buffer, ili9341, "Update failed"); while (true) { vTaskDelay(1000 / portTICK_PERIOD_MS); diff --git a/main/wifi_ota.c b/main/wifi_ota.c index 144dfe7..c125b34 100644 --- a/main/wifi_ota.c +++ b/main/wifi_ota.c @@ -108,8 +108,10 @@ void display_ota_state(pax_buf_t* pax_buffer, ILI9341* ili9341, const char* text pax_noclip(pax_buffer); const pax_font_t* font = pax_get_font("sky mono"); pax_background(pax_buffer, 0xFFFFFF); - pax_vec1_t size = pax_text_size(font, 20, text); - pax_draw_text(pax_buffer, 0xFF000000, font, 20, (320 / 2) - (size.x / 2), (240 - 20) / 2, text); + pax_vec1_t title_size = pax_text_size(font, 18, "Firmware update"); + pax_draw_text(pax_buffer, 0xFF000000, font, 18, (320 / 2) - (title_size.x / 2), 120 - 30, "Co-processor update"); + pax_vec1_t size = pax_text_size(font, 18, text); + pax_draw_text(pax_buffer, 0xFF000000, font, 18, (320 / 2) - (size.x / 2), 120 + 10, text); ili9341_write(ili9341, pax_buffer->buf); } @@ -200,7 +202,7 @@ void ota_update(pax_buf_t* pax_buffer, ILI9341* ili9341) { ota_finish_err = esp_https_ota_finish(https_ota_handle); if ((err == ESP_OK) && (ota_finish_err == ESP_OK)) { ESP_LOGI(TAG, "ESP_HTTPS_OTA upgrade successful. Rebooting ..."); - display_ota_state(pax_buffer, ili9341, "Update completed"); + display_ota_state(pax_buffer, ili9341, "Update installed"); vTaskDelay(1000 / portTICK_PERIOD_MS); esp_restart(); } else {