In the ANCS service to add wdt, the program has been reset, the use of the protocol stack is SDK9.0.0
In the ANCS service to add wdt, the program has been reset, the use of the protocol stack is SDK9.0.0
enter code here
db_discovery_init();
scheduler_init();
gap_params_init();
service_init();
advertising_init();
conn_params_init();
//Start execution.
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
WDTconfig();
//Enter main loop.
for (;;)
{
app_sched_execute();
wdt_feed();
power_manage();
}
void WDTconfig(void)
{
uint32_t err_code;
//Configure WDT.
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;
err_code = nrf_drv_wdt_init(&config, wdt_event_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_wdt_channel_alloc(&m_channel_id);
APP_ERROR_CHECK(err_code);
nrf_drv_wdt_enable();
}
This is the watchdog initialization procedure
void wdt_feed(void)
{
nrf_drv_wdt_channel_feed(m_channel_id);
}
This is a feeding dog program
enter code here
db_discovery_init();
scheduler_init();
gap_params_init();
service_init();
advertising_init();
conn_params_init();
//Start execution.
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
WDTconfig();
//Enter main loop.
for (;;)
{
app_sched_execute();
wdt_feed();
power_manage();
}
void WDTconfig(void)
{
uint32_t err_code;
//Configure WDT.
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;
err_code = nrf_drv_wdt_init(&config, wdt_event_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_wdt_channel_alloc(&m_channel_id);
APP_ERROR_CHECK(err_code);
nrf_drv_wdt_enable();
}
This is the watchdog initialization procedure
void wdt_feed(void)
{
nrf_drv_wdt_channel_feed(m_channel_id);
}
This is a feeding dog program