|
446 | 446 | #if CONFIG_BOOT_WATCHDOG_FEED_NRFX_WDT |
447 | 447 | #include <nrfx_wdt.h> |
448 | 448 |
|
449 | | -#define FEED_WDT_INST(id) \ |
| 449 | +#define FEED_WDT_INST(inst) \ |
450 | 450 | do { \ |
451 | | - nrfx_wdt_t wdt_inst_##id = NRFX_WDT_INSTANCE(id); \ |
452 | 451 | for (uint8_t i = 0; i < NRF_WDT_CHANNEL_NUMBER; i++) \ |
453 | 452 | { \ |
454 | | - nrf_wdt_reload_request_set(wdt_inst_##id.p_reg, \ |
| 453 | + nrf_wdt_reload_request_set(inst, \ |
455 | 454 | (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + i)); \ |
456 | 455 | } \ |
457 | 456 | } while (0) |
458 | | -#if defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) |
459 | | -#define MCUBOOT_WATCHDOG_FEED() \ |
460 | | - do { \ |
461 | | - FEED_WDT_INST(0); \ |
462 | | - FEED_WDT_INST(1); \ |
| 457 | +#if defined(NRF_WDT0) && defined(NRF_WDT1) |
| 458 | +#define MCUBOOT_WATCHDOG_FEED() \ |
| 459 | + do { \ |
| 460 | + FEED_WDT_INST(NRF_WDT0); \ |
| 461 | + FEED_WDT_INST(NRF_WDT1); \ |
463 | 462 | } while (0) |
464 | | -#elif defined(CONFIG_NRFX_WDT0) |
465 | | -#define MCUBOOT_WATCHDOG_FEED() \ |
466 | | - FEED_WDT_INST(0); |
467 | | -#elif defined(CONFIG_NRFX_WDT30) && defined(CONFIG_NRFX_WDT31) |
| 463 | +#elif defined(NRF_WDT0) |
468 | 464 | #define MCUBOOT_WATCHDOG_FEED() \ |
469 | | - do { \ |
470 | | - FEED_WDT_INST(30); \ |
471 | | - FEED_WDT_INST(31); \ |
| 465 | + FEED_WDT_INST(NRF_WDT0); |
| 466 | +#elif defined(NRF_WDT30) && defined(NRF_WDT31) |
| 467 | +#define MCUBOOT_WATCHDOG_FEED() \ |
| 468 | + do { \ |
| 469 | + FEED_WDT_INST(NRF_WDT30); \ |
| 470 | + FEED_WDT_INST(NRF_WDT31); \ |
472 | 471 | } while (0) |
473 | | -#elif defined(CONFIG_NRFX_WDT30) |
| 472 | +#elif defined(NRF_WDT30) |
474 | 473 | #define MCUBOOT_WATCHDOG_FEED() \ |
475 | | - FEED_WDT_INST(30); |
476 | | -#elif defined(CONFIG_NRFX_WDT31) |
| 474 | + FEED_WDT_INST(NRF_WDT30); |
| 475 | +#elif defined(NRF_WDT31) |
477 | 476 | #define MCUBOOT_WATCHDOG_FEED() \ |
478 | | - FEED_WDT_INST(31); |
479 | | -#elif defined(CONFIG_NRFX_WDT010) |
| 477 | + FEED_WDT_INST(NRF_WDT31); |
| 478 | +#elif defined(NRF_WDT010) |
480 | 479 | #define MCUBOOT_WATCHDOG_FEED() \ |
481 | | - FEED_WDT_INST(010); |
| 480 | + FEED_WDT_INST(NRF_WDT010); |
482 | 481 | #else |
483 | 482 | #error "No NRFX WDT instances enabled" |
484 | 483 | #endif |
|
0 commit comments