2016-10-25 10:18:11 +00:00
|
|
|
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
#ifndef __ESP_TASK_WDT_H
|
|
|
|
#define __ESP_TASK_WDT_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-10-26 04:23:01 +00:00
|
|
|
|
2017-09-30 10:07:19 +00:00
|
|
|
/** \defgroup Watchdog_APIs Watchdog APIs
|
|
|
|
* @brief Watchdog APIs
|
2016-10-25 10:18:11 +00:00
|
|
|
*/
|
2017-08-30 13:11:10 +00:00
|
|
|
|
2017-09-30 10:07:19 +00:00
|
|
|
/** @addtogroup Watchdog_APIs
|
|
|
|
* @{
|
|
|
|
*/
|
2016-10-21 09:59:57 +00:00
|
|
|
|
2017-09-30 10:07:19 +00:00
|
|
|
/*
|
|
|
|
This routine enables a more general-purpose task watchdog: tasks can individually
|
|
|
|
feed the watchdog and the watchdog will bark if one or more tasks haven't fed the
|
|
|
|
watchdog within the specified time. Optionally, the idle tasks can also configured
|
|
|
|
to feed the watchdog in a similar fashion, to detect CPU starvation.
|
|
|
|
|
|
|
|
This uses the TIMERG0 WDT.
|
|
|
|
*/
|
2016-10-25 10:18:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2017-09-30 10:07:19 +00:00
|
|
|
* @brief Initialize the task watchdog. This is called in the init code, if the
|
|
|
|
* task watchdog is enabled in menuconfig.
|
2017-08-30 13:11:10 +00:00
|
|
|
*
|
2016-10-25 10:18:11 +00:00
|
|
|
*/
|
2017-09-30 10:07:19 +00:00
|
|
|
void esp_task_wdt_init();
|
2016-10-25 10:18:11 +00:00
|
|
|
|
|
|
|
/**
|
2017-09-30 10:07:19 +00:00
|
|
|
* @brief Feed the watchdog. After the first feeding session, the watchdog will expect the calling
|
|
|
|
* task to keep feeding the watchdog until task_wdt_delete() is called.
|
2017-08-30 13:11:10 +00:00
|
|
|
*
|
2016-10-25 10:18:11 +00:00
|
|
|
*/
|
2017-09-30 10:07:19 +00:00
|
|
|
|
|
|
|
void esp_task_wdt_feed();
|
|
|
|
|
2016-10-25 10:18:11 +00:00
|
|
|
|
2017-08-30 13:11:10 +00:00
|
|
|
/**
|
2017-09-30 10:07:19 +00:00
|
|
|
* @brief Delete the watchdog for the current task.
|
2017-08-30 13:11:10 +00:00
|
|
|
*
|
|
|
|
*/
|
2017-09-30 10:07:19 +00:00
|
|
|
void esp_task_wdt_delete();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2016-10-25 10:18:11 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-09-30 10:07:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|