Skip to content

Commit da44e99

Browse files
committed
STM32L0 - Rename RTC_LSI
1 parent 57208bb commit da44e99

File tree

1 file changed

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

1 file changed

+8
-8
lines changed

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

67-
#if DEVICE_RTC_LSI
67+
#if RTC_LSI
6868
if (rtc_inited) return;
6969
rtc_inited = 1;
7070
#endif
@@ -79,7 +79,7 @@ void rtc_init(void)
7979
// Enable access to Backup domain
8080
HAL_PWR_EnableBkUpAccess();
8181

82-
#if !DEVICE_RTC_LSI
82+
#if !RTC_LSI
8383
// Enable LSE Oscillator
8484
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
8585
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
@@ -129,7 +129,7 @@ void rtc_init(void)
129129
}
130130

131131
#if DEVICE_LOWPOWERTIMER
132-
#if DEVICE_RTC_LSI
132+
#if RTC_LSI
133133
rtc_write(0);
134134
#else
135135
if (!rtc_isenabled()) {
@@ -145,7 +145,7 @@ void rtc_init(void)
145145

146146
void rtc_free(void)
147147
{
148-
#if DEVICE_RTC_LSI
148+
#if RTC_LSI
149149
// Enable Power clock
150150
__PWR_CLK_ENABLE();
151151

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

171-
#if DEVICE_RTC_LSI
171+
#if RTC_LSI
172172
rtc_inited = 0;
173173
#endif
174174
}
175175

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

0 commit comments

Comments
 (0)