mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-02 04:13:54 -04:00
Replace the function that returns the current run time counter value with a macro for easier inlining.
This commit is contained in:
parent
25bc4acc6a
commit
12949b4507
5 changed files with 39 additions and 39 deletions
|
@ -117,12 +117,38 @@ case configTICK__VECTOR is set to TIMER0_A0_VECTOR. */
|
|||
is included from an asm file. */
|
||||
#ifdef __ICC430__
|
||||
extern void vConfigureTimerForRunTimeStats( void );
|
||||
extern inline unsigned long ulGetRunTimeStatsTime( void );
|
||||
extern volatile unsigned long ulStatsOverflowCount;
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
/* Configure a 16 bit timer to generate the time base for the run time stats.
|
||||
The timer is configured to interrupt each time it overflows so a count of
|
||||
overflows can be kept - that way a 32 bit time value can be constructed from
|
||||
the timers current count value and the number of overflows. */
|
||||
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()
|
||||
#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeStatsTime()
|
||||
|
||||
|
||||
/* Construct a 32 bit time value for use as the run time stats time base. This
|
||||
comes from the current value of a 16 bit timer combined with the number of times
|
||||
the timer has overflowed. */
|
||||
#define portALT_GET_RUN_TIME_COUNTER_VALUE( ulCountValue ) \
|
||||
{ \
|
||||
/* Stop the counter counting temporarily. */ \
|
||||
TA1CTL &= ~MC__CONTINOUS; \
|
||||
\
|
||||
/* Check to see if any counter overflow interrupts are pending. */ \
|
||||
if( ( TA1CTL & TAIFG ) != 0 ) \
|
||||
{ \
|
||||
/* An overflow has occurred but not yet been processed. */ \
|
||||
ulStatsOverflowCount++; \
|
||||
\
|
||||
/* Clear the interrupt. */ \
|
||||
TA1CTL &= ~TAIFG; \
|
||||
} \
|
||||
\
|
||||
/* Generate a 32 bit counter value by combinging the current peripheral \
|
||||
counter value with the number of overflows. */ \
|
||||
ulCountValue = ( ulStatsOverflowCount << 16UL ); \
|
||||
ulCountValue |= ( unsigned long ) TA1R; \
|
||||
TA1CTL |= MC__CONTINOUS; \
|
||||
}
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue