BSP and Device Driver Development Guide
The checkRealTime routine returns the number of seconds
difference between the RTC TOD and the current RTEMS TOD.
int checkRealTime( void )
{
if no RTCs are present
return -1
obtain the RTEMS TOD using rtems_clock_get
get the TOD from the preferred RTC using the deviceGetTime routine
convert the RTEMS TOD to seconds
convert the RTC TOD to seconds
return the RTEMS TOD in seconds - RTC TOD in seconds
}
BSP and Device Driver Development Guide
Copyright © 1988-2004 OAR Corporation