Revision 184
updated time.c and time.h to take multiple functions, somewhat backwards compatible
time.h | ||
---|---|---|
11 | 11 |
#ifndef _TIME_H_ |
12 | 12 |
#define _TIME_H_ |
13 | 13 |
|
14 |
/*Maximum # of functions*/ |
|
15 |
#define MAX_FUNCTIONS 10 |
|
16 |
|
|
17 |
|
|
14 | 18 |
/* Predefined times for prescale_opt in time.c. |
15 | 19 |
To make you own, know that a pulse is 1/16th of a second. You cannot get less than this. To get more, you need |
16 | 20 |
to know how many 16ths of a second are in the time you want. (Time_desired * 16 = prescaler_opt) |
... | ... | |
37 | 41 |
/** @brief Delay execution for the specified time **/ |
38 | 42 |
void delay_ms(int ms) ; |
39 | 43 |
/** @brief Enable the realtime clock **/ |
40 |
void rtc_init(int prescale_opt, void (*rtc_func)(void));
|
|
44 |
int rtc_multi_init(int* prescale_opt, void (*rtc_fun[])(void), int argc);
|
|
41 | 45 |
/** @brief Reset the counter of the realtime clock **/ |
42 | 46 |
void rtc_reset(void); |
43 | 47 |
/** @brief Get the value of the realtime clock. **/ |
44 | 48 |
int rtc_get(void); |
45 | 49 |
|
50 |
int add_function(int prescale_opt, void *rtc_f (void)); |
|
51 |
|
|
52 |
int rtc_init(int prescale_opt, void *rtc_func(void)); |
|
53 |
|
|
46 | 54 |
/** @} **/ |
47 | 55 |
|
48 | 56 |
#endif |
Also available in: Unified diff