![]() |
EVE 1.0
|
|
Macros | |
| #define | CLOCK_SECOND |
Functions | |
| void | clock_init (void) |
| CCIF clock_time_t | clock_time (void) |
| CCIF unsigned long | clock_seconds (void) |
| void | clock_set_seconds (unsigned long sec) |
| void | clock_wait (clock_time_t t) |
| void | clock_delay_usec (uint16_t dt) |
| int | clock_fine_max (void) |
The clock library is the interface between Contiki and the platform specific clock functionality. The clock library defines a macro, CLOCK_SECOND, to convert seconds into the tick resolution of the platform. Typically this is 1-10 milliseconds, e.g. 4*CLOCK_SECOND could be 512. A 16 bit counter would thus overflow every 1-10 minutes. Platforms use the tick interrupt to maintain a long term count of seconds since startup.
Platforms may also implement rtimers for greater time resolution and for real-time interrupts, These use a corresponding RTIMER_SECOND.
| #define CLOCK_SECOND |
A second, measured in system clock time.
Definition at line 81 of file clock.h.
Referenced by tcpip_input().
| void clock_init | ( | void | ) |
| CCIF clock_time_t clock_time | ( | void | ) |
Get the current clock time.
This function returns the current system clock time.
Definition at line 195 of file clock.c.
Referenced by clock_wait(), timer_expired(), timer_remaining(), timer_restart(), and timer_set().
| CCIF unsigned long clock_seconds | ( | void | ) |
Get the current value of the platform seconds.
This could be the number of seconds since startup, or since a standard epoch.
Definition at line 201 of file clock.c.
Referenced by stimer_elapsed(), stimer_expired(), stimer_remaining(), stimer_restart(), and stimer_set().
| void clock_set_seconds | ( | unsigned long | sec | ) |
| void clock_wait | ( | clock_time_t | t | ) |
Wait for a given number of ticks.
| t | How many ticks. |
Definition at line 214 of file clock.c.
References clock_time(), PM_LOCK, pm_relax(), PM_UNLOCK, and pm_wakeup().
| void clock_delay_usec | ( | uint16_t | dt | ) |
Delay a given number of microseconds.
| dt | How many microseconds to delay. |
Definition at line 244 of file clock.c.
References etimer_next_expiration_time(), PM_LOCK, pm_relax(), PM_UNLOCK, uwork_now(), uwork_pending(), uwork_schedule(), and UWORK_USEC.
| int clock_fine_max | ( | void | ) |
Deprecated platform-specific routines.