Skip to content

Commit 49e9627

Browse files
authored
Merge pull request #2816 from svastm/rename_rtc_lsi
STM32 - Rename RTC_LSI
2 parents d8e484d + d37e4d8 commit 49e9627

File tree

10 files changed

+76
-76
lines changed

10 files changed

+76
-76
lines changed

hal/targets.json

Lines changed: 12 additions & 12 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"},
@@ -726,7 +726,7 @@
726726
"core": "Cortex-M4F",
727727
"default_toolchain": "ARM",
728728
"extra_labels": ["STM", "STM32F3", "STM32F303K8"],
729-
"macros": ["DEVICE_RTC_LSI=1"],
729+
"macros": ["RTC_LSI=1"],
730730
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
731731
"inherits": ["Target"],
732732
"progen": {"target": "nucleo-f303k8"},
@@ -832,8 +832,8 @@
832832
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
833833
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
834834
"progen": {"target": "nucleo-f429zi"},
835-
"macros": ["DEVICE_RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
836-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
835+
"macros": ["RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
836+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
837837
"detect_code": ["0796"],
838838
"features": ["IPV4"],
839839
"release_versions": ["2", "5"]
@@ -1041,20 +1041,20 @@
10411041
"core": "Cortex-M4F",
10421042
"default_toolchain": "ARM",
10431043
"extra_labels": ["STM", "STM32F3", "STM32F303", "STM32F303VC"],
1044-
"macros": ["DEVICE_RTC_LSI=1"],
1044+
"macros": ["RTC_LSI=1"],
10451045
"supported_toolchains": ["GCC_ARM"],
1046-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"]
1046+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"]
10471047
},
10481048
"DISCO_F334C8": {
10491049
"inherits": ["Target"],
10501050
"core": "Cortex-M4F",
10511051
"default_toolchain": "ARM",
10521052
"extra_labels": ["STM", "STM32F3", "STM32F334C8"],
1053-
"macros": ["DEVICE_RTC_LSI=1"],
1053+
"macros": ["RTC_LSI=1"],
10541054
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
10551055
"progen": {"target": "disco-f334c8"},
10561056
"detect_code": ["0810"],
1057-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1057+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
10581058
"default_lib": "small",
10591059
"release_versions": ["2"]
10601060
},
@@ -1072,7 +1072,7 @@
10721072
"core": "Cortex-M4F",
10731073
"default_toolchain": "ARM",
10741074
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
1075-
"macros": ["DEVICE_RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
1075+
"macros": ["RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
10761076
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
10771077
"progen": {"target": "disco-f429zi"},
10781078
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
@@ -1192,7 +1192,7 @@
11921192
"core": "Cortex-M3",
11931193
"default_toolchain": "uARM",
11941194
"extra_labels": ["STM", "STM32L1", "STM32L152RC"],
1195-
"macros": ["DEVICE_RTC_LSI=1"],
1195+
"macros": ["RTC_LSI=1"],
11961196
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
11971197
"progen": {"target": "stm32l151rc"},
11981198
"detect_code": ["4100"],
@@ -1227,7 +1227,7 @@
12271227
"default_toolchain": "uARM",
12281228
"program_cycle_s": 1.5,
12291229
"extra_labels": ["STM", "STM32L1", "STM32L151RC"],
1230-
"macros": ["DEVICE_RTC_LSI=1"],
1230+
"macros": ["RTC_LSI=1"],
12311231
"supported_toolchains": ["ARM", "uARM", "GCC_ARM"],
12321232
"progen": {"target": "stm32l151rc"},
12331233
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],

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) {

hal/targets/hal/TARGET_STM/TARGET_STM32F1/rtc_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void rtc_init(void)
4646

4747
RtcHandle.Instance = RTC;
4848

49-
#if !DEVICE_RTC_LSI
49+
#if !RTC_LSI
5050
// Enable LSE Oscillator
5151
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
5252
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
@@ -94,7 +94,7 @@ void rtc_init(void)
9494

9595
void rtc_free(void)
9696
{
97-
#if DEVICE_RTC_LSI
97+
#if RTC_LSI
9898
// Enable Power clock
9999
__PWR_CLK_ENABLE();
100100

hal/targets/hal/TARGET_STM/TARGET_STM32F2/rtc_api.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "mbed_error.h"
3535

36-
#if DEVICE_RTC_LSI
36+
#if RTC_LSI
3737
static int rtc_inited = 0;
3838
#endif
3939

@@ -44,13 +44,13 @@ void rtc_init(void)
4444
RCC_OscInitTypeDef RCC_OscInitStruct;
4545
uint32_t rtc_freq = 0;
4646

47-
#if DEVICE_RTC_LSI
47+
#if RTC_LSI
4848
rtc_inited = 1;
4949
#endif
5050

5151
RtcHandle.Instance = RTC;
5252

53-
#if !DEVICE_RTC_LSI
53+
#if !RTC_LSI
5454
// Enable LSE Oscillator
5555
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
5656
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */
@@ -106,7 +106,7 @@ void rtc_init(void)
106106

107107
void rtc_free(void)
108108
{
109-
#if DEVICE_RTC_LSI
109+
#if RTC_LSI
110110
// Enable Power clock
111111
__PWR_CLK_ENABLE();
112112

@@ -128,14 +128,14 @@ void rtc_free(void)
128128
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
129129
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
130130
HAL_RCC_OscConfig(&RCC_OscInitStruct);
131-
#if DEVICE_RTC_LSI
131+
#if RTC_LSI
132132
rtc_inited = 0;
133133
#endif
134134
}
135135

136136
int rtc_isenabled(void)
137137
{
138-
#if DEVICE_RTC_LSI
138+
#if RTC_LSI
139139
return rtc_inited;
140140
#else
141141
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/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
@@ -63,14 +63,14 @@ void rtc_init(void)
6363
{
6464
RCC_OscInitTypeDef RCC_OscInitStruct;
6565

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

7171
RtcHandle.Instance = RTC;
7272

73-
#if !DEVICE_RTC_LSI
73+
#if !RTC_LSI
7474
// Enable LSE Oscillator
7575
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
7676
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()) {
@@ -135,7 +135,7 @@ void rtc_init(void)
135135

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

@@ -158,14 +158,14 @@ void rtc_free(void)
158158
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
159159
HAL_RCC_OscConfig(&RCC_OscInitStruct);
160160

161-
#if DEVICE_RTC_LSI
161+
#if RTC_LSI
162162
rtc_inited = 0;
163163
#endif
164164
}
165165

166166
int rtc_isenabled(void)
167167
{
168-
#if DEVICE_RTC_LSI
168+
#if RTC_LSI
169169
return rtc_inited;
170170
#else
171171
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return 1;

hal/targets/hal/TARGET_STM/TARGET_STM32F4/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
@@ -63,14 +63,14 @@ void rtc_init(void)
6363
{
6464
RCC_OscInitTypeDef RCC_OscInitStruct;
6565

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

7171
RtcHandle.Instance = RTC;
7272

73-
#if !DEVICE_RTC_LSI
73+
#if !RTC_LSI
7474
// Enable LSE Oscillator
7575
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
7676
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */
@@ -121,7 +121,7 @@ void rtc_init(void)
121121
}
122122

123123
#if DEVICE_LOWPOWERTIMER
124-
#if DEVICE_RTC_LSI
124+
#if RTC_LSI
125125
rtc_write(0);
126126
#else
127127
if (!rtc_isenabled()) {
@@ -137,7 +137,7 @@ void rtc_init(void)
137137

138138
void rtc_free(void)
139139
{
140-
#if DEVICE_RTC_LSI
140+
#if RTC_LSI
141141
// Enable Power clock
142142
__PWR_CLK_ENABLE();
143143

@@ -160,14 +160,14 @@ void rtc_free(void)
160160
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
161161
HAL_RCC_OscConfig(&RCC_OscInitStruct);
162162

163-
#if DEVICE_RTC_LSI
163+
#if RTC_LSI
164164
rtc_inited = 0;
165165
#endif
166166
}
167167

168168
int rtc_isenabled(void)
169169
{
170-
#if DEVICE_RTC_LSI
170+
#if RTC_LSI
171171
return rtc_inited;
172172
#else
173173
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return 1;

0 commit comments

Comments
 (0)