Skip to content

Commit 8640147

Browse files
EmilioCBenkartben
authored andcommitted
driver: counter: mcux_rtc: Move FSL check
Move FSL Check to after the code decided that FSL has been defined. Signed-off-by: Emilio Benavente <[email protected]>
1 parent bc236f9 commit 8640147

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/counter/counter_mcux_rtc.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
#include <fsl_rtc.h>
1515
#include <zephyr/logging/log.h>
1616

17+
/*
18+
* FSL_FEATURE_* is defined with paranethesis
19+
* which is not acceptable when using the IS_ENABLED() macro
20+
*/
21+
#if (defined(FSL_FEATURE_RTC_HAS_LPO_ADJUST) && FSL_FEATURE_RTC_HAS_LPO_ADJUST)
22+
#define NXP_RTC_HAS_LPO_ADJUST 1
23+
#else
24+
#define NXP_RTC_HAS_LPO_ADJUST 0
25+
#endif
26+
1727
LOG_MODULE_REGISTER(mcux_rtc, CONFIG_COUNTER_LOG_LEVEL);
1828

1929
struct mcux_rtc_data {
@@ -241,9 +251,10 @@ static int mcux_rtc_init(const struct device *dev)
241251
* "LPO": 1
242252
*/
243253
BUILD_ASSERT((((DT_INST_ENUM_IDX(0, clock_source) == 1) &&
244-
FSL_FEATURE_RTC_HAS_LPO_ADJUST) ||
254+
NXP_RTC_HAS_LPO_ADJUST) ||
245255
DT_INST_ENUM_IDX(0, clock_source) == 0),
246256
"Cannot choose the LPO clock for that instance of the RTC");
257+
247258
#if (defined(FSL_FEATURE_RTC_HAS_LPO_ADJUST) && FSL_FEATURE_RTC_HAS_LPO_ADJUST)
248259
/* The RTC prescaler increments using the LPO 1 kHz clock
249260
* instead of the RTC clock

0 commit comments

Comments
 (0)