]> git.sur5r.net Git - freertos/blobdiff - Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/FreeRTOSConfig.h
Increase the MCLK frequency to 25MHz in the CCS MSP430X demo.
[freertos] / Demo / MSP430X_MSP430F5438_CCS4 / Demo_Source / FreeRTOSConfig.h
index 5faff83e0fd63194f86139db896eb9dca29c06e2..0e20d713946262b3ac77955006d104974fa97110 100644 (file)
@@ -57,7 +57,7 @@
  * executed from within CCS4!  Once it has been executed, re-open or refresh \r
  * the CCS4 project and remove the #error line below.\r
  */\r
-#error Ensure CreateProjectDirectoryStructure.bat has been executed before building.  See comment immediately above.\r
+//#error Ensure CreateProjectDirectoryStructure.bat has been executed before building.  See comment immediately above.\r
 \r
 \r
 #ifndef FREERTOS_CONFIG_H\r
@@ -78,7 +78,7 @@
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            1\r
 #define configUSE_TICK_HOOK                            1\r
-#define configCPU_CLOCK_HZ                             ( 16000000UL )  \r
+#define configCPU_CLOCK_HZ                             ( 25000000UL )  \r
 #define configTICK_RATE_HZ                             ( ( portTickType ) 1000 )\r
 #define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 5 )\r
 #define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 9 * 1024 ) )\r
@@ -87,7 +87,7 @@
 #define configUSE_16_BIT_TICKS                 0\r
 #define configIDLE_SHOULD_YIELD                        1\r
 #define configUSE_MUTEXES                              1\r
-#define configQUEUE_REGISTRY_SIZE              5\r
+#define configQUEUE_REGISTRY_SIZE              0\r
 #define configGENERATE_RUN_TIME_STATS  1\r
 #define configCHECK_FOR_STACK_OVERFLOW 2\r
 #define configUSE_RECURSIVE_MUTEXES            0\r
@@ -123,11 +123,37 @@ case configTICK_VECTOR is set to TIMER0_A0_VECTOR. */
 #define configTICK_VECTOR                              TIMER0_A0_VECTOR\r
 \r
 extern void vConfigureTimerForRunTimeStats( void );\r
-extern unsigned long ulGetRunTimeStatsTime( void );\r
 extern volatile unsigned long ulStatsOverflowCount;\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
-#endif /* FREERTOS_CONFIG_H */\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 /*0*/   \r
 \r