Moved PIT to common timer API.

This commit is contained in:
TomW 2014-06-19 21:02:59 +01:00
commit b0320ae16c
6 changed files with 87 additions and 59 deletions

View file

@ -1,14 +1,23 @@
#define timer_clock(cycles) \
extern int timer_start;
#define timer_start_period(cycles) \
timer_start = cycles;
#define timer_end_period(cycles) \
do \
{ \
timer_count -= cycles; \
int diff = timer_start - cycles; \
timer_count -= diff; \
timer_start = cycles; \
if (timer_count <= 0) \
{ \
timer_process(); \
timer_update_outstanding(); \
} \
} while (0)
#define timer_clock() timer_end_period(cycles)
void timer_process();
void timer_update_outstanding();
void timer_reset();