Fixed Misra complaint

This commit is contained in:
Robbe 2019-10-31 11:58:36 -07:00
parent 606f1d9131
commit b143a1cf9e
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,15 @@ void rtc_set_time(timestamp_t time){
timestamp_t rtc_get_time(void){
timestamp_t result;
// Init with zero values in case there is no RTC running
result.year = 0U;
result.month = 0U;
result.day = 0U;
result.weekday = 0U;
result.hour = 0U;
result.minute = 0U;
result.second = 0U;
if(board_has_rtc()){
// Wait until the register sync flag is set
while((RTC->ISR & RTC_ISR_RSF) == 0){}