diff --git a/components/raop/raop.c b/components/raop/raop.c index 20412d73..33f4f694 100644 --- a/components/raop/raop.c +++ b/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)) ); 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 return ctx; @@ -518,7 +518,7 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock) ctx->active_remote.running = true; 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.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 } else if (!strcmp(method, "SETUP") && ((buf = kd_lookup(headers, "Transport")) != NULL)) { diff --git a/components/services/buttons.c b/components/services/buttons.c index c7fd1973..1fb687fa 100644 --- a/components/services/buttons.c +++ b/components/services/buttons.c @@ -76,7 +76,7 @@ static void common_task_init(void) { if (!common_queue_set) { 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); } } diff --git a/components/squeezelite/output_i2s.c b/components/squeezelite/output_i2s.c index 918eb0c1..d554a3f6 100644 --- a/components/squeezelite/output_i2s.c +++ b/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 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, - 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; UNLOCK; - while (!ended) usleep(20*1000); - vTaskDelete(output_i2s_task); + while (!ended) vTaskDelay(20 / portTICK_PERIOD_MS); if (stats) vTaskDelete(stats_task); 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); ended = true; } diff --git a/components/telnet/telnet.c b/components/telnet/telnet.c index 66ddf69d..507f4993 100644 --- a/components/telnet/telnet.c +++ b/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)); 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; } } diff --git a/components/wifi-manager/wifi_manager_http_server.c b/components/wifi-manager/wifi_manager_http_server.c index 1bd54802..e9374646 100644 --- a/components/wifi-manager/wifi_manager_http_server.c +++ b/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_open_sockets = 8; config.uri_match_fn = httpd_uri_match_wildcard; + config.task_priority = ESP_TASK_PRIO_MIN; //todo: use the endpoint below to configure session token? // config.open_fn