File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -197,22 +197,24 @@ static volatile uint32_t systick_ms;
197
197
* @retval The new state of RTC_FLAG (SET or RESET).
198
198
*/
199
199
FlagStatus RTC_GetFlagStatus (uint32_t RTC_FLAG ) {
200
- FlagStatus bitstatus = RESET ;
201
- uint32_t tmpreg = 0 ;
202
-
200
+ #if CIRCUITPY_RTC
201
+ // Always reset if RTC disabled
202
+ // RTC_FLAGS_MASK is not defined for all families e.g. stm32f7
203
203
/* Check the parameters */
204
204
assert_param (IS_RTC_GET_FLAG (RTC_FLAG ));
205
205
206
206
/* Get all the flags */
207
- tmpreg = ( uint32_t ) (RTC -> ISR & RTC_FLAGS_MASK );
207
+ uint32_t tmpreg = (RTC -> ISR & RTC_FLAGS_MASK );
208
208
209
209
/* Return the status of the flag */
210
210
if ((tmpreg & RTC_FLAG ) != (uint32_t )RESET ) {
211
- bitstatus = SET ;
211
+ return SET ;
212
212
} else {
213
- bitstatus = RESET ;
213
+ return RESET ;
214
214
}
215
- return bitstatus ;
215
+ #else
216
+ return RESET ;
217
+ #endif
216
218
}
217
219
218
220
You can’t perform that action at this time.
0 commit comments