mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-02 04:13:54 -04:00
Update the run time stats generation algorithm for the MSP430X IAR port.
This commit is contained in:
parent
6331341d97
commit
25bc4acc6a
5 changed files with 33 additions and 22 deletions
|
@ -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;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue