12345678910111213141516171819202122232425262728293031 |
- #include "sdk_common.h"
- #include "SEGGER_RTT.h"
- #include "nrf_drv_pwm.h"
- #include "usr_config.h"
- #include "nrf_drv_wdt.h"
- #if WATCHDOG_ENANBLE
- nrf_drv_wdt_channel_id m_channel_id;
- void feed_watchdog(void)
- {
- nrf_drv_wdt_channel_feed(m_channel_id);
- }
- /**
- * @brief WDT events handler.
- */
- void wdt_event_handler(void)
- {
- }
- void watchdog_init(void){
- uint32_t err_code;
- 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();
- }
- #endif
|