include/watchdog.h INIT_FUNC_WATCHDOG_INIT
#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG) #define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init, #define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset, #else #define INIT_FUNC_WATCHDOG_INIT #define INIT_FUNC_WATCHDOG_RESET #endif
#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG) static int init_func_watchdog_init(void) { # if defined(CONFIG_HW_WATCHDOG) && (defined(CONFIG_BLACKFIN) || \ defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \ defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \ defined(CONFIG_DESIGNWARE_WATCHDOG) || \ defined(CONFIG_IMX_WATCHDOG)) hw_watchdog_init(); puts(" Watchdog enabled\n"); # endif WATCHDOG_RESET();
return 0; }
int init_func_watchdog_reset(void) { WATCHDOG_RESET();
return 0; } #endif /* CONFIG_WATCHDOG */
本文介绍了如何在特定配置下实现Watchdog定时器的初始化及重置功能。通过条件编译来选择是否启用Watchdog定时器,并针对不同架构的硬件Watchdog提供初始化方法。此外,还提供了用于启动Watchdog定时器的函数。
2361

被折叠的 条评论
为什么被折叠?



