The clock library is the interface between Contiki and the platform specific clock functionality. The clock library performs a single function: measuring time. Additionally, the clock library provides a macro, CLOCK_SECOND, which corresponds to one second of system time.
- Note
- The clock library need in many cases not be used directly. Rather, the timer library or the event timers should be used.
- See also
- Timer library
-
Event timers
◆ CLOCK_SECOND
A second, measured in system clock time.
◆ clock_delay()
void clock_delay |
( |
unsigned int |
d | ) |
|
This is a asynchronous delay function.
- Attention
- Due to UNIFY running in the same thread as Z-Wave protocol, a vTaskDelay() was not a good idea and this function is now returning immediately. No delays are allowed.
- Parameters
-
◆ clock_fine()
unsigned short clock_fine |
( |
void |
| ) |
|
◆ clock_fine_max()
int clock_fine_max |
( |
void |
| ) |
|
◆ clock_init()
Initialize the clock library.
This function initializes the clock library and should be called from the main() function of the system.
◆ clock_lte()
Check if clock time t1 is less than or equal to clock time t2.
Since clock_time_t may be an unsigned type, use this function for comparison.
- See also
- E.g., IETF RFC 1982 https://tools.ietf.org/rfc/rfc1982.txt.
Return value is greater than 0 if t1
is equal to t2
or if t1 is less than t2
(modulo max clock_time).
◆ clock_seconds()
CCIF unsigned long clock_seconds |
( |
void |
| ) |
|
◆ clock_time()
Get the current clock time.
This function returns the current system clock time.
- Returns
- The current clock time, measured in system ticks.