NDK
2.24.03.35
|
The MYTIME module uses the SYS/BIOS Clock module to keep track of system time for hardware platforms that do not have a Real Time Clock.
The module internally tracks the time by keeping count of the number of seconds since the Epoch, which is defined to be January 1, 1970.
Users of the MYTIME module can access its internal time value using supplied getter and setter functions.
The MYTIME module is part of the NDK nettools library. An application should include its header file as follows:
To initialize and start the MYTIME module clock, call the following function:
The internal time value can be obtained by calling the MYTIME_gettime() function:
The internal time value can be set by calling the MYTIME_settime() function:
The following function can be called to stop the MYTIME Clock and free its resources:
#include <xdc/std.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
void | MYTIME_init (void) |
Create a new Clock instance that ticks every second. More... | |
void | MYTIME_exit (void) |
Stops and deletes the Clock instance created in the init function. More... | |
uint32_t | MYTIME_gettime (void) |
Returns the number of seconds since the Epoch (January 1, 1970). More... | |
void | MYTIME_settime (uint32_t newtime) |
Sets the time to the value passed in via the newtime parameter (units in seconds). More... | |
void MYTIME_init | ( | void | ) |
Create a new Clock instance that ticks every second.
void MYTIME_exit | ( | void | ) |
Stops and deletes the Clock instance created in the init function.
uint32_t MYTIME_gettime | ( | void | ) |
Returns the number of seconds since the Epoch (January 1, 1970).
void MYTIME_settime | ( | uint32_t | newtime | ) |
Sets the time to the value passed in via the newtime parameter (units in seconds).
newtime | Time in seconds since the Epoch to set the time to |