Skip to content

Commit 9053d3b

Browse files
committed
STM32F0 - Rename RTC_LSI
1 parent 2564a83 commit 9053d3b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

hal/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@
624624
"core": "Cortex-M0",
625625
"default_toolchain": "uARM",
626626
"extra_labels": ["STM", "STM32F0", "STM32F031K6"],
627-
"macros": ["DEVICE_RTC_LSI=1"],
627+
"macros": ["RTC_LSI=1"],
628628
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
629629
"inherits": ["Target"],
630630
"progen": {"target": "nucleo-f031k6"},
@@ -638,7 +638,7 @@
638638
"core": "Cortex-M0",
639639
"default_toolchain": "uARM",
640640
"extra_labels": ["STM", "STM32F0", "STM32F042K6"],
641-
"macros": ["DEVICE_RTC_LSI=1"],
641+
"macros": ["RTC_LSI=1"],
642642
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
643643
"inherits": ["Target"],
644644
"progen": {"target": "nucleo-f042k6"},

hal/targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434

3535
#include "mbed_error.h"
3636

37-
#if DEVICE_RTC_LSI
37+
#if RTC_LSI
3838
static int rtc_inited = 0;
3939
#endif
4040

4141
static RTC_HandleTypeDef RtcHandle;
4242

43-
#if DEVICE_RTC_LSI
43+
#if RTC_LSI
4444
#define RTC_CLOCK LSI_VALUE
4545
#else
4646
#define RTC_CLOCK LSE_VALUE
@@ -62,14 +62,14 @@ static RTC_HandleTypeDef RtcHandle;
6262
void rtc_init(void) {
6363
RCC_OscInitTypeDef RCC_OscInitStruct;
6464

65-
#if DEVICE_RTC_LSI
65+
#if RTC_LSI
6666
if (rtc_inited) return;
6767
rtc_inited = 1;
6868
#endif
6969

7070
RtcHandle.Instance = RTC;
7171

72-
#if !DEVICE_RTC_LSI
72+
#if !RTC_LSI
7373
// Enable LSE Oscillator
7474
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
7575
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
@@ -119,7 +119,7 @@ void rtc_init(void) {
119119
}
120120

121121
#if DEVICE_LOWPOWERTIMER
122-
#if DEVICE_RTC_LSI
122+
#if RTC_LSI
123123
rtc_write(0);
124124
#else
125125
if (!rtc_isenabled()) {
@@ -134,7 +134,7 @@ void rtc_init(void) {
134134
}
135135

136136
void rtc_free(void) {
137-
#if DEVICE_RTC_LSI
137+
#if RTC_LSI
138138
// Enable Power clock
139139
__PWR_CLK_ENABLE();
140140

@@ -157,13 +157,13 @@ void rtc_free(void) {
157157
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
158158
HAL_RCC_OscConfig(&RCC_OscInitStruct);
159159

160-
#if DEVICE_RTC_LSI
160+
#if RTC_LSI
161161
rtc_inited = 0;
162162
#endif
163163
}
164164

165165
int rtc_isenabled(void) {
166-
#if DEVICE_RTC_LSI
166+
#if RTC_LSI
167167
return rtc_inited;
168168
#else
169169
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {

0 commit comments

Comments
 (0)