The clock library is the interface between Contiki and the platform specific clock functionality. More...
Defines | |
#define | CLOCK_SECOND |
A second, measured in system clock time. | |
Functions | |
void | clock_init (void) |
Initialize the clock library. | |
CCIF clock_time_t | clock_time (void) |
Get the current clock time. | |
void | clock_delay (unsigned int) |
Delay the CPU for a multiple of TODO. |
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.
void clock_init | ( | void | ) |
Initialize the clock library.
This function initializes the clock library and should be called from the main() function of the system.
set Timer/Counter0 to be asynchronous from the CPU clock with a second external clock(32,768kHz) driving it.
Wait for TCN0UB, OCR0UB, and TCR0UB.
Definition at line 37 of file clock.c.
References CLOCK_SECOND, INTERRUPTS_OFF, INTERRUPTS_ON, and TICK_VAL.
Referenced by main().
CCIF clock_time_t clock_time | ( | void | ) |
Get the current clock time.
This function returns the current system clock time.
Definition at line 42 of file clock.c.
Referenced by clock_wait().