|
|
@ -13,6 +13,23 @@ |
|
|
|
#include "nrf_log_ctrl.h" |
|
|
|
#include "nrf_log_default_backends.h" |
|
|
|
#include "nrfx_rtc.h" |
|
|
|
/********************************************************************* |
|
|
|
* INCLUDES |
|
|
|
*/ |
|
|
|
#include "nrf_drv_wdt.h" |
|
|
|
nrf_drv_wdt_channel_id m_channel_id; |
|
|
|
|
|
|
|
void wd_init() { |
|
|
|
// WDT_CONFIG_RELOAD_VALUE 修改这个数值修改喂狗周期,单位ms |
|
|
|
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG; |
|
|
|
config.reload_value = WDT_CONFIG_RELOAD_VALUE; |
|
|
|
ret_code_t err_code = nrf_drv_wdt_init(&config, NULL); |
|
|
|
ZERROR_CHECK(err_code); |
|
|
|
err_code = nrf_drv_wdt_channel_alloc(&m_channel_id); |
|
|
|
ZERROR_CHECK(err_code); |
|
|
|
nrf_drv_wdt_enable(); |
|
|
|
} |
|
|
|
void wd_feed() { nrfx_wdt_feed(); } |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* RTC * |
|
|
|