RTEMS Logo

RTEMS 4.6.4 On-Line Library


Real-Time Clock Driver checkRealTime

PREV UP next Bookshelf BSP and Device Driver Development Guide

11.7: checkRealTime

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
}


PREV UP next Bookshelf BSP and Device Driver Development Guide

Copyright © 1988-2004 OAR Corporation