mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 03:57:07 +03:00
30s reboot delay
This commit is contained in:
@@ -92,10 +92,11 @@ static void * squeezelite_thread(){
|
|||||||
ESP_LOGV(TAG ,"Freeing argv pointer");
|
ESP_LOGV(TAG ,"Freeing argv pointer");
|
||||||
free(thread_parms.argv);
|
free(thread_parms.argv);
|
||||||
isRunning=false;
|
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()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
|
vTaskDelay( pdMS_TO_TICKS( 30*1000 ) );
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ static void server(in_addr_t ip, u16_t hport, u16_t cport) {
|
|||||||
displayer.dirty = true;
|
displayer.dirty = true;
|
||||||
|
|
||||||
xSemaphoreGive(displayer.mutex);
|
xSemaphoreGive(displayer.mutex);
|
||||||
|
|
||||||
// inform new LMS server of our capabilities
|
// inform new LMS server of our capabilities
|
||||||
sendSETD(displayer.width, GDS_GetHeight(display));
|
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){
|
static bool handler(u8_t *data, int len){
|
||||||
bool res = true;
|
bool res = true;
|
||||||
|
|
||||||
if (!strncmp((char*) data, "vfdc", 4)) {
|
if (!strncmp((char*) data, "vfdc", 4)) {
|
||||||
vfdc_handler(data, len);
|
vfdc_handler(data, len);
|
||||||
} else if (!strncmp((char*) data, "grfe", 4)) {
|
} else if (!strncmp((char*) data, "grfe", 4)) {
|
||||||
@@ -444,7 +444,7 @@ static bool handler(u8_t *data, int len){
|
|||||||
} else {
|
} else {
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// chain protocol handlers (bitwise or is fine)
|
// chain protocol handlers (bitwise or is fine)
|
||||||
if (*slimp_handler_chain) res |= (*slimp_handler_chain)(data, len);
|
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) {
|
static void displayer_task(void *args) {
|
||||||
int sleep;
|
int sleep;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
xSemaphoreTake(displayer.mutex, portMAX_DELAY);
|
xSemaphoreTake(displayer.mutex, portMAX_DELAY);
|
||||||
|
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ static void *output_thread_i2s(void *arg) {
|
|||||||
_output_frames( iframes );
|
_output_frames( iframes );
|
||||||
// oframes must be a global updated by the write callback
|
// oframes must be a global updated by the write callback
|
||||||
output.frames_in_process = oframes;
|
output.frames_in_process = oframes;
|
||||||
|
|
||||||
SET_MIN_MAX_SIZED(oframes,rec,iframes);
|
SET_MIN_MAX_SIZED(oframes,rec,iframes);
|
||||||
SET_MIN_MAX_SIZED(_buf_used(outputbuf),o,outputbuf->size);
|
SET_MIN_MAX_SIZED(_buf_used(outputbuf),o,outputbuf->size);
|
||||||
SET_MIN_MAX_SIZED(_buf_used(streambuf),s,streambuf->size);
|
SET_MIN_MAX_SIZED(_buf_used(streambuf),s,streambuf->size);
|
||||||
@@ -484,7 +484,7 @@ static void *output_thread_i2s(void *arg) {
|
|||||||
UNLOCK;
|
UNLOCK;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK;
|
UNLOCK;
|
||||||
|
|
||||||
// now send all the data
|
// now send all the data
|
||||||
@@ -498,7 +498,7 @@ static void *output_thread_i2s(void *arg) {
|
|||||||
adac->power(ADAC_ON);
|
adac->power(ADAC_ON);
|
||||||
if (amp_control.gpio != -1) gpio_set_level(amp_control.gpio, amp_control.active);
|
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)
|
// 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) {
|
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);
|
LOG_INFO("changing sampling rate %u to %u", i2s_config.sample_rate, output.current_sample_rate);
|
||||||
|
|||||||
Reference in New Issue
Block a user