Skip to content

Commit d37e4d8

Browse files
committed
STM32L4 - Rename RTC_LSI
1 parent f361a43 commit d37e4d8

File tree

1 file changed

+8
-8
lines changed
  • hal/targets/hal/TARGET_STM/TARGET_STM32L4

1 file changed

+8
-8
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32L4/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
@@ -64,14 +64,14 @@ void rtc_init(void)
6464
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
6565
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
6666

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

7272
RtcHandle.Instance = RTC;
7373

74-
#if !DEVICE_RTC_LSI
74+
#if !RTC_LSI
7575
// Enable LSE Oscillator
7676
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE;
7777
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
@@ -130,7 +130,7 @@ void rtc_init(void)
130130
}
131131

132132
#if DEVICE_LOWPOWERTIMER
133-
#if DEVICE_RTC_LSI
133+
#if RTC_LSI
134134
rtc_write(0);
135135
#else
136136
if (!rtc_isenabled()) {
@@ -146,7 +146,7 @@ void rtc_init(void)
146146

147147
void rtc_free(void)
148148
{
149-
#if DEVICE_RTC_LSI
149+
#if RTC_LSI
150150
// Enable Power clock
151151
__HAL_RCC_PWR_CLK_ENABLE();
152152

@@ -169,14 +169,14 @@ void rtc_free(void)
169169
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
170170
HAL_RCC_OscConfig(&RCC_OscInitStruct);
171171

172-
#if DEVICE_RTC_LSI
172+
#if RTC_LSI
173173
rtc_inited = 0;
174174
#endif
175175
}
176176

177177
int rtc_isenabled(void)
178178
{
179-
#if DEVICE_RTC_LSI
179+
#if RTC_LSI
180180
return rtc_inited;
181181
#else
182182
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {

0 commit comments

Comments
 (0)