File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0 Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -72,22 +72,22 @@ void rtc_init(void)
72
72
__HAL_RCC_RTC_CONFIG (RCC_RTCCLKSOURCE_LSE );
73
73
rtc_freq = LSE_VALUE ;
74
74
} else {
75
- error ("Cannot initialize RTC with LSE\n" );
75
+ error ("Cannot initialize RTC with LSE\n" );
76
76
}
77
77
#else
78
- // Enable LSI clock
79
- RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE ;
80
- RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ; // Mandatory, otherwise the PLL is reconfigured!
81
- RCC_OscInitStruct .LSEState = RCC_LSE_OFF ;
82
- RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
83
- if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
84
- error ("RTC error: LSI clock initialization failed." );
85
- }
86
- // Connect LSI to RTC
87
- __HAL_RCC_RTC_CLKPRESCALER (RCC_RTCCLKSOURCE_LSI );
88
- __HAL_RCC_RTC_CONFIG (RCC_RTCCLKSOURCE_LSI );
89
- // This value is LSI typical value. To be measured precisely using a timer input capture for example.
90
- rtc_freq = 38000 ;
78
+ // Enable LSI clock
79
+ RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE ;
80
+ RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ; // Mandatory, otherwise the PLL is reconfigured!
81
+ RCC_OscInitStruct .LSEState = RCC_LSE_OFF ;
82
+ RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
83
+ if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
84
+ error ("RTC error: LSI clock initialization failed." );
85
+ }
86
+ // Connect LSI to RTC
87
+ __HAL_RCC_RTC_CLKPRESCALER (RCC_RTCCLKSOURCE_LSI );
88
+ __HAL_RCC_RTC_CONFIG (RCC_RTCCLKSOURCE_LSI );
89
+ // This value is LSI typical value. To be measured precisely using a timer input capture for example.
90
+ rtc_freq = 38000 ;
91
91
#endif
92
92
93
93
// Enable RTC
You can’t perform that action at this time.
0 commit comments