forked from Imagelibrary/rtems
2009-08-17 Joel Sherrill <joel.sherrill@OARcorp.com>
* rtems/src/clockget.c: Restructure to ease coverage analysis of deprecated routine.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-08-17 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* rtems/src/clockget.c: Restructure to ease coverage analysis of
|
||||||
|
deprecated routine.
|
||||||
|
|
||||||
2009-08-16 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-08-16 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* libi2c/libi2c.c: Fix warnings.
|
* libi2c/libi2c.c: Fix warnings.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Clock Manager
|
* Clock Manager
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-2008.
|
* COPYRIGHT (c) 1989-2009.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -23,8 +23,7 @@
|
|||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/*PAGE
|
/*
|
||||||
*
|
|
||||||
* rtems_clock_get
|
* rtems_clock_get
|
||||||
*
|
*
|
||||||
* This directive returns the current date and time. If the time has
|
* This directive returns the current date and time. If the time has
|
||||||
@@ -49,31 +48,28 @@ rtems_status_code rtems_clock_get(
|
|||||||
if ( !time_buffer )
|
if ( !time_buffer )
|
||||||
return RTEMS_INVALID_ADDRESS;
|
return RTEMS_INVALID_ADDRESS;
|
||||||
|
|
||||||
switch ( option ) {
|
if ( option == RTEMS_CLOCK_GET_TOD )
|
||||||
case RTEMS_CLOCK_GET_TOD:
|
|
||||||
return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer );
|
return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer );
|
||||||
|
|
||||||
case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
|
if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH )
|
||||||
return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer);
|
return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer);
|
||||||
|
|
||||||
case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT: {
|
if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) {
|
||||||
rtems_interval *interval = (rtems_interval *)time_buffer;
|
rtems_interval *interval = (rtems_interval *)time_buffer;
|
||||||
|
|
||||||
*interval = rtems_clock_get_ticks_since_boot();
|
*interval = rtems_clock_get_ticks_since_boot();
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
case RTEMS_CLOCK_GET_TICKS_PER_SECOND: {
|
|
||||||
|
if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) {
|
||||||
rtems_interval *interval = (rtems_interval *)time_buffer;
|
rtems_interval *interval = (rtems_interval *)time_buffer;
|
||||||
|
|
||||||
*interval = rtems_clock_get_ticks_per_second();
|
*interval = rtems_clock_get_ticks_per_second();
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
case RTEMS_CLOCK_GET_TIME_VALUE:
|
|
||||||
return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer );
|
|
||||||
|
|
||||||
default:
|
if ( option == RTEMS_CLOCK_GET_TIME_VALUE )
|
||||||
break;
|
return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer );
|
||||||
}
|
|
||||||
|
|
||||||
return RTEMS_INVALID_NUMBER;
|
return RTEMS_INVALID_NUMBER;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user