| 1 | /*
|
|---|
| 2 | * FreeRTOS Kernel V10.2.1
|
|---|
| 3 | * Copyright (C) 2019 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 | * this is a template configuration files
|
|---|
| 33 | *
|
|---|
| 34 | * These definitions should be adjusted for your particular hardware and
|
|---|
| 35 | * application requirements.
|
|---|
| 36 | *
|
|---|
| 37 | * These parameters and more 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 | /* Ensure stdint is only used by the compiler, and not the assembler. */
|
|---|
| 44 | #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
|
|---|
| 45 | #include <stdint.h>
|
|---|
| 46 | extern uint32_t SystemCoreClock;
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | /* CMSIS-RTOSv2 defines 56 levels of priorities. To be able to use them
|
|---|
| 50 | * all and avoid application misbehavior, configUSE_PORT_OPTIMISED_TASK_SELECTION
|
|---|
| 51 | * must be set to 0 and configMAX_PRIORITIES to 56
|
|---|
| 52 | *
|
|---|
| 53 | */
|
|---|
| 54 | /* #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0*/
|
|---|
| 55 | /* #define configMAX_PRIORITIES ( 56 ) */
|
|---|
| 56 | #define configUSE_PREEMPTION 1
|
|---|
| 57 | #define configUSE_IDLE_HOOK 0
|
|---|
| 58 | #define configUSE_TICK_HOOK 0
|
|---|
| 59 | #define configMAX_PRIORITIES (7)
|
|---|
| 60 | #define configSUPPORT_STATIC_ALLOCATION 0
|
|---|
| 61 | #define configCPU_CLOCK_HZ (SystemCoreClock)
|
|---|
| 62 | #define configTICK_RATE_HZ ((TickType_t)1000)
|
|---|
| 63 | #define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
|---|
| 64 | #define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024))
|
|---|
| 65 | #define configMAX_TASK_NAME_LEN (16)
|
|---|
| 66 | #define configUSE_TRACE_FACILITY 1
|
|---|
| 67 | #define configUSE_16_BIT_TICKS 0
|
|---|
| 68 | #define configIDLE_SHOULD_YIELD 1
|
|---|
| 69 | #define configUSE_MUTEXES 1
|
|---|
| 70 | #define configQUEUE_REGISTRY_SIZE 8
|
|---|
| 71 | #define configCHECK_FOR_STACK_OVERFLOW 0
|
|---|
| 72 | #define configUSE_RECURSIVE_MUTEXES 1
|
|---|
| 73 | #define configUSE_MALLOC_FAILED_HOOK 0
|
|---|
| 74 | #define configUSE_APPLICATION_TASK_TAG 0
|
|---|
| 75 | #define configUSE_COUNTING_SEMAPHORES 1
|
|---|
| 76 | #define configGENERATE_RUN_TIME_STATS 0
|
|---|
| 77 |
|
|---|
| 78 | /* Co-routine definitions. */
|
|---|
| 79 | #define configUSE_CO_ROUTINES 0
|
|---|
| 80 | #define configMAX_CO_ROUTINE_PRIORITIES (2)
|
|---|
| 81 |
|
|---|
| 82 | /* Software timer definitions. */
|
|---|
| 83 | #define configUSE_TIMERS 0
|
|---|
| 84 | #define configTIMER_TASK_PRIORITY (2)
|
|---|
| 85 | #define configTIMER_QUEUE_LENGTH 10
|
|---|
| 86 | #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2)
|
|---|
| 87 |
|
|---|
| 88 | /* Set the following definitions to 1 to include the API function, or zero
|
|---|
| 89 | to exclude the API function. */
|
|---|
| 90 | #define INCLUDE_vTaskPrioritySet 1
|
|---|
| 91 | #define INCLUDE_uxTaskPriorityGet 1
|
|---|
| 92 | #define INCLUDE_vTaskDelete 1
|
|---|
| 93 | #define INCLUDE_vTaskCleanUpResources 0
|
|---|
| 94 | #define INCLUDE_vTaskSuspend 1
|
|---|
| 95 | #define INCLUDE_vTaskDelayUntil 0
|
|---|
| 96 | #define INCLUDE_vTaskDelay 1
|
|---|
| 97 | #define INCLUDE_xTaskGetSchedulerState 1
|
|---|
| 98 |
|
|---|
| 99 | /*------------- CMSIS-RTOS V2 specific defines -----------*/
|
|---|
| 100 | /* When using CMSIS-RTOSv2 set configSUPPORT_STATIC_ALLOCATION to 1
|
|---|
| 101 | * is mandatory to avoid compile errors.
|
|---|
| 102 | * CMSIS-RTOS V2 implmentation requires the following defines
|
|---|
| 103 | *
|
|---|
| 104 | #define configSUPPORT_STATIC_ALLOCATION 1 <-- cmsis_os threads are created using xTaskCreateStatic() API
|
|---|
| 105 | #define configMAX_PRIORITIES (56) <-- Priority range in CMSIS-RTOS V2 is [0 .. 56]
|
|---|
| 106 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 <-- when set to 1, configMAX_PRIORITIES can't be more than 32 which is not suitable for the new CMSIS-RTOS v2 priority range
|
|---|
| 107 | */
|
|---|
| 108 |
|
|---|
| 109 | /* the CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
|
|---|
| 110 | * by the application thus the correct define need to be enabled from the list
|
|---|
| 111 | * below
|
|---|
| 112 | *
|
|---|
| 113 | //define USE_FreeRTOS_HEAP_1
|
|---|
| 114 | //define USE_FreeRTOS_HEAP_2
|
|---|
| 115 | //define USE_FreeRTOS_HEAP_3
|
|---|
| 116 | //define USE_FreeRTOS_HEAP_4
|
|---|
| 117 | //define USE_FreeRTOS_HEAP_5
|
|---|
| 118 |
|
|---|
| 119 | */
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 | /* Cortex-M specific definitions. */
|
|---|
| 123 | #ifdef __NVIC_PRIO_BITS
|
|---|
| 124 | /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
|
|---|
| 125 | #define configPRIO_BITS __NVIC_PRIO_BITS
|
|---|
| 126 | #else
|
|---|
| 127 | #define configPRIO_BITS 4 /* 15 priority levels */
|
|---|
| 128 | #endif
|
|---|
| 129 |
|
|---|
| 130 | /* The lowest interrupt priority that can be used in a call to a "set priority"
|
|---|
| 131 | function. */
|
|---|
| 132 | #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
|
|---|
| 133 |
|
|---|
| 134 | /* The highest interrupt priority that can be used by any interrupt service
|
|---|
| 135 | routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|---|
| 136 | INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|---|
| 137 | PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|---|
| 138 | #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
|
|---|
| 139 |
|
|---|
| 140 | /* Interrupt priorities used by the kernel port layer itself. These are generic
|
|---|
| 141 | to all Cortex-M ports, and do not rely on any particular library functions. */
|
|---|
| 142 | #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|---|
| 143 | /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
|---|
| 144 | See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
|---|
| 145 | #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|---|
| 146 |
|
|---|
| 147 | /* Normal assert() semantics without relying on the provision of an assert.h
|
|---|
| 148 | header file. */
|
|---|
| 149 | #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
|---|
| 150 |
|
|---|
| 151 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
|---|
| 152 | standard names. */
|
|---|
| 153 | #define vPortSVCHandler SVC_Handler
|
|---|
| 154 | #define xPortPendSVHandler PendSV_Handler
|
|---|
| 155 |
|
|---|
| 156 | /* IMPORTANT: FreeRTOS is using the SysTick as internal time base, thus make sure the system and peripherials are
|
|---|
| 157 | using a different time base (TIM based for example).
|
|---|
| 158 | */
|
|---|
| 159 | #define xPortSysTickHandler SysTick_Handler
|
|---|
| 160 |
|
|---|
| 161 | #endif /* FREERTOS_CONFIG_H */
|
|---|
| 162 |
|
|---|