File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
hal/targets/hal/TARGET_STM/TARGET_STM32L0 Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 34
34
35
35
#include "mbed_error.h"
36
36
37
- #if DEVICE_RTC_LSI
37
+ #if RTC_LSI
38
38
static int rtc_inited = 0 ;
39
39
#endif
40
40
41
41
static RTC_HandleTypeDef RtcHandle ;
42
42
43
- #if DEVICE_RTC_LSI
43
+ #if RTC_LSI
44
44
#define RTC_CLOCK LSI_VALUE
45
45
#else
46
46
#define RTC_CLOCK LSE_VALUE
@@ -64,7 +64,7 @@ void rtc_init(void)
64
64
RCC_OscInitTypeDef RCC_OscInitStruct ;
65
65
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct ;
66
66
67
- #if DEVICE_RTC_LSI
67
+ #if RTC_LSI
68
68
if (rtc_inited ) return ;
69
69
rtc_inited = 1 ;
70
70
#endif
@@ -79,7 +79,7 @@ void rtc_init(void)
79
79
// Enable access to Backup domain
80
80
HAL_PWR_EnableBkUpAccess ();
81
81
82
- #if !DEVICE_RTC_LSI
82
+ #if !RTC_LSI
83
83
// Enable LSE Oscillator
84
84
RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSE ;
85
85
RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ; // Mandatory, otherwise the PLL is reconfigured!
@@ -129,7 +129,7 @@ void rtc_init(void)
129
129
}
130
130
131
131
#if DEVICE_LOWPOWERTIMER
132
- #if DEVICE_RTC_LSI
132
+ #if RTC_LSI
133
133
rtc_write (0 );
134
134
#else
135
135
if (!rtc_isenabled ()) {
@@ -145,7 +145,7 @@ void rtc_init(void)
145
145
146
146
void rtc_free (void )
147
147
{
148
- #if DEVICE_RTC_LSI
148
+ #if RTC_LSI
149
149
// Enable Power clock
150
150
__PWR_CLK_ENABLE ();
151
151
@@ -168,14 +168,14 @@ void rtc_free(void)
168
168
RCC_OscInitStruct .LSEState = RCC_LSE_OFF ;
169
169
HAL_RCC_OscConfig (& RCC_OscInitStruct );
170
170
171
- #if DEVICE_RTC_LSI
171
+ #if RTC_LSI
172
172
rtc_inited = 0 ;
173
173
#endif
174
174
}
175
175
176
176
int rtc_isenabled (void )
177
177
{
178
- #if DEVICE_RTC_LSI
178
+ #if RTC_LSI
179
179
return rtc_inited ;
180
180
#else
181
181
if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) {
You can’t perform that action at this time.
0 commit comments