Skip to content

Commit

Permalink
chore(improv wifi): Reduce task priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Slider0007 committed Oct 26, 2024
1 parent ea52a5c commit 97a7e05
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/components/fileserver_ota/server_ota.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void checkOTAUpdate()
deleteFile("/sdcard/update.txt"); // Prevent Boot Loop!!!

LogFile.writeToFile(ESP_LOG_INFO, TAG, "Prepare update process | File: " + file_name_update);
xTaskCreate(&task_ota_update, "task_ota_update", configMINIMAL_STACK_SIZE * 35, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate(&task_ota_update, "task_ota_update", configMINIMAL_STACK_SIZE * 35, NULL, tskIDLE_PRIORITY + 1, NULL);

while(1) { // wait until reboot within task_do_update
vTaskDelay(1000 / portTICK_PERIOD_MS);
Expand Down
4 changes: 3 additions & 1 deletion code/components/mainprocess_ctrl/MainFlowControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,8 @@ void task_autodoFlow(void *pvParameter)
LogFile.writeToFile(ESP_LOG_ERROR, TAG, "taskAutoFlowState: Invalid state called. Programming error");
flowctrl.setActualProcessState(std::string(FLOW_INVALID_STATE));
}

taskYIELD();
}

// Delete task if it exits from the loop above
Expand All @@ -1216,7 +1218,7 @@ void createMainFlowTask()
LogFile.writeToFile(ESP_LOG_INFO, TAG, "Process state: " + std::string(FLOW_CREATE_FLOW_TASK));
flowctrl.setActualProcessState(std::string(FLOW_CREATE_FLOW_TASK));

BaseType_t xReturned = xTaskCreatePinnedToCore(&task_autodoFlow, "task_autodoFlow", 12 * 1024, NULL, tskIDLE_PRIORITY+2, &xHandletask_autodoFlow, 0);
BaseType_t xReturned = xTaskCreatePinnedToCore(&task_autodoFlow, "task_autodoFlow", 12 * 1024, NULL, tskIDLE_PRIORITY + 3, &xHandletask_autodoFlow, 0);
if( xReturned != pdPASS ) {
LogFile.writeToFile(ESP_LOG_ERROR, TAG, "Failed to create task_autodoFlow");
LogFile.writeHeapInfo("CreateFlowTask: Failed to create task");
Expand Down
2 changes: 1 addition & 1 deletion code/components/misc_helper/statusled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void setStatusLed(StatusLedSource _eSource, int _iCode, bool _bInfinite)
}
else if (xHandle_task_StatusLED == NULL) {
StatusLEDData.bProcessingRequest = true;
BaseType_t xReturned = xTaskCreate(&task_StatusLED, "task_StatusLED", 1280, NULL, tskIDLE_PRIORITY+1, &xHandle_task_StatusLED);
BaseType_t xReturned = xTaskCreate(&task_StatusLED, "task_StatusLED", 1280, NULL, tskIDLE_PRIORITY + 1, &xHandle_task_StatusLED);
if(xReturned != pdPASS)
{
xHandle_task_StatusLED = NULL;
Expand Down
2 changes: 1 addition & 1 deletion code/components/misc_helper/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void taskSocTemp(void *pvParameter)
void initSOCTemperatureSensor()
{
// Create a dedicated task to ensure access temperature ressource only from a single source
BaseType_t xReturned = xTaskCreate(&taskSocTemp, "taskSocTemp", 2048, NULL, tskIDLE_PRIORITY+1, NULL);
BaseType_t xReturned = xTaskCreate(&taskSocTemp, "taskSocTemp", 2048, NULL, tskIDLE_PRIORITY + 1, NULL);

if( xReturned != pdPASS ) {
LogFile.writeToFile(ESP_LOG_ERROR, TAG, "Failed to create taskSocTemp");
Expand Down
3 changes: 2 additions & 1 deletion code/components/wlan_ctrl/improvWifiProvisioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static void improvTask(void *pvParameters)
{
while (true) {
improvEventHandler();
taskYIELD();
}
}

Expand Down Expand Up @@ -315,7 +316,7 @@ void improvInit(void)
}
#endif // USB_SERIAL

BaseType_t xReturned = xTaskCreate(&improvTask, "improv", 4 * 1024, NULL, tskIDLE_PRIORITY + 4, &improvTaskHandle);
BaseType_t xReturned = xTaskCreate(&improvTask, "improv", 4 * 1024, NULL, tskIDLE_PRIORITY + 1, &improvTaskHandle);
if (xReturned != pdPASS) {
LogFile.writeToFile(ESP_LOG_ERROR, TAG, "Failed to create task 'improv'");
}
Expand Down

0 comments on commit 97a7e05

Please sign in to comment.