Skip to content

Commit 0ecc2b3

Browse files
zephyr: mcuboot_config: align nrfx_wdt usage
Instance config symbols are no longer present, replaced with presence for peripheral intself. No need to create instance of driver when using nrf api directly. Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
1 parent 2f77dea commit 0ecc2b3

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -446,39 +446,38 @@
446446
#if CONFIG_BOOT_WATCHDOG_FEED_NRFX_WDT
447447
#include <nrfx_wdt.h>
448448

449-
#define FEED_WDT_INST(id) \
449+
#define FEED_WDT_INST(inst) \
450450
do { \
451-
nrfx_wdt_t wdt_inst_##id = NRFX_WDT_INSTANCE(id); \
452451
for (uint8_t i = 0; i < NRF_WDT_CHANNEL_NUMBER; i++) \
453452
{ \
454-
nrf_wdt_reload_request_set(wdt_inst_##id.p_reg, \
453+
nrf_wdt_reload_request_set(inst, \
455454
(nrf_wdt_rr_register_t)(NRF_WDT_RR0 + i)); \
456455
} \
457456
} 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); \
463462
} 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)
468464
#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); \
472471
} while (0)
473-
#elif defined(CONFIG_NRFX_WDT30)
472+
#elif defined(NRF_WDT30)
474473
#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)
477476
#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)
480479
#define MCUBOOT_WATCHDOG_FEED() \
481-
FEED_WDT_INST(010);
480+
FEED_WDT_INST(NRF_WDT010);
482481
#else
483482
#error "No NRFX WDT instances enabled"
484483
#endif

0 commit comments

Comments
 (0)