|
| 1 | +/* |
| 2 | + * FreeRTOS Kernel V10.0.1 |
| 3 | + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * |
| 5 | + * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 6 | + * this software and associated documentation files (the "Software"), to deal in |
| 7 | + * the Software without restriction, including without limitation the rights to |
| 8 | + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 9 | + * the Software, and to permit persons to whom the Software is furnished to do so, |
| 10 | + * subject to the following conditions: |
| 11 | + * |
| 12 | + * The above copyright notice and this permission notice shall be included in all |
| 13 | + * copies or substantial portions of the Software. |
| 14 | + * |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 17 | + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 18 | + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 19 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 20 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | + * |
| 22 | + * http://www.FreeRTOS.org |
| 23 | + * http://aws.amazon.com/freertos |
| 24 | + * |
| 25 | + * 1 tab == 4 spaces! |
| 26 | +*/ |
| 27 | + |
| 28 | +#ifndef FREERTOS_CONFIG_H |
| 29 | +#define FREERTOS_CONFIG_H |
| 30 | + |
| 31 | +/*----------------------------------------------------------- |
| 32 | + * Application specific definitions. |
| 33 | + * |
| 34 | + * These definitions should be adjusted for your particular hardware and |
| 35 | + * application requirements. |
| 36 | + * |
| 37 | + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE |
| 38 | + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. |
| 39 | + * |
| 40 | + * See http://www.freertos.org/a00110.html. |
| 41 | + *----------------------------------------------------------*/ |
| 42 | + |
| 43 | +#include "cy_syslib.h" |
| 44 | + |
| 45 | +#define configUSE_PREEMPTION 1 |
| 46 | +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 |
| 47 | +#define configUSE_TICKLESS_IDLE 0 |
| 48 | +#define configCPU_CLOCK_HZ SystemCoreClock |
| 49 | +#define configTICK_RATE_HZ 1000u |
| 50 | +#define configMAX_PRIORITIES 7 |
| 51 | +#define configMINIMAL_STACK_SIZE 128 |
| 52 | +#define configMAX_TASK_NAME_LEN 32 |
| 53 | +#define configUSE_16_BIT_TICKS 0 |
| 54 | +#define configIDLE_SHOULD_YIELD 1 |
| 55 | +#define configUSE_TASK_NOTIFICATIONS 1 |
| 56 | +#define configUSE_MUTEXES 0 |
| 57 | +#define configUSE_RECURSIVE_MUTEXES 0 |
| 58 | +#define configUSE_COUNTING_SEMAPHORES 0 |
| 59 | +#define configQUEUE_REGISTRY_SIZE 10 |
| 60 | +#define configUSE_QUEUE_SETS 0 |
| 61 | +#define configUSE_TIME_SLICING 0 |
| 62 | +#define configUSE_NEWLIB_REENTRANT 0 |
| 63 | +#define configENABLE_BACKWARD_COMPATIBILITY 0 |
| 64 | +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5 |
| 65 | + |
| 66 | +/* Memory allocation related definitions. */ |
| 67 | +#define configSUPPORT_STATIC_ALLOCATION 0 |
| 68 | +#define configSUPPORT_DYNAMIC_ALLOCATION 1 |
| 69 | +#define configTOTAL_HEAP_SIZE 10240 |
| 70 | +#define configAPPLICATION_ALLOCATED_HEAP 0 |
| 71 | + |
| 72 | +/* Hook function related definitions. */ |
| 73 | +#define configUSE_IDLE_HOOK 0 |
| 74 | +#define configUSE_TICK_HOOK 0 |
| 75 | +#define configCHECK_FOR_STACK_OVERFLOW 2 |
| 76 | +#define configUSE_MALLOC_FAILED_HOOK 1 /* Changed to use memory |
| 77 | + allocation failed hook */ |
| 78 | +#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 |
| 79 | + |
| 80 | +/* Run time and task stats gathering related definitions. */ |
| 81 | +#define configGENERATE_RUN_TIME_STATS 0 |
| 82 | +#define configUSE_TRACE_FACILITY 0 |
| 83 | +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 |
| 84 | + |
| 85 | +/* Co-routine related definitions. */ |
| 86 | +#define configUSE_CO_ROUTINES 0 |
| 87 | +#define configMAX_CO_ROUTINE_PRIORITIES 1 |
| 88 | + |
| 89 | +/* Software timer related definitions. */ |
| 90 | +#define configUSE_TIMERS 1 |
| 91 | +#define configTIMER_TASK_PRIORITY configMAX_PRIORITIES |
| 92 | +#define configTIMER_QUEUE_LENGTH 10 |
| 93 | +#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE |
| 94 | + |
| 95 | +/* FreeRTOS MPU specific definitions. */ |
| 96 | +#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 |
| 97 | + |
| 98 | +/* |
| 99 | +Interrupt nesting behavior configuration. |
| 100 | +This is explained here: http://www.freertos.org/a00110.html |
| 101 | +
|
| 102 | +Priorities are controlled by two macros: |
| 103 | +- configKERNEL_INTERRUPT_PRIORITY determines the priority of the RTOS daemon task |
| 104 | +- configMAX_API_CALL_INTERRUPT_PRIORITY dictates the priority of ISRs that make API calls |
| 105 | +
|
| 106 | +Notes: |
| 107 | +1. Interrupts that do not call API functions should be >= configKERNEL_INTERRUPT_PRIORITY |
| 108 | + and will nest. |
| 109 | +2. Interrupts that call API functions must have priority between KERNEL_INTERRUPT_PRIORITY |
| 110 | + and MAX_API_CALL_INTERRUPT_PRIORITY (inclusive). |
| 111 | +3. Interrupts running above MAX_API_CALL_INTERRUPT_PRIORITY are never delayed by the OS. |
| 112 | +*/ |
| 113 | +/* |
| 114 | +PSoC 6 __NVIC_PRIO_BITS = 3 |
| 115 | +
|
| 116 | +0 (high) |
| 117 | +1 MAX_API_CALL_INTERRUPT_PRIORITY 001xxxxx (0x3F) |
| 118 | +2 |
| 119 | +3 |
| 120 | +4 |
| 121 | +5 |
| 122 | +6 |
| 123 | +7 (low) KERNEL_INTERRUPT_PRIORITY 111xxxxx (0xFF) |
| 124 | +
|
| 125 | +!!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! |
| 126 | +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html |
| 127 | +
|
| 128 | +If you call a FreeRTOS API function from an interrupt with priority higher than |
| 129 | +MAX_API_CALL_INTERRUPT_PRIORITY FreeRTOS will generate an exception. If you need |
| 130 | +to call a FreeRTOS API function from your system's highest priority interrupt |
| 131 | +you must reduce all interrupt priorities to MAX_API_CALL_INTERRUPT_PRIORITY or |
| 132 | +lower. |
| 133 | +
|
| 134 | +If your system pipe (IPC) interrupt priority is less than or equal to |
| 135 | +MAX_API_CALL_INTERRUPT_PRIORITY then care must be taken with code that writes to |
| 136 | +flash (including the Flash/BLE/Emulated EEPROM/Bootloader drivers from Cypress |
| 137 | +PDL). The duration of critical sections must be kept short - see the |
| 138 | +Configuration Considerations section of the flash driver in the PDL API |
| 139 | +Reference. |
| 140 | +
|
| 141 | +*/ |
| 142 | + |
| 143 | +/* Put KERNEL_INTERRUPT_PRIORITY in top __NVIC_PRIO_BITS bits of CM4 register */ |
| 144 | +#define configKERNEL_INTERRUPT_PRIORITY 0xFF |
| 145 | +/* |
| 146 | +Put MAX_SYSCALL_INTERRUPT_PRIORITY in top __NVIC_PRIO_BITS bits of CM4 register |
| 147 | +NOTE For IAR compiler make sure that changes of this macro is reflected in |
| 148 | +file portable\IAR\CM4F\portasm.s in PendSV_Handler: routine |
| 149 | +*/ |
| 150 | +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0x3F |
| 151 | +/* configMAX_API_CALL_INTERRUPT_PRIORITY is a new name for configMAX_SYSCALL_INTERRUPT_PRIORITY |
| 152 | + that is used by newer ports only. The two are equivalent. */ |
| 153 | +#define configMAX_API_CALL_INTERRUPT_PRIORITY configMAX_SYSCALL_INTERRUPT_PRIORITY |
| 154 | + |
| 155 | + |
| 156 | +/* Set the following definitions to 1 to include the API function, or zero |
| 157 | +to exclude the API function. */ |
| 158 | +#define INCLUDE_vTaskPrioritySet 1 |
| 159 | +#define INCLUDE_uxTaskPriorityGet 1 |
| 160 | +#define INCLUDE_vTaskDelete 1 |
| 161 | +#define INCLUDE_vTaskSuspend 1 |
| 162 | +#define INCLUDE_xResumeFromISR 1 |
| 163 | +#define INCLUDE_vTaskDelayUntil 1 |
| 164 | +#define INCLUDE_vTaskDelay 1 |
| 165 | +#define INCLUDE_xTaskGetSchedulerState 1 |
| 166 | +#define INCLUDE_xTaskGetCurrentTaskHandle 1 |
| 167 | +#define INCLUDE_uxTaskGetStackHighWaterMark 0 |
| 168 | +#define INCLUDE_xTaskGetIdleTaskHandle 0 |
| 169 | +#define INCLUDE_eTaskGetState 0 |
| 170 | +#define INCLUDE_xEventGroupSetBitFromISR 1 |
| 171 | +#define INCLUDE_xTimerPendFunctionCall 0 |
| 172 | +#define INCLUDE_xTaskAbortDelay 0 |
| 173 | +#define INCLUDE_xTaskGetHandle 0 |
| 174 | +#define INCLUDE_xTaskResumeFromISR 1 |
| 175 | + |
| 176 | +/* Normal assert() semantics without relying on the provision of an assert.h |
| 177 | +header file. */ |
| 178 | +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } |
| 179 | + |
| 180 | +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS |
| 181 | +standard names - or at least those used in the unmodified vector table. */ |
| 182 | +#define vPortSVCHandler SVC_Handler |
| 183 | +#define xPortPendSVHandler PendSV_Handler |
| 184 | +#define xPortSysTickHandler SysTick_Handler |
| 185 | + |
| 186 | +/* Dynamic Memory Allocation Schemes */ |
| 187 | +#define HEAP_ALLOCATION_TYPE1 (1) /* heap_1.c*/ |
| 188 | +#define HEAP_ALLOCATION_TYPE2 (2) /* heap_2.c*/ |
| 189 | +#define HEAP_ALLOCATION_TYPE3 (3) /* heap_3.c*/ |
| 190 | +#define HEAP_ALLOCATION_TYPE4 (4) /* heap_4.c*/ |
| 191 | +#define HEAP_ALLOCATION_TYPE5 (5) /* heap_5.c*/ |
| 192 | +#define NO_HEAP_ALLOCATION (0) |
| 193 | + |
| 194 | +#define configHEAP_ALLOCATION_SCHEME (HEAP_ALLOCATION_TYPE4) |
| 195 | + |
| 196 | +#endif /* FREERTOS_CONFIG_H */ |
0 commit comments