Details | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 29 | jimmy | 1 | #ifndef timebase_h_ |
| 2 | #define timebase_h_ |
||
| 3 | |||
| 4 | #include <inttypes.h> |
||
| 5 | |||
| 6 | // timebase on timer0 serves a 10ms tick |
||
| 7 | // for 8MHz System and Prescaler 64 |
||
| 8 | #define TIMEBASE_PRESCALE (64) |
||
| 9 | #define TIMEBASE_HITS_PER_1MS ( F_OSC/TIMEBASE_PRESCALE/1000 ) |
||
| 10 | #define TIMEBASE_RELOAD ((uint8_t)(0xff-TIMEBASE_HITS_PER_1MS+1)) |
||
| 11 | |||
| 12 | volatile uint16_t gMilliSecTick; |
||
| 13 | |||
| 14 | void timebase_init(void); |
||
| 15 | uint16_t timebase_actTime(void); |
||
| 16 | uint16_t timebase_passedTimeMS(uint16_t t0); |
||
| 17 | |||
| 18 | #endif |