is included from an asm file. */\r
#ifdef __ICC430__\r
extern void vConfigureTimerForRunTimeStats( void );\r
- extern inline unsigned long ulGetRunTimeStatsTime( void );\r
extern volatile unsigned long ulStatsOverflowCount;\r
#endif /* __ICCARM__ */\r
\r
+/* Configure a 16 bit timer to generate the time base for the run time stats.\r
+The timer is configured to interrupt each time it overflows so a count of\r
+overflows can be kept - that way a 32 bit time value can be constructed from\r
+the timers current count value and the number of overflows. */\r
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
-#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeStatsTime()\r
-\r
+ \r
+/* Construct a 32 bit time value for use as the run time stats time base. This\r
+comes from the current value of a 16 bit timer combined with the number of times\r
+the timer has overflowed. */\r
+#define portALT_GET_RUN_TIME_COUNTER_VALUE( ulCountValue ) \\r
+ { \\r
+ /* Stop the counter counting temporarily. */ \\r
+ TA1CTL &= ~MC__CONTINOUS; \\r
+ \\r
+ /* Check to see if any counter overflow interrupts are pending. */ \\r
+ if( ( TA1CTL & TAIFG ) != 0 ) \\r
+ { \\r
+ /* An overflow has occurred but not yet been processed. */ \\r
+ ulStatsOverflowCount++; \\r
+ \\r
+ /* Clear the interrupt. */ \\r
+ TA1CTL &= ~TAIFG; \\r
+ } \\r
+ \\r
+ /* Generate a 32 bit counter value by combinging the current peripheral \\r
+ counter value with the number of overflows. */ \\r
+ ulCountValue = ( ulStatsOverflowCount << 16UL ); \\r
+ ulCountValue |= ( unsigned long ) TA1R; \\r
+ TA1CTL |= MC__CONTINOUS; \\r
+ }\r
#endif /* FREERTOS_CONFIG_H */\r
\r