diff --git a/projects/01bsp_wdt/main.c b/projects/01bsp_wdt/main.c index c0183ede8..4819fb6b0 100644 --- a/projects/01bsp_wdt/main.c +++ b/projects/01bsp_wdt/main.c @@ -17,6 +17,12 @@ #define WDT_RELOAD_COUNT 5 +#if defined(NRF5340_XXAA) && (NRF_APPLICATION) +#define NRF_RESET NRF_RESET_S +#else +#define NRF_RESET NRF_RESET_NS +#endif + static void _wdt_cb(void *ctx) { (void)ctx; db_gpio_toggle(&db_led1); @@ -24,11 +30,11 @@ static void _wdt_cb(void *ctx) { int main(void) { printf("Starting watchdog timer\n"); -#if defined(BOARD_NRF5340DK) && (NRF_APPLICATION) +#if defined(NRF5340_XXAA) db_gpio_init(&db_led2, DB_GPIO_OUT); db_gpio_set(&db_led2); - uint32_t resetreas = NRF_RESET_S->RESETREAS; - NRF_RESET_S->RESETREAS = NRF_RESET_S->RESETREAS; + uint32_t resetreas = NRF_RESET->RESETREAS; + NRF_RESET->RESETREAS = NRF_RESET->RESETREAS; if (resetreas & RESET_RESETREAS_DOG0_Detected << RESET_RESETREAS_DOG0_Pos) { db_gpio_clear(&db_led2); } @@ -36,7 +42,7 @@ int main(void) { db_timer_hf_init(0); db_timer_hf_delay_s(0, 1); -#if defined(BOARD_NRF5340DK) && (NRF_APPLICATION) +#if defined(NRF5340_XXAA) db_gpio_set(&db_led2); #endif db_gpio_init(&db_led1, DB_GPIO_OUT);