# HG changeset patch # User TomW # Date 1405024369 -3600 # Node ID fdffe4113922c9cedcd2d9b08031983d062a0f10 # Parent 84742b645324b10f36c6a46a0bebc97c8f0ab658 Fixed PIT timer reads. diff -r 84742b645324 -r fdffe4113922 src/timer.h --- a/src/timer.h Thu Jul 10 20:25:10 2014 +0100 +++ b/src/timer.h Thu Jul 10 21:32:49 2014 +0100 @@ -16,7 +16,15 @@ } \ } 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();