[9XR-PRO] Should fix the RTC issue (Date&Time was never read)
This commit is contained in:
@@ -61,15 +61,14 @@ uint32_t Rtc_write_count ;
|
|||||||
uint8_t RtcConfig[8] ; // For initial config and writing to RTC
|
uint8_t RtcConfig[8] ; // For initial config and writing to RTC
|
||||||
// 0x80, 0, 0, 0x08, 0, 0, 0, 0x80
|
// 0x80, 0, 0, 0x08, 0, 0, 0, 0x80
|
||||||
|
|
||||||
static uint32_t fromBCD( uint8_t bcd_value )
|
uint32_t fromBCD(uint8_t bcd_value)
|
||||||
{
|
{
|
||||||
return (((bcd_value & 0xF0) * 10) >> 4) + (bcd_value & 0x0F);
|
return (((bcd_value & 0xF0) * 10) >> 4) + (bcd_value & 0x0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t toBCD( uint32_t value )
|
uint32_t toBCD(uint32_t value)
|
||||||
{
|
{
|
||||||
div_t qr ;
|
div_t qr = div(value, 10);
|
||||||
qr = div( value, 10 ) ;
|
|
||||||
return (qr.quot << 4) + qr.rem;
|
return (qr.quot << 4) + qr.rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,5 +274,7 @@ void rtcSetTime(struct gtm * t)
|
|||||||
|
|
||||||
void rtcInit()
|
void rtcInit()
|
||||||
{
|
{
|
||||||
// TODO ? coprocReadData();
|
#if defined(REVX)
|
||||||
|
readRTC();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user