Skip to content

Commit 94c70be

Browse files
masz-nordiccarlescufi
authored andcommitted
mpsl: init: verify enabled instances with DT
Since nrfx driver instances are no longer exposed in Kconfig, DT should be used to assert instances will not be used by both MPSL and application. Signed-off-by: Marcin Szymczyk <[email protected]>
1 parent 882b34e commit 94c70be

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

subsys/mpsl/init/mpsl_init.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ extern void rtc_pretick_rtc0_isr_hook(void);
5656

5757
#if IS_ENABLED(CONFIG_COUNTER)
5858
#if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF52X) || IS_ENABLED(CONFIG_SOC_NRF5340_CPUNET)
59-
BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_RTC0), "MPSL reserves RTC0 on this SoC.");
60-
BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER0), "MPSL reserves TIMER0 on this SoC.");
59+
BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(rtc0)),
60+
"MPSL reserves RTC0 on this SoC.");
61+
BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer0)),
62+
"MPSL reserves TIMER0 on this SoC.");
6163
#elif IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF54LX) || IS_ENABLED(CONFIG_SOC_SERIES_NRF71X)
62-
BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER10), "MPSL reserves TIMER10 on this SoC.");
64+
BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer10)),
65+
"MPSL reserves TIMER10 on this SoC.");
6366
#elif IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX)
64-
BUILD_ASSERT(!IS_ENABLED(CONFIG_NRFX_TIMER020), "MPSL reserves TIMER020 on this SoC.");
67+
BUILD_ASSERT(!DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(timer020)),
68+
"MPSL reserves TIMER020 on this SoC.");
6569
#else
6670
#error
6771
#endif

0 commit comments

Comments
 (0)