Sfoglia il codice sorgente

tweak priorities - release

Philippe G 4 anni fa
parent
commit
87bf6255f4

+ 2 - 2
components/raop/raop.c

@@ -196,7 +196,7 @@ struct raop_ctx_s *raop_create(struct in_addr host, char *name,
 	ESP_ERROR_CHECK( mdns_service_add(id, "_raop", "_tcp", ctx->port, txt, sizeof(txt) / sizeof(mdns_txt_item_t)) );
 	ESP_ERROR_CHECK( mdns_service_add(id, "_raop", "_tcp", ctx->port, txt, sizeof(txt) / sizeof(mdns_txt_item_t)) );
 	
 	
     ctx->xTaskBuffer = (StaticTask_t*) heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
     ctx->xTaskBuffer = (StaticTask_t*) heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
-	ctx->thread = xTaskCreateStatic( (TaskFunction_t) rtsp_thread, "RTSP_thread", RTSP_STACK_SIZE, ctx, ESP_TASK_PRIO_MIN + 1, ctx->xStack, ctx->xTaskBuffer);
+	ctx->thread = xTaskCreateStatic( (TaskFunction_t) rtsp_thread, "RTSP_thread", RTSP_STACK_SIZE, ctx, ESP_TASK_PRIO_MIN + 2, ctx->xStack, ctx->xTaskBuffer);
 #endif
 #endif
 
 
 	return ctx;
 	return ctx;
@@ -518,7 +518,7 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock)
 		ctx->active_remote.running = true;
 		ctx->active_remote.running = true;
 		ctx->active_remote.destroy_mutex = xSemaphoreCreateBinary();
 		ctx->active_remote.destroy_mutex = xSemaphoreCreateBinary();
 		ctx->active_remote.xTaskBuffer = (StaticTask_t*) heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
 		ctx->active_remote.xTaskBuffer = (StaticTask_t*) heap_caps_malloc(sizeof(StaticTask_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
-		ctx->active_remote.thread = xTaskCreateStatic( (TaskFunction_t) search_remote, "search_remote", SEARCH_STACK_SIZE, ctx, ESP_TASK_PRIO_MIN + 1, ctx->active_remote.xStack, ctx->active_remote.xTaskBuffer);
+		ctx->active_remote.thread = xTaskCreateStatic( (TaskFunction_t) search_remote, "search_remote", SEARCH_STACK_SIZE, ctx, ESP_TASK_PRIO_MIN + 2, ctx->active_remote.xStack, ctx->active_remote.xTaskBuffer);
 #endif		
 #endif		
 
 
 	} else if (!strcmp(method, "SETUP") && ((buf = kd_lookup(headers, "Transport")) != NULL)) {
 	} else if (!strcmp(method, "SETUP") && ((buf = kd_lookup(headers, "Transport")) != NULL)) {

+ 1 - 1
components/services/buttons.c

@@ -76,7 +76,7 @@ static void common_task_init(void) {
 	
 	
 	if (!common_queue_set) {
 	if (!common_queue_set) {
 		common_queue_set = xQueueCreateSet(BUTTON_QUEUE_LEN + 1);
 		common_queue_set = xQueueCreateSet(BUTTON_QUEUE_LEN + 1);
-		xTaskCreateStatic( (TaskFunction_t) buttons_task, "buttons_thread", BUTTON_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
+		xTaskCreateStatic( (TaskFunction_t) buttons_task, "buttons_thread", BUTTON_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 2, xStack, &xTaskBuffer);
 	}
 	}
  }	
  }	
 
 

+ 3 - 3
components/squeezelite/output_i2s.c

@@ -371,7 +371,7 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
 		static DRAM_ATTR StaticTask_t xTaskBuffer __attribute__ ((aligned (4)));
 		static DRAM_ATTR StaticTask_t xTaskBuffer __attribute__ ((aligned (4)));
 		static EXT_RAM_ATTR StackType_t xStack[STAT_STACK_SIZE] __attribute__ ((aligned (4)));
 		static EXT_RAM_ATTR StackType_t xStack[STAT_STACK_SIZE] __attribute__ ((aligned (4)));
 		stats_task = xTaskCreateStatic( (TaskFunction_t) output_thread_i2s_stats, "output_i2s_sts", STAT_STACK_SIZE, 
 		stats_task = xTaskCreateStatic( (TaskFunction_t) output_thread_i2s_stats, "output_i2s_sts", STAT_STACK_SIZE, 
-										 NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
+										 NULL, ESP_TASK_PRIO_MIN, xStack, &xTaskBuffer);
 	}	
 	}	
 }
 }
 
 
@@ -384,8 +384,7 @@ void output_close_i2s(void) {
 	running = false;
 	running = false;
 	UNLOCK;
 	UNLOCK;
 	
 	
-	while (!ended) usleep(20*1000);
-	vTaskDelete(output_i2s_task);
+	while (!ended) vTaskDelay(20 / portTICK_PERIOD_MS);
 	if (stats) vTaskDelete(stats_task);
 	if (stats) vTaskDelete(stats_task);
 	
 	
 	i2s_driver_uninstall(CONFIG_I2S_NUM);
 	i2s_driver_uninstall(CONFIG_I2S_NUM);
@@ -571,6 +570,7 @@ static void output_thread_i2s(void *arg) {
 		
 		
 	}
 	}
 	
 	
+	vTaskDelete(NULL);
 	if (spdif.enabled) free(spdif.buf);
 	if (spdif.enabled) free(spdif.buf);
 	ended = true;
 	ended = true;
 }
 }

+ 1 - 1
components/telnet/telnet.c

@@ -148,7 +148,7 @@ void start_telnet(void * pvParameter){
 	StackType_t *xStack = heap_caps_malloc(TELNET_STACK_SIZE,(MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT));
 	StackType_t *xStack = heap_caps_malloc(TELNET_STACK_SIZE,(MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT));
 	
 	
 	if(!isStarted && bIsEnabled) {
 	if(!isStarted && bIsEnabled) {
-		xTaskCreateStatic( (TaskFunction_t) &telnet_task, "telnet", TELNET_STACK_SIZE, NULL, ESP_TASK_MAIN_PRIO , xStack, xTaskBuffer);
+		xTaskCreateStatic( (TaskFunction_t) &telnet_task, "telnet", TELNET_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN, xStack, xTaskBuffer);
 		isStarted=true;
 		isStarted=true;
 	}
 	}
 }
 }

+ 1 - 0
components/wifi-manager/wifi_manager_http_server.c

@@ -135,6 +135,7 @@ esp_err_t http_server_start()
     config.max_uri_handlers = 25;
     config.max_uri_handlers = 25;
     config.max_open_sockets = 8;
     config.max_open_sockets = 8;
     config.uri_match_fn = httpd_uri_match_wildcard;
     config.uri_match_fn = httpd_uri_match_wildcard;
+	config.task_priority = ESP_TASK_PRIO_MIN;
     //todo:  use the endpoint below to configure session token?
     //todo:  use the endpoint below to configure session token?
     // config.open_fn
     // config.open_fn