Skip to content

Commit f361a43

Browse files
committed
STM32L1 - Rename RTC_LSI
1 parent da44e99 commit f361a43

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
@@ -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_STM32L1/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_LSI | RCC_OSCILLATORTYPE_LSE;
7676
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
@@ -128,7 +128,7 @@ void rtc_init(void)
128128
}
129129

130130
#if DEVICE_LOWPOWERTIMER
131-
#if DEVICE_RTC_LSI
131+
#if RTC_LSI
132132
rtc_write(0);
133133
#else
134134
if (!rtc_isenabled()) {
@@ -144,7 +144,7 @@ void rtc_init(void)
144144

145145
void rtc_free(void)
146146
{
147-
#if DEVICE_RTC_LSI
147+
#if RTC_LSI
148148
// Enable Power clock
149149
__PWR_CLK_ENABLE();
150150

@@ -167,14 +167,14 @@ void rtc_free(void)
167167
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
168168
HAL_RCC_OscConfig(&RCC_OscInitStruct);
169169

170-
#if DEVICE_RTC_LSI
170+
#if RTC_LSI
171171
rtc_inited = 0;
172172
#endif
173173
}
174174

175175
int rtc_isenabled(void)
176176
{
177-
#if DEVICE_RTC_LSI
177+
#if RTC_LSI
178178
return rtc_inited;
179179
#else
180180
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {

0 commit comments

Comments
 (0)