fix DCF77 day calculation
This commit is contained in:
parent
933ebef400
commit
46045d51c5
|
@ -119,7 +119,7 @@ uint8_t* rtc_dcf77_time(void)
|
|||
if (parity%2) { // parity should be even
|
||||
return NULL;
|
||||
}
|
||||
to_return[2] = 1*((rtc_dcf77_frame>>36)&(0x1))+2*((rtc_dcf77_frame>>37)&(0x1))+4*((rtc_dcf77_frame>>38)&(0x1))+8*((rtc_dcf77_frame>>39)&(0x1))+10*((rtc_dcf77_frame>>40)&(0x1))+20*((rtc_dcf77_frame>>34)&(0x41)); // read day of the month (01-31)
|
||||
to_return[2] = 1*((rtc_dcf77_frame>>36)&(0x1))+2*((rtc_dcf77_frame>>37)&(0x1))+4*((rtc_dcf77_frame>>38)&(0x1))+8*((rtc_dcf77_frame>>39)&(0x1))+10*((rtc_dcf77_frame>>40)&(0x1))+20*((rtc_dcf77_frame>>41)&(0x1)); // read day of the month (01-31)
|
||||
if (to_return[2]==0 || to_return[2]>31) { // day of the month should be 1-31
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue