2012-04-16 00:31:05 +02:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
2015-06-28 16:14:53 +02:00
|
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
2012-04-16 00:31:05 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
config EXAMPLES_WATCHDOG
|
2018-09-03 17:29:56 +02:00
|
|
|
tristate "Watchdog Timer example"
|
2012-04-16 00:31:05 +02:00
|
|
|
default n
|
2021-05-14 10:10:01 +02:00
|
|
|
depends on WATCHDOG
|
2012-04-16 00:31:05 +02:00
|
|
|
---help---
|
|
|
|
Enable the watchdog timer example
|
|
|
|
|
2016-05-19 03:21:51 +02:00
|
|
|
In order to use this example, board specific logic must register the
|
|
|
|
watchdog timer driver. That would be in the board bring-up logic
|
2019-08-09 16:40:22 +02:00
|
|
|
in the boards/<arch/<chip>/<board>/src directory for the board.
|
2016-05-19 03:21:51 +02:00
|
|
|
|
|
|
|
The way that this is done depends on the underlying MCU architecture.
|
|
|
|
For STM32, this would be done like:
|
|
|
|
|
|
|
|
#include "stm32_wdg.h"
|
|
|
|
|
|
|
|
#if defined(CONFIG_STM32_WWDG)
|
|
|
|
stm32_wwdginitialize(CONFIG_STM32_WDG_DEVPATH);
|
|
|
|
#elif defined(CONFIG_STM32_IWDG)
|
|
|
|
stm32_iwdginitialize(CONFIG_STM32_WDG_DEVPATH, CONFIG_STM32_LSIFREQ);
|
|
|
|
#endif
|
|
|
|
|
2016-05-19 03:50:55 +02:00
|
|
|
For some Atmel SAM configurations, the board-specific initialization
|
|
|
|
sequence would be like:
|
|
|
|
|
|
|
|
#include "sam_wdt.h"
|
|
|
|
|
|
|
|
sam_wdt_initialize();
|
|
|
|
|
2012-04-16 00:31:05 +02:00
|
|
|
if EXAMPLES_WATCHDOG
|
|
|
|
|
|
|
|
config EXAMPLES_WATCHDOG_DEVPATH
|
|
|
|
string "Watchdog device path"
|
|
|
|
default "/dev/watchdog0"
|
|
|
|
---help---
|
|
|
|
The path to the watchdog device. Default: /dev/watchdog0
|
|
|
|
|
2013-04-25 23:52:00 +02:00
|
|
|
config EXAMPLES_WATCHDOG_PINGTIME
|
2012-04-16 00:31:05 +02:00
|
|
|
int "Watchdog ping time"
|
|
|
|
default 5000
|
|
|
|
---help---
|
|
|
|
Time in milliseconds that the example will ping the watchdog before letting the
|
|
|
|
watchdog expire. Default: 5000 milliseconds.
|
|
|
|
|
2013-04-25 23:52:00 +02:00
|
|
|
config EXAMPLES_WATCHDOG_PINGDELAY
|
2012-04-16 00:31:05 +02:00
|
|
|
int "Watchdog ping delay"
|
|
|
|
default 500
|
|
|
|
---help---
|
|
|
|
Time delay between pings in milliseconds. Default: 500 milliseconds.
|
|
|
|
|
|
|
|
config EXAMPLES_WATCHDOG_TIMEOUT
|
|
|
|
int "Watchdog timeout"
|
|
|
|
default 2000
|
|
|
|
---help---
|
|
|
|
The watchdog timeout value in milliseconds before the watchdog timer
|
|
|
|
expires. Default: 2000 milliseconds.
|
|
|
|
|
|
|
|
endif
|