mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
squeezelite cmdline error + cspot tweaks
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
idf_build_get_property(idf_path IDF_PATH)
|
||||
idf_component_register( SRCS cmd_squeezelite.c
|
||||
INCLUDE_DIRS .
|
||||
PRIV_REQUIRES spi_flash bootloader_support partition_table bootloader_support console codecs squeezelite newlib pthread tools platform_config display tools)
|
||||
PRIV_REQUIRES spi_flash bootloader_support partition_table bootloader_support console codecs squeezelite newlib pthread tools platform_config display tools services)
|
||||
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=feof")
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "platform_config.h"
|
||||
#include "esp_app_format.h"
|
||||
#include "tools.h"
|
||||
#include "messaging.h"
|
||||
|
||||
extern esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length);
|
||||
static const char * TAG = "squeezelite_cmd";
|
||||
@@ -61,7 +62,7 @@ static void squeezelite_thread(void *arg){
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG ,"Calling squeezelite");
|
||||
main(thread_parms.argc,thread_parms.argv);
|
||||
int ret = main(thread_parms.argc,thread_parms.argv);
|
||||
ESP_LOGV(TAG ,"Exited from squeezelite's main(). Freeing argv structure.");
|
||||
|
||||
for(int i=0;i<thread_parms.argc;i++){
|
||||
@@ -71,13 +72,21 @@ static void squeezelite_thread(void *arg){
|
||||
ESP_LOGV(TAG ,"Freeing argv pointer");
|
||||
free(thread_parms.argv);
|
||||
|
||||
ESP_LOGE(TAG, "Exited from squeezelite thread, something's wrong ... rebooting (wait 30s for user to take action)");
|
||||
if(!wait_for_commit()){
|
||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
||||
}
|
||||
|
||||
messaging_post_message(MESSAGING_ERROR, MESSAGING_CLASS_SYSTEM, "squeezelite exited with error code %d", ret);
|
||||
|
||||
vTaskDelay( pdMS_TO_TICKS( 30*1000 ) );
|
||||
esp_restart();
|
||||
if (ret == 1) {
|
||||
int wait = 60;
|
||||
messaging_post_message(MESSAGING_ERROR, MESSAGING_CLASS_SYSTEM, "Rebooting in %d sec", wait);
|
||||
vTaskDelay( pdMS_TO_TICKS(wait * 1000));
|
||||
esp_restart();
|
||||
} else {
|
||||
messaging_post_message(MESSAGING_ERROR, MESSAGING_CLASS_SYSTEM, "Correct command line and reboot");
|
||||
vTaskSuspend(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static int launchsqueezelite(int argc, char **argv) {
|
||||
|
||||
@@ -69,7 +69,6 @@ static void register_deep_sleep();
|
||||
static void register_light_sleep();
|
||||
static void register_factory_boot();
|
||||
static void register_restart_ota();
|
||||
//static void register_update_certs();
|
||||
static void register_set_services();
|
||||
#if WITH_TASKS_INFO
|
||||
static void register_tasks();
|
||||
@@ -86,7 +85,6 @@ void register_system()
|
||||
register_restart();
|
||||
register_deep_sleep();
|
||||
register_light_sleep();
|
||||
//register_update_certs();
|
||||
register_factory_boot();
|
||||
register_restart_ota();
|
||||
#if WITH_TASKS_INFO
|
||||
@@ -562,24 +560,6 @@ static void register_tasks()
|
||||
|
||||
#endif // WITH_TASKS_INFO
|
||||
|
||||
/*
|
||||
extern esp_err_t update_certificates(bool force);
|
||||
static int force_update_cert(int argc, char **argv){
|
||||
return update_certificates(true);
|
||||
}
|
||||
|
||||
static void register_update_certs()
|
||||
{
|
||||
const esp_console_cmd_t cmd = {
|
||||
.command = "update_certificates",
|
||||
.help = "Force updating the certificates from binary",
|
||||
.hint = NULL,
|
||||
.func = &force_update_cert,
|
||||
};
|
||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/** 'deep_sleep' command puts the chip into deep sleep mode */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user