PCem

changeset 123:fdffe4113922

Fixed PIT timer reads.
author TomW
date Thu Jul 10 21:32:49 2014 +0100
parents 84742b645324
children 457f666b38c1
files src/timer.h
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/src/timer.h	Thu Jul 10 20:25:10 2014 +0100
     1.2 +++ b/src/timer.h	Thu Jul 10 21:32:49 2014 +0100
     1.3 @@ -16,7 +16,15 @@
     1.4  		}					\
     1.5  	} while (0)
     1.6  
     1.7 -#define timer_clock() timer_end_period(cycles)
     1.8 +#define timer_clock()                                   \
     1.9 +	do 						\
    1.10 +	{						\
    1.11 +                int diff = timer_start - cycles;        \
    1.12 +		timer_count -= diff;			\
    1.13 +                timer_start = cycles;                   \
    1.14 +		timer_process();		        \
    1.15 +        	timer_update_outstanding();	        \
    1.16 +	} while (0)
    1.17  
    1.18  void timer_process();
    1.19  void timer_update_outstanding();