This encapsulates functionality related to the Classic API Clock Manager.
◆ rtems_clock_get_ticks_per_second
Obtain Ticks Per Seconds.
This routine implements the rtems_clock_get_ticks_per_second directive.
- Return values
-
This | method returns the number of ticks per second. It cannot fail since RTEMS is always configured to know the number of ticks per second. |
◆ _TOD_To_seconds()
TOD to Seconds.
This function returns the number seconds between the epoch and the_tod.
- Parameters
-
[in] | the_tod | is the TOD structure to convert to seconds |
- Return values
-
This | method returns the number of seconds since epoch represented by the_tod |
◆ _TOD_Validate()
TOD Validate.
This support function returns true if the_tod contains a valid time of day, and false otherwise.
- Parameters
-
[in] | the_tod | is the TOD structure to validate |
- Return values
-
This | method returns true if the TOD is valid and false otherwise. |
- Note
- This routine only works for leap-years through 2099.
◆ rtems_clock_get_seconds_since_epoch()
Obtain Seconds Since Epoch.
This routine implements the rtems_clock_get_seconds_since_epoch directive.
- Parameters
-
[in] | the_interval | points to the interval variable to fill in |
- Return values
-
This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the time_buffer will be filled in with the current time of day. |
◆ rtems_clock_get_ticks_since_boot()
Gets the current ticks counter value.
- Returns
- The current tick counter value. With a 1ms clock tick, this counter overflows after 50 days since boot.
◆ rtems_clock_get_tod()
Obtain Current Time of Day (Classic TOD)
This routine implements the rtems_clock_get_tod directive. It returns the current time of day in the format defined by RTEID.
Clock Manager - rtems_clock_get_tod
- Parameters
-
[in] | time_buffer | points to the time of day structure |
- Return values
-
This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the time_buffer will be filled in with the current time of day. |
◆ rtems_clock_get_tod_timeval()
Obtain TOD in struct timeval Format.
This routine implements the rtems_clock_get_tod_timeval directive.
- Parameters
-
[in] | time | points to the struct timeval variable to fill in |
- Return values
-
This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the time will be filled in with the current time of day. |
◆ rtems_clock_get_uptime()
Obtain the System Uptime.
This directive returns the system uptime.
- Parameters
-
[in] | uptime | is a pointer to the time structure |
- Return values
-
This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the uptime will be filled in. |
◆ rtems_clock_get_uptime_nanoseconds()
uint64_t rtems_clock_get_uptime_nanoseconds |
( |
void |
| ) |
|
Returns the system uptime in nanoseconds.
- Return values
-
The | system uptime in nanoseconds. |
◆ rtems_clock_get_uptime_seconds()
time_t rtems_clock_get_uptime_seconds |
( |
void |
| ) |
|
Returns the system uptime in seconds.
- Return values
-
The | system uptime in seconds. |
◆ rtems_clock_get_uptime_timeval()
void rtems_clock_get_uptime_timeval |
( |
struct timeval * |
uptime | ) |
|
Gets the System Uptime in the Struct Timeval Format.
- Parameters
-
[out] | uptime | is a pointer to a struct timeval structure. |
- Return values
-
This | methods returns the system uptime. |
- Note
- Pointer must not be NULL.
◆ rtems_clock_set()
Set the Current TOD.
This routine implements the rtems_clock_set directive. It sets the current time of day to that in the time_buffer record.
- Parameters
-
[in] | time_buffer | points to the new TOD |
- Return values
-
This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. |
- Note
- Activities scheduled based upon the current time of day may be executed immediately if the time is moved forward.
◆ rtems_clock_tick()
Announce a Clock Tick.
This routine implements the rtems_clock_tick directive. It is invoked to inform RTEMS of the occurrence of a clock tick.
- Return values
-
This | directive always returns RTEMS_SUCCESSFUL. |
- Note
- This method is typically called from an ISR and is the basis for all timeouts and delays. This routine only works for leap-years through 2099.
◆ rtems_clock_tick_before()
Returns true if the current ticks counter value indicates a time before the time specified by the tick value and false otherwise.
- Parameters
-
This can be used to write busy loops with a timeout.
status busy( void )
{
do {
if ( ok() ) {
return success;
}
return timeout;
}
- Return values
-
true | The current ticks counter value indicates a time before the time specified by the tick value. |
false | Otherwise. |
◆ rtems_clock_tick_later()
Returns the ticks counter value delta ticks in the future.
- Parameters
-
[in] | delta | The ticks delta value. |
- Returns
- The tick counter value delta ticks in the future.
◆ rtems_clock_tick_later_usec()
Returns the ticks counter value at least delta microseconds in the future.
- Parameters
-
[in] | delta_in_usec | The delta value in microseconds. |
- Returns
- The tick counter value at least delta microseconds in the future.