Skip to content

Commit 34a757d

Browse files
committed
[RTC] Allow to enable HAL module only
Define `HAL_RTC_MODULE_ONLY` in `build_opt.h` or `hal_conf_extra.h` allow HAL RTC module usage without any usage by the core. Fixes stm32duino#697 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 2697be1 commit 34a757d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cores/arduino/stm32/rtc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#include "rtc.h"
4040

41-
#ifdef HAL_RTC_MODULE_ENABLED
41+
#if defined(HAL_RTC_MODULE_ENABLED) && !defined(HAL_RTC_MODULE_ONLY)
4242
#if defined(STM32MP1xx)
4343
/**
4444
* Currently there is no RTC driver for STM32MP1xx. If RTC is used in the future
@@ -704,6 +704,6 @@ void RTC_Alarm_IRQHandler(void)
704704
}
705705
#endif
706706

707-
#endif /* HAL_RTC_MODULE_ENABLED */
707+
#endif /* HAL_RTC_MODULE_ENABLED && !HAL_RTC_MODULE_ONLY */
708708

709709
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

cores/arduino/stm32/rtc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "backup.h"
4646
#include "clock.h"
4747

48-
#ifdef HAL_RTC_MODULE_ENABLED
48+
#if defined(HAL_RTC_MODULE_ENABLED) && !defined(HAL_RTC_MODULE_ONLY)
4949

5050
#ifdef __cplusplus
5151
extern "C" {
@@ -170,7 +170,7 @@ void detachAlarmCallback(void);
170170
}
171171
#endif
172172

173-
#endif /* HAL_RTC_MODULE_ENABLED */
173+
#endif /* HAL_RTC_MODULE_ENABLED && !HAL_RTC_MODULE_ONLY */
174174

175175
#endif /* __RTC_H */
176176

0 commit comments

Comments
 (0)