tests: drivers: counter: support STM32 w/o RTC
This commit adds a missing #ifdef check which prevents building the
'counter_basic_api' test for boards under the following conditions:
* RTC node is defined in device tree (compatible = "st,stm32-rtc")
* RTC node is disabled in device tree (status = "disabled")
* Kconfig "CONFIG_COUNTER_RTC_STM32=n" is specified
This check matches the ones done a few lines above for NXP MCUs.
Without this check, building the test under the conditions listed above
failed with the infamous `undefined reference to '__device_dts_ord_N'`
linker error, because the test attempts to obtain RTC's `struct device`
despite CONFIG_COUNTER_RTC_STM32=n, which ultimately fails because the
RTC driver is not built unless there is an enabled RTC node in DT.
Signed-off-by:
Mathieu Choplain <mathieu.choplain@st.com>
Loading
Please sign in to comment