wdt: Remove deprecated esp_task_wdt_feed() function

Deprecated in ESP-IDF V3.1
This commit is contained in:
Angus Gratton
2019-08-21 12:47:12 +10:00
committed by Angus Gratton
parent 480bd0360f
commit dc7d6d592e
2 changed files with 0 additions and 59 deletions
-43
View File
@@ -387,46 +387,3 @@ esp_err_t esp_task_wdt_status(TaskHandle_t handle)
portEXIT_CRITICAL(&twdt_spinlock);
return ESP_ERR_NOT_FOUND;
}
void esp_task_wdt_feed(void)
{
portENTER_CRITICAL(&twdt_spinlock);
//Return immediately if TWDT has not been initialized
ASSERT_EXIT_CRIT_RETURN((twdt_config != NULL), VOID_RETURN);
//Check if task is on list
TaskHandle_t handle = xTaskGetCurrentTaskHandle();
bool all_reset;
twdt_task_t *target_task = find_task_in_twdt_list(handle, &all_reset);
//reset the task if it's on the list, then return
if(target_task != NULL){
target_task->has_reset = true;
if(all_reset){
reset_hw_timer(); //Reset hardware timer if all other tasks have reset
}
portEXIT_CRITICAL(&twdt_spinlock);
return;
}
//Add task if it's has not on list
target_task = calloc(1, sizeof(twdt_task_t));
ASSERT_EXIT_CRIT_RETURN((target_task != NULL), VOID_RETURN); //If calloc failed
target_task->task_handle = handle;
target_task->has_reset = true;
target_task->next = NULL;
if (twdt_config->list == NULL) { //Adding to empty list
twdt_config->list = target_task;
} else { //Adding to tail of list
twdt_task_t *task;
for (task = twdt_config->list; task->next != NULL; task = task->next){
; //point task to current tail of wdt task list
}
task->next = target_task;
}
portEXIT_CRITICAL(&twdt_spinlock);
}