From 603791de5b82047829a3eacfd4c8b732e3c26ca7 Mon Sep 17 00:00:00 2001 From: Philippe G Date: Tue, 11 Aug 2020 11:01:19 -0700 Subject: [PATCH] 30s reboot delay --- .../platform_console/app_squeezelite/cmd_squeezelite.c | 3 ++- components/squeezelite/display.c | 8 ++++---- components/squeezelite/output_i2s.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/platform_console/app_squeezelite/cmd_squeezelite.c b/components/platform_console/app_squeezelite/cmd_squeezelite.c index b035f645..3267f2f7 100644 --- a/components/platform_console/app_squeezelite/cmd_squeezelite.c +++ b/components/platform_console/app_squeezelite/cmd_squeezelite.c @@ -92,10 +92,11 @@ static void * squeezelite_thread(){ ESP_LOGV(TAG ,"Freeing argv pointer"); free(thread_parms.argv); isRunning=false; - ESP_LOGE(TAG, "Exited from squeezelite thread, something's wrong ... rebooting"); + 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. "); } + vTaskDelay( pdMS_TO_TICKS( 30*1000 ) ); esp_restart(); return NULL; } diff --git a/components/squeezelite/display.c b/components/squeezelite/display.c index d4cbea46..ec7a9a9f 100644 --- a/components/squeezelite/display.c +++ b/components/squeezelite/display.c @@ -414,7 +414,7 @@ static void server(in_addr_t ip, u16_t hport, u16_t cport) { displayer.dirty = true; xSemaphoreGive(displayer.mutex); - + // inform new LMS server of our capabilities sendSETD(displayer.width, GDS_GetHeight(display)); @@ -426,7 +426,7 @@ static void server(in_addr_t ip, u16_t hport, u16_t cport) { */ static bool handler(u8_t *data, int len){ bool res = true; - + if (!strncmp((char*) data, "vfdc", 4)) { vfdc_handler(data, len); } else if (!strncmp((char*) data, "grfe", 4)) { @@ -444,7 +444,7 @@ static bool handler(u8_t *data, int len){ } else { res = false; } - + // chain protocol handlers (bitwise or is fine) if (*slimp_handler_chain) res |= (*slimp_handler_chain)(data, len); @@ -1123,7 +1123,7 @@ static void visu_handler( u8_t *data, int len) { */ static void displayer_task(void *args) { int sleep; - + while (1) { xSemaphoreTake(displayer.mutex, portMAX_DELAY); diff --git a/components/squeezelite/output_i2s.c b/components/squeezelite/output_i2s.c index 9eee5d6c..081b570a 100644 --- a/components/squeezelite/output_i2s.c +++ b/components/squeezelite/output_i2s.c @@ -466,7 +466,7 @@ static void *output_thread_i2s(void *arg) { _output_frames( iframes ); // oframes must be a global updated by the write callback output.frames_in_process = oframes; - + SET_MIN_MAX_SIZED(oframes,rec,iframes); SET_MIN_MAX_SIZED(_buf_used(outputbuf),o,outputbuf->size); SET_MIN_MAX_SIZED(_buf_used(streambuf),s,streambuf->size); @@ -484,7 +484,7 @@ static void *output_thread_i2s(void *arg) { UNLOCK; continue; } - + UNLOCK; // now send all the data @@ -498,7 +498,7 @@ static void *output_thread_i2s(void *arg) { adac->power(ADAC_ON); if (amp_control.gpio != -1) gpio_set_level(amp_control.gpio, amp_control.active); } - + // this does not work well as set_sample_rates resets the fifos (and it's too early) if (i2s_config.sample_rate != output.current_sample_rate) { LOG_INFO("changing sampling rate %u to %u", i2s_config.sample_rate, output.current_sample_rate);