]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/FreeRTOSConfig.h
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / FreeRTOSConfig.h
1 /*\r
2     FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.\r
3 \r
4     This file is part of the FreeRTOS distribution.\r
5 \r
6     FreeRTOS is free software; you can redistribute it and/or modify it under\r
7     the terms of the GNU General Public License (version 2) as published by the\r
8     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
9     ***NOTE*** The exception to the GPL is included to allow you to distribute\r
10     a combined work that includes FreeRTOS without being obliged to provide the\r
11     source code for proprietary components outside of the FreeRTOS kernel.\r
12     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT\r
13     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
14     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
15     more details. You should have received a copy of the GNU General Public\r
16     License and the FreeRTOS license exception along with FreeRTOS; if not it\r
17     can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
18     by writing to Richard Barry, contact details for whom are available on the\r
19     FreeRTOS WEB site.\r
20 \r
21     1 tab == 4 spaces!\r
22 \r
23     http://www.FreeRTOS.org - Documentation, latest information, license and\r
24     contact details.\r
25 \r
26     http://www.SafeRTOS.com - A version that is certified for use in safety\r
27     critical systems.\r
28 \r
29     http://www.OpenRTOS.com - Commercial support, development, porting,\r
30     licensing and training services.\r
31 */\r
32 \r
33 \r
34 /******************************************************************************\r
35         See http://www.freertos.org/a00110.html for an explanation of the\r
36         definitions contained in this file.\r
37 ******************************************************************************/\r
38 \r
39 #ifndef FREERTOS_CONFIG_H\r
40 #define FREERTOS_CONFIG_H\r
41 \r
42 \r
43 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
44 or 0 to run the more comprehensive test and demo application.\r
45 \r
46 The comprehensive demo uses FreeRTOS+CLI to create a simple command line \r
47 interface through a UART.\r
48 \r
49 The blinky demo uses FreeRTOS's tickless idle mode to reduce power consumption.\r
50 See the notes on the web page below regarding the difference in power saving \r
51 that can be achieved between using the generic tickless implementation (as used \r
52 by the blinky demo) and a tickless implementation that is tailored specifically \r
53 to the MSP432.\r
54  \r
55 See http://www.FreeRTOS.org/TI_MSP432_Free_RTOS_Demo.html for instructions. */\r
56 #define configCREATE_SIMPLE_TICKLESS_DEMO       0\r
57 \r
58 \r
59 /*-----------------------------------------------------------\r
60  * Application specific definitions.\r
61  *\r
62  * These definitions should be adjusted for your particular hardware and\r
63  * application requirements.\r
64  *\r
65  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
66  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
67  * http://www.freertos.org/a00110.html\r
68  *----------------------------------------------------------*/\r
69 \r
70 /* Constants related to the behaviour or the scheduler. */\r
71 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
72 #define configUSE_PREEMPTION                                    1\r
73 #define configUSE_TIME_SLICING                                  1\r
74 #define configMAX_PRIORITIES                                    ( 5 )\r
75 #define configIDLE_SHOULD_YIELD                                 1\r
76 #define configUSE_16_BIT_TICKS                                  0 /* Only for 8 and 16-bit hardware. */\r
77 \r
78 /* Constants that describe the hardware and memory usage. */\r
79 #define configCPU_CLOCK_HZ                                              MAP_CS_getMCLK()\r
80 #define configMINIMAL_STACK_SIZE                                ( ( uint16_t ) 100 )\r
81 #define configMAX_TASK_NAME_LEN                                 ( 12 )\r
82 \r
83 /* Note heap_5.c is used so this only defines the part of the heap that is in\r
84 the first block of RAM on the LPC device.  See the initialisation of the heap\r
85 in main.c. */\r
86 #define configTOTAL_HEAP_SIZE                                   ( ( size_t ) ( 50 * 1024 ) )\r
87 \r
88 /* Constants that build features in or out. */\r
89 #define configUSE_MUTEXES                                               1\r
90 #define configUSE_TICKLESS_IDLE                                 1\r
91 #define configUSE_APPLICATION_TASK_TAG                  0\r
92 #define configUSE_NEWLIB_REENTRANT                              0\r
93 #define configUSE_CO_ROUTINES                                   0\r
94 #define configUSE_COUNTING_SEMAPHORES                   1\r
95 #define configUSE_RECURSIVE_MUTEXES                             1\r
96 #define configUSE_QUEUE_SETS                                    0\r
97 #define configUSE_TASK_NOTIFICATIONS                    1\r
98 \r
99 /* Constants that define which hook (callback) functions should be used. */\r
100 #define configUSE_IDLE_HOOK                                             1\r
101 #define configUSE_TICK_HOOK                                             1\r
102 #define configUSE_MALLOC_FAILED_HOOK                    1\r
103 \r
104 /* Constants provided for debugging and optimisation assistance. */\r
105 #define configCHECK_FOR_STACK_OVERFLOW                  2\r
106 #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }\r
107 #define configQUEUE_REGISTRY_SIZE                               0\r
108 \r
109 /* Software timer definitions. */\r
110 #define configUSE_TIMERS                                                1\r
111 #define configTIMER_TASK_PRIORITY                               ( 3 )\r
112 #define configTIMER_QUEUE_LENGTH                                5\r
113 #define configTIMER_TASK_STACK_DEPTH                    ( configMINIMAL_STACK_SIZE  )\r
114 \r
115 /* Set the following definitions to 1 to include the API function, or zero\r
116 to exclude the API function.  NOTE:  Setting an INCLUDE_ parameter to 0 is only\r
117 necessary if the linker does not automatically remove functions that are not\r
118 referenced anyway. */\r
119 #define INCLUDE_vTaskPrioritySet                                1\r
120 #define INCLUDE_uxTaskPriorityGet                               1\r
121 #define INCLUDE_vTaskDelete                                             1\r
122 #define INCLUDE_vTaskCleanUpResources                   0\r
123 #define INCLUDE_vTaskSuspend                                    1\r
124 #define INCLUDE_vTaskDelayUntil                                 1\r
125 #define INCLUDE_vTaskDelay                                              1\r
126 #define INCLUDE_uxTaskGetStackHighWaterMark             0\r
127 #define INCLUDE_pcTaskGetTaskName                               1\r
128 #define INCLUDE_xTaskGetIdleTaskHandle                  0\r
129 #define INCLUDE_eTaskGetState                                   1\r
130 #define INCLUDE_xTaskResumeFromISR                              0\r
131 #define INCLUDE_xTaskGetCurrentTaskHandle               1\r
132 #define INCLUDE_xTaskGetSchedulerState                  0\r
133 #define INCLUDE_xSemaphoreGetMutexHolder                0\r
134 #define INCLUDE_xTimerPendFunctionCall                  1\r
135 \r
136 /* This demo makes use of one or more example stats formatting functions.  These\r
137 format the raw data provided by the uxTaskGetSystemState() function in to human\r
138 readable ASCII form.  See the notes in the implementation of vTaskList() within\r
139 FreeRTOS/Source/tasks.c for limitations. */\r
140 #define configUSE_STATS_FORMATTING_FUNCTIONS    1\r
141 \r
142 /* Dimensions a buffer that can be used by the FreeRTOS+CLI command\r
143 interpreter.  See the FreeRTOS+CLI documentation for more information:\r
144 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */\r
145 #define configCOMMAND_INT_MAX_OUTPUT_SIZE               2048\r
146 \r
147 \r
148 /* Cortex-M3/4 interrupt priority configuration follows...................... */\r
149 \r
150 /* Use the system definition, if there is one. */\r
151 #ifdef __NVIC_PRIO_BITS\r
152         #define configPRIO_BITS       __NVIC_PRIO_BITS\r
153 #else\r
154         #define configPRIO_BITS       3     /* 8 priority levels */\r
155 #endif\r
156 \r
157 /* The lowest interrupt priority that can be used in a call to a "set priority"\r
158 function. */\r
159 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY                 0x07\r
160 \r
161 /* The highest interrupt priority that can be used by any interrupt service\r
162 routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL\r
163 INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER\r
164 PRIORITY THAN THIS! (higher priorities are lower numeric values. */\r
165 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY    5\r
166 \r
167 /* Interrupt priorities used by the kernel port layer itself.  These are generic\r
168 to all Cortex-M ports, and do not rely on any particular library functions. */\r
169 #define configKERNEL_INTERRUPT_PRIORITY                 ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
170 /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!\r
171 See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */\r
172 #define configMAX_SYSCALL_INTERRUPT_PRIORITY    ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
173 \r
174 /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS\r
175 standard names - can't be used with CCS due to limitations in the assemblers\r
176 pre-processing. */\r
177 #ifndef __TI_COMPILER_VERSION__\r
178         #define xPortPendSVHandler      PendSV_Handler\r
179         #define vPortSVCHandler         SVC_Handler\r
180         #define xPortSysTickHandler     SysTick_Handler\r
181 #endif\r
182 \r
183 /* The trace facility is turned on to make some functions available for use in\r
184 CLI commands. */\r
185 #define configUSE_TRACE_FACILITY        1\r
186 \r
187 /* Some board specifics.   The LED is on P1.0, configure the pin as output. */\r
188 #define configTOGGLE_LED()              GPIO_toggleOutputOnPin( GPIO_PORT_P1, GPIO_PIN0 )\r
189 \r
190 /* The #ifdef guards against the file being included from IAR assembly files. */\r
191 #ifndef __IASMARM__\r
192 \r
193         /* TI driver library includes. */\r
194         #include <driverlib.h>\r
195 \r
196         void vPreSleepProcessing( uint32_t ulExpectedIdleTime );\r
197         #define configPRE_SLEEP_PROCESSING( x ) vPreSleepProcessing( x )\r
198 \r
199         #if configCREATE_SIMPLE_TICKLESS_DEMO == 1\r
200 \r
201                 /* Constants related to the generation of run time stats.  Run time stats\r
202                 are gathered in the full demo, not the blinky demo. */\r
203                 #define configGENERATE_RUN_TIME_STATS                   0\r
204                 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()\r
205                 #define portGET_RUN_TIME_COUNTER_VALUE()                0\r
206 \r
207                 /* The blinky demo can use a slow tick rate to save power. */\r
208                 #define configTICK_RATE_HZ                                              ( ( TickType_t ) 100 )\r
209 \r
210         #else\r
211 \r
212                 /* Constants related to the generation of run time stats.  Run time stats\r
213                 are gathered in the full demo, not the blinky demo. */\r
214                 void vConfigureTimerForRunTimeStats( void );\r
215                 uint32_t ulGetRunTimeCounterValue( void );\r
216                 #define configGENERATE_RUN_TIME_STATS   1\r
217                 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
218                 #define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()\r
219 \r
220                 /* Some of the tests in the full demo expecte a 1ms tick rate. */\r
221                 #define configTICK_RATE_HZ                                              ( ( TickType_t ) 1000 )\r
222 \r
223         #endif /* configCREATE_SIMPLE_TICKLESS_DEMO */\r
224 #endif /* __IASMARM__ */\r
225 \r
226 #endif /* FREERTOS_CONFIG_H */\r
227 \r