Skip to content

Commit e04569d

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

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: cores/arduino/stm32/low_power.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "Arduino.h"
4040
#include "low_power.h"
4141

42-
#ifdef HAL_PWR_MODULE_ENABLED
42+
#if defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
4343

4444
#ifdef __cplusplus
4545
extern "C" {
@@ -346,6 +346,6 @@ WEAK void SystemClock_ConfigFromStop(void)
346346
}
347347
#endif
348348

349-
#endif /* HAL_PWR_MODULE_ENABLED */
349+
#endif /* HAL_PWR_MODULE_ENABLED && !HAL_PWR_MODULE_ONLY */
350350

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

Diff for: cores/arduino/stm32/low_power.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include "stm32_def.h"
4444
#include "uart.h"
4545

46-
#ifdef HAL_PWR_MODULE_ENABLED
46+
#if defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
4747

4848
#ifdef __cplusplus
4949
extern "C" {
@@ -67,6 +67,6 @@ void SystemClock_ConfigFromStop(void);
6767
}
6868
#endif
6969

70-
#endif /* HAL_PWR_MODULE_ENABLED */
70+
#endif /* HAL_PWR_MODULE_ENABLED && !HAL_PWR_MODULE_ONLY */
7171

7272
#endif /* __LOW_POWER_H */

0 commit comments

Comments
 (0)