Browse Source

30s reboot delay

Philippe G 4 năm trước cách đây
mục cha
commit
603791de5b

+ 2 - 1
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;
 }

+ 4 - 4
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);
 		

+ 3 - 3
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);