From dc7d6d592e29310f432f63d871bcbd1569311aec Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 21 Aug 2019 12:47:12 +1000 Subject: [PATCH] wdt: Remove deprecated esp_task_wdt_feed() function Deprecated in ESP-IDF V3.1 --- components/esp32/task_wdt.c | 43 -------------------- components/esp_common/include/esp_task_wdt.h | 16 -------- 2 files changed, 59 deletions(-) diff --git a/components/esp32/task_wdt.c b/components/esp32/task_wdt.c index c1aa4e9761..37c5b8726e 100644 --- a/components/esp32/task_wdt.c +++ b/components/esp32/task_wdt.c @@ -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); -} - - diff --git a/components/esp_common/include/esp_task_wdt.h b/components/esp_common/include/esp_task_wdt.h index 554aa34974..cf64cfc147 100644 --- a/components/esp_common/include/esp_task_wdt.h +++ b/components/esp_common/include/esp_task_wdt.h @@ -141,22 +141,6 @@ esp_err_t esp_task_wdt_delete(TaskHandle_t handle); */ esp_err_t esp_task_wdt_status(TaskHandle_t handle); -/** - * @brief Reset the TWDT on behalf of the current running task, or - * subscribe the TWDT to if it has not done so already - * - * @warning This function is deprecated, use esp_task_wdt_add() and - * esp_task_wdt_reset() instead - * - * This function is similar to esp_task_wdt_reset() and will reset the TWDT on - * behalf of the current running task. However if this task has not subscribed - * to the TWDT, this function will automatically subscribe the task. Therefore, - * an unsubscribed task will subscribe to the TWDT on its first call to this - * function, then proceed to reset the TWDT on subsequent calls of this - * function. - */ -void esp_task_wdt_feed(void) __attribute__ ((deprecated)); - #ifdef __cplusplus } -- 2.40.0