]> 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 6ca457319cc76564c24f5afa004f699858edb885..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
 #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 configMINIMAL_STACK_SIZE               ( ( unsigned short ) 70 )\r
 #define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 9 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                        ( 10 )\r
-#define configUSE_TRACE_FACILITY               0\r
+#define configUSE_TRACE_FACILITY               1\r
 #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
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 \r
+#ifdef __LARGE_DATA_MODEL__\r
+       #define configMINIMAL_STACK_SIZE                ( ( unsigned short ) 80 )\r
+#else\r
+       #define configMINIMAL_STACK_SIZE                ( ( unsigned short ) 120 )\r
+#endif\r
+\r
 /* Co-routine definitions. */\r
 #define configUSE_CO_ROUTINES          0\r
 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
@@ -111,18 +116,44 @@ to exclude the API function. */
 \r
 /* The MSP430X port uses a callback function to configure its tick interrupt.\r
 This allows the application to choose the tick interrupt source.\r
-configTICK_INTERRUPT_VECTOR must also be set in FreeRTOSConfig.h to the correct\r
-interrupt vector for the chosen tick interrupt source.  This implementation of\r
+configTICK_VECTOR must also be set in FreeRTOSConfig.h to the correct interrupt\r
+vector for the chosen tick interrupt source.  This implementation of\r
 vApplicationSetupTimerInterrupt() generates the tick from timer A0, so in this\r
-case configTICK_INTERRUPT_VECTOR is set to TIMER0_A0_VECTOR. */\r
-#define configTICK_INTERRUPT_VECTOR            TIMER0_A0_VECTOR\r
+case configTICK_VECTOR is set to TIMER0_A0_VECTOR. */\r
+#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