mirror of
https://github.com/badgeteam/mch2022-template-app.git
synced 2024-12-22 15:16:35 +00:00
Small fixes
This commit is contained in:
parent
501c1b5752
commit
587b1d9a49
2 changed files with 9 additions and 9 deletions
|
@ -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);
|
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) {
|
if (sealRes) {
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
pax_noclip(pax_buffer);
|
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));
|
memset(message, 0, sizeof(message));
|
||||||
display_rp2040_update_state(pax_buffer, ili9341, "Update completed");
|
display_rp2040_update_state(pax_buffer, ili9341, "Update completed");
|
||||||
rp2040_bl_go(0x10010000);
|
rp2040_bl_go(0x10010000);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
display_rp2040_update_state(pax_buffer, ili9341, "Update failed");
|
display_rp2040_update_state(pax_buffer, ili9341, "Update failed");
|
||||||
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||||
|
restart();
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||||
|
|
|
@ -108,8 +108,10 @@ void display_ota_state(pax_buf_t* pax_buffer, ILI9341* ili9341, const char* text
|
||||||
pax_noclip(pax_buffer);
|
pax_noclip(pax_buffer);
|
||||||
const pax_font_t* font = pax_get_font("sky mono");
|
const pax_font_t* font = pax_get_font("sky mono");
|
||||||
pax_background(pax_buffer, 0xFFFFFF);
|
pax_background(pax_buffer, 0xFFFFFF);
|
||||||
pax_vec1_t size = pax_text_size(font, 20, text);
|
pax_vec1_t title_size = pax_text_size(font, 18, "Firmware update");
|
||||||
pax_draw_text(pax_buffer, 0xFF000000, font, 20, (320 / 2) - (size.x / 2), (240 - 20) / 2, text);
|
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);
|
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);
|
ota_finish_err = esp_https_ota_finish(https_ota_handle);
|
||||||
if ((err == ESP_OK) && (ota_finish_err == ESP_OK)) {
|
if ((err == ESP_OK) && (ota_finish_err == ESP_OK)) {
|
||||||
ESP_LOGI(TAG, "ESP_HTTPS_OTA upgrade successful. Rebooting ...");
|
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);
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue