File tree Expand file tree Collapse file tree 9 files changed +26
-26
lines changed
libraries/mbed/targets/hal/TARGET_STM Expand file tree Collapse file tree 9 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,6 @@ void rtc_init(void) {
45
45
rtc_inited = 1 ;
46
46
47
47
RtcHandle .Instance = RTC ;
48
-
49
- // Check if RTC is already initialized
50
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
51
48
52
49
// Enable Power clock
53
50
__PWR_CLK_ENABLE ();
@@ -82,6 +79,9 @@ void rtc_init(void) {
82
79
rtc_freq = LSI_VALUE ;
83
80
}
84
81
82
+ // Check if RTC is already initialized
83
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
84
+
85
85
// Enable RTC
86
86
__HAL_RCC_RTC_ENABLE ();
87
87
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void rtc_init(void)
46
46
rtc_inited = 1 ;
47
47
48
48
RtcHandle .Instance = RTC ;
49
-
50
- // Check if RTC is already initialized
51
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
52
49
53
50
// Enable Power clock
54
51
__PWR_CLK_ENABLE ();
@@ -83,6 +80,9 @@ void rtc_init(void)
83
80
rtc_freq = LSI_VALUE ;
84
81
}
85
82
83
+ // Check if RTC is already initialized
84
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
85
+
86
86
// Enable RTC
87
87
__HAL_RCC_RTC_ENABLE ();
88
88
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void rtc_init(void)
46
46
rtc_inited = 1 ;
47
47
48
48
RtcHandle .Instance = RTC ;
49
-
50
- // Check if RTC is already initialized
51
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
52
49
53
50
// Enable Power clock
54
51
__PWR_CLK_ENABLE ();
@@ -85,6 +82,9 @@ void rtc_init(void)
85
82
rtc_freq = LSI_VALUE ;
86
83
}
87
84
85
+ // Check if RTC is already initialized
86
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
87
+
88
88
// Enable RTC
89
89
__HAL_RCC_RTC_ENABLE ();
90
90
Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ void rtc_init(void)
40
40
RCC_OscInitTypeDef RCC_OscInitStruct ;
41
41
uint32_t rtc_freq = 0 ;
42
42
43
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value
44
-
45
43
RtcHandle .Instance = RTC ;
46
44
47
45
// Enable Power clock
@@ -79,6 +77,8 @@ void rtc_init(void)
79
77
rtc_freq = LSI_VALUE ;
80
78
}
81
79
80
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value
81
+
82
82
// Enable RTC
83
83
__HAL_RCC_RTC_ENABLE ();
84
84
Original file line number Diff line number Diff line change @@ -54,9 +54,6 @@ void rtc_init(void)
54
54
rtc_inited = 1 ;
55
55
56
56
RtcHandle .Instance = RTC ;
57
-
58
- // Check if RTC is already initialized
59
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
60
57
61
58
// Enable Power clock
62
59
__PWR_CLK_ENABLE ();
@@ -97,6 +94,9 @@ void rtc_init(void)
97
94
}
98
95
#endif
99
96
97
+ // Check if RTC is already initialized
98
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
99
+
100
100
// Enable RTC
101
101
__HAL_RCC_RTC_ENABLE ();
102
102
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void rtc_init(void)
46
46
rtc_inited = 1 ;
47
47
48
48
RtcHandle .Instance = RTC ;
49
-
50
- // Check if RTC is already initialized
51
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
52
49
53
50
// Enable Power clock
54
51
__PWR_CLK_ENABLE ();
@@ -85,6 +82,9 @@ void rtc_init(void)
85
82
rtc_freq = 32000 ;
86
83
}
87
84
85
+ // Check if RTC is already initialized
86
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
87
+
88
88
// Enable RTC
89
89
__HAL_RCC_RTC_ENABLE ();
90
90
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void rtc_init(void)
46
46
rtc_inited = 1 ;
47
47
48
48
RtcHandle .Instance = RTC ;
49
-
50
- // Check if RTC is already initialized
51
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
52
49
53
50
// Enable Power clock
54
51
__PWR_CLK_ENABLE ();
@@ -85,6 +82,9 @@ void rtc_init(void)
85
82
rtc_freq = 32000 ;
86
83
}
87
84
85
+ // Check if RTC is already initialized
86
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
87
+
88
88
// Enable RTC
89
89
__HAL_RCC_RTC_ENABLE ();
90
90
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ void rtc_init(void)
46
46
rtc_inited = 1 ;
47
47
48
48
RtcHandle .Instance = RTC ;
49
-
50
- // Check if RTC is already initialized
51
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
52
49
53
50
// Enable Power clock
54
51
__PWR_CLK_ENABLE ();
@@ -85,6 +82,9 @@ void rtc_init(void)
85
82
rtc_freq = 40000 ;
86
83
}
87
84
85
+ // Check if RTC is already initialized
86
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
87
+
88
88
// Enable RTC
89
89
__HAL_RCC_RTC_ENABLE ();
90
90
Original file line number Diff line number Diff line change @@ -48,9 +48,6 @@ void rtc_init(void)
48
48
49
49
RtcHandle .Instance = RTC ;
50
50
51
- // Check if RTC is already initialized
52
- if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
53
-
54
51
// Enable Power clock
55
52
__HAL_RCC_PWR_CLK_ENABLE ();
56
53
@@ -91,6 +88,9 @@ void rtc_init(void)
91
88
rtc_freq = 40000 ;
92
89
}
93
90
91
+ // Check if RTC is already initialized
92
+ if ((RTC -> ISR & RTC_ISR_INITS ) == RTC_ISR_INITS ) return ;
93
+
94
94
// Enable RTC
95
95
__HAL_RCC_RTC_ENABLE ();
96
96
You can’t perform that action at this time.
0 commit comments