Skip to content

Commit 98c493c

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 #697 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 219d36c commit 98c493c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cores/arduino/stm32/rtc.c

Lines changed: 2 additions & 2 deletions
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

4343
#ifdef __cplusplus
4444
extern "C" {
@@ -695,6 +695,6 @@ void RTC_Alarm_IRQHandler(void)
695695
}
696696
#endif
697697

698-
#endif /* HAL_RTC_MODULE_ENABLED */
698+
#endif /* HAL_RTC_MODULE_ENABLED && !HAL_RTC_MODULE_ONLY */
699699

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

cores/arduino/stm32/rtc.h

Lines changed: 2 additions & 2 deletions
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)