]> git.sur5r.net Git - freertos/commitdiff
Replace the function that returns the current run time counter value with a macro...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 6 Jan 2011 09:55:05 +0000 (09:55 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 6 Jan 2011 09:55:05 +0000 (09:55 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1228 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h
Demo/MSP430X_MSP430F5438_IAR/RunTimeStatsConfig.c
Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt
Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni
Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt

index 275b90df3dab14850a0fb641f0d4692a902b81f6..1a7133ba0f396cbcae376f0733ec6a031d6d333e 100644 (file)
@@ -117,12 +117,38 @@ case configTICK__VECTOR is set to TIMER0_A0_VECTOR. */
 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
index fba7dc6ccf71f8e84dd0e49c3dbe7c1dd29a5511..bf001584bc7efc6327b9dd9c79d879a5379772d5 100644 (file)
@@ -102,29 +102,3 @@ static __interrupt void prvRunTimeStatsOverflowISR( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-inline unsigned long ulGetRunTimeStatsTime( void )\r
-{\r
-unsigned long ulReturn;\r
-\r
-       TA1CTL &= ~MC__CONTINOUS;\r
-       \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
-       else\r
-       {\r
-               __no_operation();\r
-       }\r
-       \r
-       ulReturn = ( ulStatsOverflowCount << 16UL );\r
-       ulReturn |= ( unsigned long ) TA1R;\r
-       TA1CTL |= MC__CONTINOUS;\r
-\r
-       return ulReturn;\r
-}\r
-/*-----------------------------------------------------------*/\r
index 1608c0e22351314b63b426f9ba6f715de3259fa4..1a18ab5cfa35be205754571026f6e9fdf4891bd1 100644 (file)
@@ -19,7 +19,7 @@
           \r
           \r
           \r
-        <Column0>117</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>\r
+        <Column0>185</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>\r
       </Workspace>\r
       <Disassembly>\r
         \r
@@ -31,7 +31,7 @@
       \r
       \r
       \r
-    <Wnd0>\r
+    <Wnd4>\r
         <Tabs>\r
           <Tab>\r
             <Identity>TabID-11539-27703</Identity>\r
           </Tab>\r
         </Tabs>\r
         \r
-      <SelectedTab>0</SelectedTab></Wnd0><Wnd1><Tabs><Tab><Identity>TabID-25774-15685</Identity><TabName>Terminal I/O</TabName><Factory>TerminalIO</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1><Wnd2><Tabs><Tab><Identity>TabID-22323-19482</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd2></Windows>\r
+      <SelectedTab>0</SelectedTab></Wnd4><Wnd5><Tabs><Tab><Identity>TabID-25774-15685</Identity><TabName>Terminal I/O</TabName><Factory>TerminalIO</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd5><Wnd6><Tabs><Tab><Identity>TabID-22323-19482</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd6></Windows>\r
     <Editor>\r
       \r
       \r
       \r
       \r
-    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>230</YPos><SelStart>12197</SelStart><SelEnd>12197</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\MSP430X\port.c</Filename><XPos>0</XPos><YPos>179</YPos><SelStart>8031</SelStart><SelEnd>8031</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>1592</YPos><SelStart>50606</SelStart><SelEnd>50606</SelEnd></Tab><ActiveTab>2</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
+    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>230</YPos><SelStart>12197</SelStart><SelEnd>12197</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>6468</SelStart><SelEnd>6468</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\RunTimeStatsConfig.c</Filename><XPos>0</XPos><YPos>76</YPos><SelStart>4634</SelStart><SelEnd>4634</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>1583</YPos><SelStart>50154</SelStart><SelEnd>50154</SelEnd></Tab><ActiveTab>3</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\include\FreeRTOS.h</Filename><XPos>0</XPos><YPos>372</YPos><SelStart>12619</SelStart><SelEnd>12619</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
     <Positions>\r
       \r
       \r
       \r
       \r
       \r
-    <Top><Row0><Sizes><Toolbar-012aad60><key>iaridepm.enu1</key></Toolbar-012aad60><Toolbar-0695e588><key>430fet1</key></Toolbar-0695e588></Sizes></Row0><Row1><Sizes><Toolbar-0133c848><key>debuggergui.enu1</key></Toolbar-0133c848></Sizes></Row1><Row2><Sizes/></Row2></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>716</Bottom><Right>191</Right><x>-2</x><y>-2</y><xscreen>121</xscreen><yscreen>150</yscreen><sizeHorzCX>72024</sizeHorzCX><sizeHorzCY>152749</sizeHorzCY><sizeVertCX>114881</sizeVertCX><sizeVertCY>731161</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>716</Bottom><Right>497</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>297024</sizeVertCX><sizeVertCY>731161</sizeVertCY></Rect></Wnd1></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd2></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+    <Top><Row0><Sizes><Toolbar-012aad60><key>iaridepm.enu1</key></Toolbar-012aad60><Toolbar-01349758><key>430fet1</key></Toolbar-01349758></Sizes></Row0><Row1><Sizes><Toolbar-06875788><key>debuggergui.enu1</key></Toolbar-06875788></Sizes></Row1></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>716</Bottom><Right>259</Right><x>-2</x><y>-2</y><xscreen>121</xscreen><yscreen>150</yscreen><sizeHorzCX>72024</sizeHorzCX><sizeHorzCY>152749</sizeHorzCY><sizeVertCX>155357</sizeVertCX><sizeVertCY>731161</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>716</Bottom><Right>439</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>262500</sizeVertCX><sizeVertCY>731161</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd6><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd6></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
   </Desktop>\r
 </Project>\r
 \r
index 87fa82e30fb5f2a2273df46a8e77be71ccaff01a..4e9c2075e3160698cc9e208f4772b66c830cca74 100644 (file)
@@ -1,5 +1,5 @@
 [DebugChecksum]\r
-Checksum=-1480900162\r
+Checksum=143335623\r
 [DisAssemblyWindow]\r
 NumStates=_ 1\r
 State 1=_ 1\r
@@ -14,7 +14,7 @@ Control Register=0
 NextState0=0\r
 NextState1=0\r
 [Action Register]\r
-Break=1\r
+Break=2\r
 State Storage=0\r
 [Profiling]\r
 Enabled=0\r
@@ -39,7 +39,7 @@ LogFile=_ ""
 Enabled=0\r
 [DriverProfiling]\r
 Enabled=0\r
-Mode=604119078\r
+Mode=-1827890818\r
 Graph=0\r
 Symbiont=0\r
 [Breakpoints]\r
index 1d6a92b22895df16fd1d38378037a1f00cd407e5..34d11844715acd58cfda86ef56becf713f9c89ef 100644 (file)
       \r
       \r
       \r
-    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>230</YPos><SelStart>12197</SelStart><SelEnd>12197</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
+    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>230</YPos><SelStart>12197</SelStart><SelEnd>12197</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>116</YPos><SelStart>6468</SelStart><SelEnd>6468</SelEnd></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\RunTimeStatsConfig.c</Filename><XPos>0</XPos><YPos>76</YPos><SelStart>4634</SelStart><SelEnd>4634</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>1583</YPos><SelStart>50154</SelStart><SelEnd>50154</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\include\FreeRTOS.h</Filename><XPos>0</XPos><YPos>372</YPos><SelStart>12619</SelStart><SelEnd>12619</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
     <Positions>\r
       \r
       \r
       \r
       \r
       \r
-    <Top><Row0><Sizes><Toolbar-012aad60><key>iaridepm.enu1</key></Toolbar-012aad60></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>309</Right><x>-2</x><y>-2</y><xscreen>331</xscreen><yscreen>267</yscreen><sizeHorzCX>197024</sizeHorzCX><sizeHorzCY>271894</sizeHorzCY><sizeVertCX>185119</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+    <Top><Row0><Sizes><Toolbar-012aad60><key>iaridepm.enu1</key></Toolbar-012aad60></Sizes></Row0><Row1><Sizes/></Row1><Row2><Sizes/></Row2><Row3><Sizes/></Row3><Row4><Sizes/></Row4><Row5><Sizes/></Row5><Row6><Sizes/></Row6></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>309</Right><x>-2</x><y>-2</y><xscreen>331</xscreen><yscreen>267</yscreen><sizeHorzCX>197024</sizeHorzCX><sizeHorzCY>271894</sizeHorzCY><sizeVertCX>185119</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
   </Desktop>\r
 </Workspace>\r
 \r