mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 21:17:18 +03:00
add display for OTA progress
This commit is contained in:
@@ -88,7 +88,8 @@ uint8_t ota_get_pct_complete(){
|
|||||||
}
|
}
|
||||||
static bool (*display_bus_chain)(void *from, enum display_bus_cmd_e cmd);
|
static bool (*display_bus_chain)(void *from, enum display_bus_cmd_e cmd);
|
||||||
static bool display_dummy_handler(void *from, enum display_bus_cmd_e cmd) {
|
static bool display_dummy_handler(void *from, enum display_bus_cmd_e cmd) {
|
||||||
// chain to rest of "bus"
|
|
||||||
|
// Nothing implemented at this point
|
||||||
if (display_bus_chain) return (*display_bus_chain)(from, cmd);
|
if (display_bus_chain) return (*display_bus_chain)(from, cmd);
|
||||||
else return true;
|
else return true;
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,7 @@ void sendMessaging(messaging_types type,const char * fmt, ...){
|
|||||||
}
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
displayer_scroll(msg_str, 33);
|
displayer_scroll(msg_str, 33, 250);
|
||||||
cJSON_AddStringToObject(msg,"ota_dsc",str_or_unknown(msg_str));
|
cJSON_AddStringToObject(msg,"ota_dsc",str_or_unknown(msg_str));
|
||||||
free(msg_str);
|
free(msg_str);
|
||||||
cJSON_AddNumberToObject(msg,"ota_pct", ota_get_pct_complete() );
|
cJSON_AddNumberToObject(msg,"ota_pct", ota_get_pct_complete() );
|
||||||
@@ -440,7 +441,7 @@ void ota_task(void *pvParameter)
|
|||||||
{
|
{
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
displayer_control(DISPLAYER_ACTIVATE, "Firmware update");
|
displayer_control(DISPLAYER_ACTIVATE, "Firmware update");
|
||||||
displayer_scroll("Initializing...", 33);
|
displayer_scroll("Initializing...", 33, 250);
|
||||||
ESP_LOGD(TAG, "HTTP ota Thread started");
|
ESP_LOGD(TAG, "HTTP ota Thread started");
|
||||||
const esp_partition_t *configured = esp_ota_get_boot_partition();
|
const esp_partition_t *configured = esp_ota_get_boot_partition();
|
||||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "wifi_manager.h"
|
#include "wifi_manager.h"
|
||||||
#include "telnet.h"
|
#include "telnet.h"
|
||||||
|
#include "gds.h"
|
||||||
|
#include "gds_default_if.h"
|
||||||
|
#include "gds_draw.h"
|
||||||
|
#include "gds_text.h"
|
||||||
|
#include "gds_font.h"
|
||||||
|
|
||||||
#include "cmd_squeezelite.h"
|
#include "cmd_squeezelite.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -239,6 +244,9 @@ void console_start() {
|
|||||||
#if !RECOVERY_APPLICATION
|
#if !RECOVERY_APPLICATION
|
||||||
// process autoexec locally, as we're not going to start the console thread
|
// process autoexec locally, as we're not going to start the console thread
|
||||||
process_autoexec();
|
process_autoexec();
|
||||||
|
#else
|
||||||
|
GDS_ClearExt(display, true);
|
||||||
|
GDS_TextLine(display, 1, GDS_TEXT_LEFT, GDS_TEXT_UPDATE, "Recovery mode");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user