Skip to content

Commit

Permalink
Fixed Misra complaint
Browse files Browse the repository at this point in the history
  • Loading branch information
robbederks committed Oct 31, 2019
1 parent 606f1d9 commit b143a1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions board/drivers/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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){}
Expand Down

0 comments on commit b143a1c

Please sign in to comment.