FreeRTOSConfig.h
是 FreeRTOS
中的配置文件,通过配置该文件可以裁剪使用哪些 FreeRTOS
功能。
网站的 FreeRTOSConfig.h
配置文件很大有很多配置选项,但是有很多选项是有默认值的,我们只需配置我们使用的选项即可。
下面是一份 FreeRTOSConfig.h
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 #ifndef __FREERTOS_CONFIG_H #define __FREERTOS_CONFIG_H #include "common_inc.h" #ifdef AT32 #include "at32f413.h" #endif #ifdef STM32F1XX #include "stm32f1xx.h" #endif #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 1 #define configCPU_CLOCK_HZ ((unsigned long)SystemCoreClock) #define configTICK_RATE_HZ ((TickType_t)1000) #define configMAX_PRIORITIES (8) #define configMINIMAL_STACK_SIZE ((unsigned short)128) #define configTOTAL_HEAP_SIZE ((size_t)(5 * 1024)) #define configMAX_TASK_NAME_LEN (16) #define configUSE_TRACE_FACTLITY 0 #define configUSE_16_BIT_TICKS 0 #define configUSE_TIMERS 0 #define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) #define configTIMER_QUEUE_LENGTH 5 #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2) #define configSUPPORT_DYNAMIC_ALLOCATION 1 #define configIDLE_SHOULD_YIELD 0 #define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_uxTaskPriorityGet 1 #define INCLUDE_vTaskDelete 1 #define INCLUDE_vTaskCleanUpResources 0 #define INCLUDE_vTaskSuspend 1 #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 #define INCLUDE_xTaskGetHandle 1 #ifdef __NVIC_PRIO_BITS #define configPRIO_BITS __NVIC_PRIO_BITS #else #define configPRIO_BITS 4 #endif #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xF #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2 #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) #define configUSE_PORT_OPTIMISED_TASK_SELECTIOIN 1 #define configUSE_TICKLESS_IDLE 0 #define xPortSysTickHandler SysTick_Handler #define vPortSVCHandler SVC_Handler #define xPortPendSVHandler PendSV_Handler #endif