File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
hal/targets/hal/TARGET_STM/TARGET_STM32L4 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,14 +64,14 @@ void rtc_init(void)
64
64
RCC_OscInitTypeDef RCC_OscInitStruct = {0 };
65
65
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0 };
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
71
71
72
72
RtcHandle .Instance = RTC ;
73
73
74
- #if !DEVICE_RTC_LSI
74
+ #if !RTC_LSI
75
75
// Enable LSE Oscillator
76
76
RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE ;
77
77
RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ; // Mandatory, otherwise the PLL is reconfigured!
@@ -130,7 +130,7 @@ void rtc_init(void)
130
130
}
131
131
132
132
#if DEVICE_LOWPOWERTIMER
133
- #if DEVICE_RTC_LSI
133
+ #if RTC_LSI
134
134
rtc_write (0 );
135
135
#else
136
136
if (!rtc_isenabled ()) {
@@ -146,7 +146,7 @@ void rtc_init(void)
146
146
147
147
void rtc_free (void )
148
148
{
149
- #if DEVICE_RTC_LSI
149
+ #if RTC_LSI
150
150
// Enable Power clock
151
151
__HAL_RCC_PWR_CLK_ENABLE ();
152
152
@@ -169,14 +169,14 @@ void rtc_free(void)
169
169
RCC_OscInitStruct .LSEState = RCC_LSE_OFF ;
170
170
HAL_RCC_OscConfig (& RCC_OscInitStruct );
171
171
172
- #if DEVICE_RTC_LSI
172
+ #if RTC_LSI
173
173
rtc_inited = 0 ;
174
174
#endif
175
175
}
176
176
177
177
int rtc_isenabled (void )
178
178
{
179
- #if DEVICE_RTC_LSI
179
+ #if RTC_LSI
180
180
return rtc_inited ;
181
181
#else
182
182
if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) {
You can’t perform that action at this time.
0 commit comments