|
void | core_timer (int sig) |
| The core timer. Determines whether or not it is time to run one of the functions that have timers attached to them. More...
|
|
void | initialise_core_timer (void) |
| Begins an alarm which calls the "core_timer" function every 1ms * rate producing a calling frequency of 1kHz / rate.
|
|
int | OSWait (int n) |
| Waits for 1 ms. More...
|
|
Timer | OSAttachTimer (int scale, void(*fct)(void)) |
| adds a function to a 1kHz/scale timer, ie. executes every 1ms*scale usage: OSAttachTimer(<scale>, &<function>); More...
|
|
int | OSDetachTimer (Timer handle) |
| removes the Timer from the list More...
|
|
int | OSSetTime (int hrs, int mins, int secs) |
| sets the system time More...
|
|
int | OSGetTime (int *hrs, int *mins, int *secs, int *ticks) |
| Get system time (ticks in 1/100 sec) More...
|
|
int | OSShowTime (void) |
| prints the time on the command line More...
|
|
int | OSGetCount (void) |
| gives you the count in 1/100 sec since the system start More...
|
|
Sets up and runs functions at given times.
- Author
- Rhys Kessey
-
Marcus Pham (cleaned up)
These timer functions were written by Rhys Kessey The functions deal with two global variables, functions[] and function_timer_scales[] Every time a timer is linked to a function, values will be added to these arrays Every clock tick (determined by the rate that core_timer is called) these functions will be checked if the current clock tick is a multiple of a function scale, then the function will be executed. eg. functions[] = {f1,f2,f3,f4,NULL,NULL,NULL....} function_timer_scales[] = {1 ,2 ,1 ,4 ,0 ,0 ,0 ....} then every clock tick, f1 and f3 will be executed (in that order) every 2 clock ticks, f2 will be executed every 4 clock ticks, f4 will be executed