Add variable to keep a count of the high frequency time tick occurrences. This is then used by the run time stats gathering macros.

This commit is contained in:
Richard Barry 2009-05-21 12:26:27 +00:00
parent c66301ac9e
commit 2293b8ca53

View file

@ -83,8 +83,12 @@ zero. */
void Timer0IntHandler( void ); void Timer0IntHandler( void );
/* Stores the value of the maximum recorded jitter between interrupts. */ /* Stores the value of the maximum recorded jitter between interrupts. */
volatile unsigned portLONG ulMaxJitter = 0; volatile unsigned portLONG ulMaxJitter = 0UL;
/* Counts the total number of times that the high frequency timer has 'ticked'.
This value is used by the run time stats function to work out what percentage
of CPU time each task is taking. */
volatile unsigned portLONG ulHighFrequencyTimerTicks = 0UL;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vSetupHighFrequencyTimer( void ) void vSetupHighFrequencyTimer( void )
@ -145,6 +149,11 @@ static unsigned portLONG ulMaxDifference = 0, ulLastCount = 0;
} }
ulLastCount = ulCurrentCount; ulLastCount = ulCurrentCount;
/* Keep a count of the total number of 20KHz ticks. This is used by the
run time stats functionality to calculate how much CPU time is used by
each task. */
ulHighFrequencyTimerTicks++;
} }