]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/PIC32MEC14xx_MPLAB/src/FreeRTOSConfig.h
Update to MIT licensed FreeRTOS V10.0.0 - see https://www.freertos.org/History.txt
[freertos] / FreeRTOS / Demo / PIC32MEC14xx_MPLAB / src / FreeRTOSConfig.h
1 /*\r
2  * FreeRTOS Kernel V10.0.0\r
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software. If you wish to use our Amazon\r
14  * FreeRTOS name, please do so in a fair use way that does not cause confusion.\r
15  *\r
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22  *\r
23  * http://www.FreeRTOS.org\r
24  * http://aws.amazon.com/freertos\r
25  *\r
26  * 1 tab == 4 spaces!\r
27  */\r
28 \r
29 #ifndef FREERTOS_CONFIG_H\r
30 #define FREERTOS_CONFIG_H\r
31 \r
32 #ifdef __XC32__\r
33         #include <xc.h>\r
34 #endif\r
35 \r
36 /*-----------------------------------------------------------\r
37  * Application specific definitions.\r
38  *\r
39  * These definitions should be adjusted for your particular hardware and\r
40  * application requirements.\r
41  *\r
42  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
43  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
44  *\r
45  * See http://www.freertos.org/a00110.html.\r
46  *----------------------------------------------------------*/\r
47 \r
48 /* The MEC14xx controller allows interrupts to be aggregated into a single\r
49  * signal which triggers a single interrupt with a fixed priority for all\r
50  * interrupt levels. Alternatively the signals can be disaggregated into unique\r
51  * interrupt events which can be vectored via a dispatch table to unique\r
52  * handlers for each interrupt source.  This mechanism allows, for instance, a \r
53  * single interrupt handler for a large number of IO pins yet unique handlers \r
54  * for timers and other signals.\r
55  * \r
56  * When operating in disaggregated mode certain restrictions apply. The\r
57  * interrupt event and status registers are shared between timers due to their\r
58  * proximity in the memory map.  Similarly the software interrupt control\r
59  * registers are shared with other interrupt sources.  The JTVIC maps interrupt\r
60  * levels into MIPs core interrupt levels consequently JTVIC priorities of 0, 1, \r
61  * 3, and 4 map to the MIPs core values of 1, 3, 5, and 7.  The parameter \r
62  * configTIMERS_DISAGGREGATED_ISRS is used to control if the timers in register \r
63  * GIRQ23 are operating in disaggregated mode.  Similarly \r
64  * configCPU_DISAGGREGATED_ISRS controls the mode for GIRQ24.\r
65  * \r
66  * Note:\r
67  * Disaggregated mode is the more natural manner in which to operate the ISRs\r
68  * and currently only this mode has been tested with the demo application.  If\r
69  * you wish to use aggregated mode then an alternative interrupt handler scheme\r
70  * will need to be used that marshals all interrupts from a single GIRQ through \r
71  * a common handler function that tests which interrupt occurred and dispatches \r
72  * to the relevant handlers.\r
73  */\r
74 #define configTIMERS_DISAGGREGATED_ISRS                         1\r
75 #define configCPU_DISAGGREGATED_ISRS                            1\r
76 \r
77 #define configUSE_PREEMPTION                                            1\r
78 #define configUSE_PORT_OPTIMISED_TASK_SELECTION         1\r
79 #define configUSE_QUEUE_SETS                                            1\r
80 #define configUSE_IDLE_HOOK                                                     0\r
81 #define configUSE_TICK_HOOK                                                     0\r
82 #define configTICK_RATE_HZ                                                      ( ( TickType_t ) 1000 )\r
83 #define configCPU_CLOCK_HZ                                                      ( 48000000UL )\r
84 #define configPERIPHERAL_CLOCK_HZ                                       ( 48000000UL )\r
85 #define configMAX_PRIORITIES                                            ( 5UL )\r
86 #define configMINIMAL_STACK_SIZE                                        ( 190 )\r
87 \r
88 /* MEC14xx JTVIC HW implements 4 priority levels. */\r
89 #define configISR_STACK_SIZE                                            ( 4 * configMINIMAL_STACK_SIZE )\r
90 #define configTOTAL_HEAP_SIZE                                           ( ( size_t ) 22800 )\r
91 #define configMAX_TASK_NAME_LEN                                         ( 8 )\r
92 #define configUSE_TRACE_FACILITY                                        0\r
93 #define configUSE_16_BIT_TICKS                                          0\r
94 #define configIDLE_SHOULD_YIELD                                         1\r
95 #define configUSE_MUTEXES                                                       1\r
96 #define configCHECK_FOR_STACK_OVERFLOW                          3\r
97 #define configQUEUE_REGISTRY_SIZE                                       0\r
98 #define configUSE_RECURSIVE_MUTEXES                                     1\r
99 #define configUSE_MALLOC_FAILED_HOOK                            1\r
100 #define configUSE_APPLICATION_TASK_TAG                          0\r
101 #define configUSE_COUNTING_SEMAPHORES                           1\r
102 #define configGENERATE_RUN_TIME_STATS                           0\r
103 \r
104 /* Co-routine definitions. */\r
105 #define configUSE_CO_ROUTINES                                           0\r
106 #define configMAX_CO_ROUTINE_PRIORITIES                         ( 2 )\r
107 \r
108 /* Software timer definitions. */\r
109 #define configUSE_TIMERS                                                        1\r
110 #define configTIMER_TASK_PRIORITY                                       ( 2 )\r
111 #define configTIMER_QUEUE_LENGTH                                        5\r
112 #define configTIMER_TASK_STACK_DEPTH                            ( configMINIMAL_STACK_SIZE * 2 )\r
113 \r
114 /* Set the following definitions to 1 to include the API function, or zero\r
115 to exclude the API function. */\r
116 #define INCLUDE_vTaskPrioritySet                                        1\r
117 #define INCLUDE_uxTaskPriorityGet                                       1\r
118 #define INCLUDE_vTaskDelete                                                     1\r
119 #define INCLUDE_vTaskCleanUpResources                           0\r
120 #define INCLUDE_vTaskSuspend                                            1\r
121 #define INCLUDE_vTaskDelayUntil                                         1\r
122 #define INCLUDE_vTaskDelay                                                      1\r
123 #define INCLUDE_uxTaskGetStackHighWaterMark                     1\r
124 #define INCLUDE_eTaskGetState                                           1\r
125 #define INCLUDE_xTimerPendFunctionCall                          1\r
126 \r
127 /* The priority at which the tick interrupt runs.\r
128  * Use interrupt controller priority 1 */\r
129 #define configKERNEL_INTERRUPT_PRIORITY                         0x01\r
130 \r
131 /* The maximum interrupt priority from which FreeRTOS.org API functions can\r
132 be called.  Only API functions that end in ...FromISR() can be used within\r
133 interrupts. This describes the interrupt in a numeric range from 1 to 7 however\r
134  only values 1, 3, 5, and 7 are valid */\r
135 #define configMAX_SYSCALL_INTERRUPT_PRIORITY            0x03\r
136 \r
137 /* Prevent C specific syntax being included in assembly files. */\r
138 #ifndef __LANGUAGE_ASSEMBLY\r
139         extern void vAssertCalled( const char * pcFile, unsigned long ulLine );\r
140         #define configASSERT( x ) if( ( x ) == 0  ) vAssertCalled( __FILE__, __LINE__ )\r
141 #endif\r
142 \r
143 #endif /* FREERTOS_CONFIG_H */\r