]> git.sur5r.net Git - freertos/blobdiff - Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h
Rename the UART ISR in the MSP430X/IAR demo to match the UART actually being used.
[freertos] / Demo / MSP430X_MSP430F5438_IAR / FreeRTOSConfig.h
index 654e7c847bae03a58b8b55133843f34571f2c88b..1a7133ba0f396cbcae376f0733ec6a031d6d333e 100644 (file)
@@ -72,7 +72,6 @@
 #define configCPU_CLOCK_HZ                             ( 16000000UL )  \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 ) ( 10 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                        ( 10 )\r
 #define configUSE_TRACE_FACILITY               0\r
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 \r
+#if __DATA_MODEL__ == __DATA_MODEL_SMALL__\r
+       #define configMINIMAL_STACK_SIZE                ( ( unsigned short ) 100 )\r
+#else\r
+       #define configMINIMAL_STACK_SIZE                ( ( unsigned short ) 70 )\r
+#endif\r
+\r
 /* Co-routine definitions. */\r
 #define configUSE_CO_ROUTINES          0\r
 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
@@ -112,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