Skip to content

Commit faae463

Browse files
committed
STM32F3 - Rename RTC_LSI
1 parent 574e7b7 commit faae463

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

hal/targets.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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"},
@@ -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
},

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;

0 commit comments

Comments
 (0)