@@ -57,8 +57,8 @@ static void RTC_IRQHandler(void);
57
57
58
58
void rtc_init (void )
59
59
{
60
- RCC_OscInitTypeDef RCC_OscInitStruct ;
61
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct ;
60
+ RCC_OscInitTypeDef RCC_OscInitStruct = { 0 } ;
61
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 } ;
62
62
63
63
// Enable access to Backup domain
64
64
HAL_PWR_EnableBkUpAccess ();
@@ -162,7 +162,7 @@ void rtc_free(void)
162
162
#endif
163
163
164
164
// Disable LSI and LSE clocks
165
- RCC_OscInitTypeDef RCC_OscInitStruct ;
165
+ RCC_OscInitTypeDef RCC_OscInitStruct = { 0 } ;
166
166
RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE ;
167
167
RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ;
168
168
RCC_OscInitStruct .LSIState = RCC_LSI_OFF ;
@@ -217,8 +217,8 @@ It is then not a problem to not use shifts.
217
217
218
218
time_t rtc_read (void )
219
219
{
220
- RTC_DateTypeDef dateStruct ;
221
- RTC_TimeTypeDef timeStruct ;
220
+ RTC_DateTypeDef dateStruct = { 0 } ;
221
+ RTC_TimeTypeDef timeStruct = { 0 } ;
222
222
struct tm timeinfo ;
223
223
224
224
RtcHandle .Instance = RTC ;
@@ -247,8 +247,8 @@ time_t rtc_read(void)
247
247
248
248
void rtc_write (time_t t )
249
249
{
250
- RTC_DateTypeDef dateStruct ;
251
- RTC_TimeTypeDef timeStruct ;
250
+ RTC_DateTypeDef dateStruct = { 0 } ;
251
+ RTC_TimeTypeDef timeStruct = { 0 } ;
252
252
253
253
RtcHandle .Instance = RTC ;
254
254
0 commit comments