From: richardbarry Date: Thu, 6 Jan 2011 09:55:05 +0000 (+0000) Subject: Replace the function that returns the current run time counter value with a macro... X-Git-Tag: V6.1.1~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ab4aafd2096b8c356f396dcc1dd2d9ef5c13c21;p=freertos Replace the function that returns the current run time counter value with a macro for easier inlining. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1228 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h b/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h index 275b90df3..1a7133ba0 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h +++ b/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h @@ -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 */ diff --git a/Demo/MSP430X_MSP430F5438_IAR/RunTimeStatsConfig.c b/Demo/MSP430X_MSP430F5438_IAR/RunTimeStatsConfig.c index fba7dc6cc..bf001584b 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/RunTimeStatsConfig.c +++ b/Demo/MSP430X_MSP430F5438_IAR/RunTimeStatsConfig.c @@ -102,29 +102,3 @@ static __interrupt void prvRunTimeStatsOverflowISR( void ) } /*-----------------------------------------------------------*/ -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; -} -/*-----------------------------------------------------------*/ diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt index 1608c0e22..1a18ab5cf 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt @@ -19,7 +19,7 @@ - 117272727 + 185272727 @@ -31,7 +31,7 @@ - + TabID-11539-27703 @@ -43,20 +43,20 @@ - 0TabID-25774-15685Terminal I/OTerminalIO0TabID-22323-19482Debug LogDebug-Log0 + 0TabID-25774-15685Terminal I/OTerminalIO0TabID-22323-19482Debug LogDebug-Log0 - TextEditor$WS_DIR$\main.c02301219712197TextEditor$WS_DIR$\..\..\Source\portable\IAR\MSP430X\port.c017980318031TextEditor$WS_DIR$\..\..\Source\tasks.c01592506065060620100000010000001 + TextEditor$WS_DIR$\main.c02301219712197TextEditor$WS_DIR$\FreeRTOSConfig.h011664686468TextEditor$WS_DIR$\RunTimeStatsConfig.c07646344634TextEditor$WS_DIR$\..\..\Source\tasks.c0158350154501543TextEditor$WS_DIR$\..\..\Source\include\FreeRTOS.h037212619126190100000010000001 - iaridepm.enu1430fet1debuggergui.enu1-2-2716191-2-212115072024152749114881731161-2-2716497-2-2200200119048203666297024731161-2-21981682-2-216842001002381203666119048203666 + iaridepm.enu1430fet1debuggergui.enu1-2-2716259-2-212115072024152749155357731161-2-2716439-2-2200200119048203666262500731161-2-21981682-2-216842001002381203666119048203666 diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni index 87fa82e30..4e9c2075e 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni @@ -1,5 +1,5 @@ [DebugChecksum] -Checksum=-1480900162 +Checksum=143335623 [DisAssemblyWindow] NumStates=_ 1 State 1=_ 1 @@ -14,7 +14,7 @@ Control Register=0 NextState0=0 NextState1=0 [Action Register] -Break=1 +Break=2 State Storage=0 [Profiling] Enabled=0 @@ -39,7 +39,7 @@ LogFile=_ "" Enabled=0 [DriverProfiling] Enabled=0 -Mode=604119078 +Mode=-1827890818 Graph=0 Symbiont=0 [Breakpoints] diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt index 1d6a92b22..34d118447 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt @@ -43,14 +43,14 @@ - TextEditor$WS_DIR$\main.c0230121971219700100000010000001 + TextEditor$WS_DIR$\main.c02301219712197TextEditor$WS_DIR$\FreeRTOSConfig.h0116646864681TextEditor$WS_DIR$\RunTimeStatsConfig.c07646344634TextEditor$WS_DIR$\..\..\Source\tasks.c015835015450154TextEditor$WS_DIR$\..\..\Source\include\FreeRTOS.h037212619126190100000010000001 - iaridepm.enu1-2-2740309-2-2331267197024271894185119755601-2-21981682-2-216842001002381203666119048203666 + iaridepm.enu1-2-2740309-2-2331267197024271894185119755601-2-21981682-2-216842001002381203666119048203666