From b89e792f8f726be28eb7b4291c4909fa780c182b Mon Sep 17 00:00:00 2001 From: TomW Date: Thu, 10 Jul 2014 21:32:49 +0100 Subject: [PATCH] Fixed PIT timer reads. --- src/timer.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/timer.h b/src/timer.h index 972cf68..264c137 100644 --- a/src/timer.h +++ b/src/timer.h @@ -16,7 +16,15 @@ extern int timer_start; } \ } while (0) -#define timer_clock() timer_end_period(cycles) +#define timer_clock() \ + do \ + { \ + int diff = timer_start - cycles; \ + timer_count -= diff; \ + timer_start = cycles; \ + timer_process(); \ + timer_update_outstanding(); \ + } while (0) void timer_process(); void timer_update_outstanding();