Update the run time stats generation algorithm for the MSP430X IAR port.

This commit is contained in:
Richard Barry 2011-01-05 20:20:17 +00:00
parent 6331341d97
commit 25bc4acc6a
5 changed files with 33 additions and 22 deletions

View file

@ -90,9 +90,6 @@ void vConfigureTimerForRunTimeStats( void )
/* Start up clean. */
TA1CTL |= TACLR;
/* No overflows can have occurred yet. */
ulStatsOverflowCount = 0UL;
/* Continuous mode. */
TA1CTL |= MC__CONTINOUS;
}
@ -110,10 +107,24 @@ inline unsigned long ulGetRunTimeStatsTime( void )
unsigned long ulReturn;
TA1CTL &= ~MC__CONTINOUS;
if( ( TA1CTL & TAIFG ) != 0 )
{
/* An overflow has occurred but not yet been processed. */
ulStatsOverflowCount++;
/* Clear the interrupt. */
TA1CTL &= ~TAIFG;
}
else
{
__no_operation();
}
ulReturn = ( ulStatsOverflowCount << 16UL );
ulReturn |= ( unsigned long ) TA1R;
TA1CTL |= MC__CONTINOUS;
return ulReturn;
}
/*-----------------------------------------------------------*/