kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1 | /* |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 2 | * FreeRTOS Kernel V10.2.1 |
| 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 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 | * |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 22 | * http://www.FreeRTOS.org |
| 23 | * http://aws.amazon.com/freertos |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 24 | * |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 25 | * 1 tab == 4 spaces! |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #ifndef INC_FREERTOS_H |
| 29 | #define INC_FREERTOS_H |
| 30 | |
| 31 | /* |
| 32 | * Include the generic headers required for the FreeRTOS port being used. |
| 33 | */ |
| 34 | #include <stddef.h> |
| 35 | |
| 36 | /* |
| 37 | * If stdint.h cannot be located then: |
| 38 | * + If using GCC ensure the -nostdint options is *not* being used. |
| 39 | * + Ensure the project's include path includes the directory in which your |
| 40 | * compiler stores stdint.h. |
| 41 | * + Set any compiler options necessary for it to support C99, as technically |
| 42 | * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any |
| 43 | * other way). |
| 44 | * + The FreeRTOS download includes a simple stdint.h definition that can be |
| 45 | * used in cases where none is provided by the compiler. The files only |
| 46 | * contains the typedefs required to build FreeRTOS. Read the instructions |
| 47 | * in FreeRTOS/source/stdint.readme for more information. |
| 48 | */ |
| 49 | #include <stdint.h> /* READ COMMENT ABOVE. */ |
| 50 | |
| 51 | #ifdef __cplusplus |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 52 | extern "C" { |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 53 | #endif |
| 54 | |
| 55 | /* Application specific configuration options. */ |
| 56 | #include "FreeRTOSConfig.h" |
| 57 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 58 | /* Add the extended interfaces for AML */ |
| 59 | #include "aml_ext_interfaces.h" |
| 60 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 61 | /* Basic FreeRTOS definitions. */ |
| 62 | #include "projdefs.h" |
| 63 | |
| 64 | /* Definitions specific to the port being used. */ |
| 65 | #include "portable.h" |
| 66 | |
| 67 | /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */ |
| 68 | #ifndef configUSE_NEWLIB_REENTRANT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 69 | #define configUSE_NEWLIB_REENTRANT 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 70 | #endif |
| 71 | |
| 72 | /* Required if struct _reent is used. */ |
| 73 | #if ( configUSE_NEWLIB_REENTRANT == 1 ) |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 74 | #include <reent.h> |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 75 | #endif |
shijie.xiong | 39d6699 | 2023-09-15 16:08:38 +0800 | [diff] [blame] | 76 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 77 | #ifdef CONFIG_BARECTF |
| 78 | #include "freertos-trace.h" |
| 79 | #endif |
shijie.xiong | 39d6699 | 2023-09-15 16:08:38 +0800 | [diff] [blame] | 80 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 81 | /* |
| 82 | * Check all the required application specific macros have been defined. |
| 83 | * These macros are application specific and (as downloaded) are defined |
| 84 | * within FreeRTOSConfig.h. |
| 85 | */ |
| 86 | |
| 87 | #ifndef configMINIMAL_STACK_SIZE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 88 | #error Missing definition: configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h. configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task. Refer to the demo project provided for your port for a suitable value. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 89 | #endif |
| 90 | |
| 91 | #ifndef configMAX_PRIORITIES |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 92 | #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 93 | #endif |
| 94 | |
| 95 | #if configMAX_PRIORITIES < 1 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 96 | #error configMAX_PRIORITIES must be defined to be greater than or equal to 1. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 97 | #endif |
| 98 | |
| 99 | #ifndef configUSE_PREEMPTION |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 100 | #error Missing definition: configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 101 | #endif |
| 102 | |
| 103 | #ifndef configUSE_IDLE_HOOK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 104 | #error Missing definition: configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 105 | #endif |
| 106 | |
| 107 | #ifndef configUSE_TICK_HOOK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 108 | #error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 109 | #endif |
| 110 | |
| 111 | #ifndef configUSE_16_BIT_TICKS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 112 | #error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 113 | #endif |
| 114 | |
| 115 | #ifndef configUSE_CO_ROUTINES |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 116 | #define configUSE_CO_ROUTINES 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 117 | #endif |
| 118 | |
| 119 | #ifndef INCLUDE_vTaskPrioritySet |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 120 | #define INCLUDE_vTaskPrioritySet 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 121 | #endif |
| 122 | |
| 123 | #ifndef INCLUDE_uxTaskPriorityGet |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 124 | #define INCLUDE_uxTaskPriorityGet 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 125 | #endif |
| 126 | |
| 127 | #ifndef INCLUDE_vTaskDelete |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 128 | #define INCLUDE_vTaskDelete 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 129 | #endif |
| 130 | |
| 131 | #ifndef INCLUDE_vTaskSuspend |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 132 | #define INCLUDE_vTaskSuspend 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 133 | #endif |
| 134 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 135 | #ifndef INCLUDE_vTaskDelayUntil |
| 136 | #define INCLUDE_vTaskDelayUntil 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 137 | #endif |
| 138 | |
| 139 | #ifndef INCLUDE_vTaskDelay |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 140 | #define INCLUDE_vTaskDelay 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 141 | #endif |
| 142 | |
| 143 | #ifndef INCLUDE_xTaskGetIdleTaskHandle |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 144 | #define INCLUDE_xTaskGetIdleTaskHandle 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 145 | #endif |
| 146 | |
| 147 | #ifndef INCLUDE_xTaskAbortDelay |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 148 | #define INCLUDE_xTaskAbortDelay 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 149 | #endif |
| 150 | |
| 151 | #ifndef INCLUDE_xQueueGetMutexHolder |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 152 | #define INCLUDE_xQueueGetMutexHolder 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 153 | #endif |
| 154 | |
| 155 | #ifndef INCLUDE_xSemaphoreGetMutexHolder |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 156 | #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 157 | #endif |
| 158 | |
| 159 | #ifndef INCLUDE_xTaskGetHandle |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 160 | #define INCLUDE_xTaskGetHandle 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 161 | #endif |
| 162 | |
| 163 | #ifndef INCLUDE_uxTaskGetStackHighWaterMark |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 164 | #define INCLUDE_uxTaskGetStackHighWaterMark 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 165 | #endif |
| 166 | |
| 167 | #ifndef INCLUDE_uxTaskGetStackHighWaterMark2 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 168 | #define INCLUDE_uxTaskGetStackHighWaterMark2 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 169 | #endif |
| 170 | |
| 171 | #ifndef INCLUDE_eTaskGetState |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 172 | #define INCLUDE_eTaskGetState 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 173 | #endif |
| 174 | |
| 175 | #ifndef INCLUDE_xTaskResumeFromISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 176 | #define INCLUDE_xTaskResumeFromISR 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 177 | #endif |
| 178 | |
| 179 | #ifndef INCLUDE_xTimerPendFunctionCall |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 180 | #define INCLUDE_xTimerPendFunctionCall 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 181 | #endif |
| 182 | |
| 183 | #ifndef INCLUDE_xTaskGetSchedulerState |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 184 | #define INCLUDE_xTaskGetSchedulerState 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 185 | #endif |
| 186 | |
| 187 | #ifndef INCLUDE_xTaskGetCurrentTaskHandle |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 188 | #define INCLUDE_xTaskGetCurrentTaskHandle 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 189 | #endif |
| 190 | |
| 191 | #if configUSE_CO_ROUTINES != 0 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 192 | #ifndef configMAX_CO_ROUTINE_PRIORITIES |
| 193 | #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1. |
| 194 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 195 | #endif |
| 196 | |
| 197 | #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 198 | #define configUSE_DAEMON_TASK_STARTUP_HOOK 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 199 | #endif |
| 200 | |
| 201 | #ifndef configUSE_APPLICATION_TASK_TAG |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 202 | #define configUSE_APPLICATION_TASK_TAG 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 203 | #endif |
| 204 | |
| 205 | #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 206 | #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 207 | #endif |
| 208 | |
| 209 | #ifndef configUSE_RECURSIVE_MUTEXES |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 210 | #define configUSE_RECURSIVE_MUTEXES 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 211 | #endif |
| 212 | |
| 213 | #ifndef configUSE_MUTEXES |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 214 | #define configUSE_MUTEXES 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 215 | #endif |
| 216 | |
| 217 | #ifndef configUSE_TIMERS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 218 | #define configUSE_TIMERS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 219 | #endif |
| 220 | |
| 221 | #ifndef configUSE_COUNTING_SEMAPHORES |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 222 | #define configUSE_COUNTING_SEMAPHORES 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 223 | #endif |
| 224 | |
| 225 | #ifndef configUSE_ALTERNATIVE_API |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 226 | #define configUSE_ALTERNATIVE_API 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 227 | #endif |
| 228 | |
| 229 | #ifndef portCRITICAL_NESTING_IN_TCB |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 230 | #define portCRITICAL_NESTING_IN_TCB 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 231 | #endif |
| 232 | |
| 233 | #ifndef configMAX_TASK_NAME_LEN |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 234 | #define configMAX_TASK_NAME_LEN 16 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 235 | #endif |
| 236 | |
| 237 | #ifndef configIDLE_SHOULD_YIELD |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 238 | #define configIDLE_SHOULD_YIELD 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 239 | #endif |
| 240 | |
| 241 | #if configMAX_TASK_NAME_LEN < 1 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 242 | #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 243 | #endif |
| 244 | |
| 245 | #ifndef configASSERT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 246 | #define configASSERT( x ) |
| 247 | #define configASSERT_DEFINED 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 248 | #else |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 249 | #define configASSERT_DEFINED 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 250 | #endif |
| 251 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 252 | #ifndef portMEMORY_BARRIER |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 253 | #define portMEMORY_BARRIER() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 254 | #endif |
| 255 | |
| 256 | /* The timers module relies on xTaskGetSchedulerState(). */ |
| 257 | #if configUSE_TIMERS == 1 |
| 258 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 259 | #ifndef configTIMER_TASK_PRIORITY |
| 260 | #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined. |
| 261 | #endif /* configTIMER_TASK_PRIORITY */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 262 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 263 | #ifndef configTIMER_QUEUE_LENGTH |
| 264 | #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined. |
| 265 | #endif /* configTIMER_QUEUE_LENGTH */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 266 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 267 | #ifndef configTIMER_TASK_STACK_DEPTH |
| 268 | #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined. |
| 269 | #endif /* configTIMER_TASK_STACK_DEPTH */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 270 | |
| 271 | #endif /* configUSE_TIMERS */ |
| 272 | |
| 273 | #ifndef portSET_INTERRUPT_MASK_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 274 | #define portSET_INTERRUPT_MASK_FROM_ISR() 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 275 | #endif |
| 276 | |
| 277 | #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 278 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 279 | #endif |
| 280 | |
| 281 | #ifndef portCLEAN_UP_TCB |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 282 | #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 283 | #endif |
| 284 | |
| 285 | #ifndef portPRE_TASK_DELETE_HOOK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 286 | #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 287 | #endif |
| 288 | |
| 289 | #ifndef portSETUP_TCB |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 290 | #define portSETUP_TCB( pxTCB ) ( void ) pxTCB |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 291 | #endif |
| 292 | |
| 293 | #ifndef configQUEUE_REGISTRY_SIZE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 294 | #define configQUEUE_REGISTRY_SIZE 0U |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 295 | #endif |
| 296 | |
| 297 | #if ( configQUEUE_REGISTRY_SIZE < 1 ) |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 298 | #define vQueueAddToRegistry( xQueue, pcName ) |
| 299 | #define vQueueUnregisterQueue( xQueue ) |
| 300 | #define pcQueueGetName( xQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 301 | #endif |
| 302 | |
| 303 | #ifndef portPOINTER_SIZE_TYPE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 304 | #define portPOINTER_SIZE_TYPE uint32_t |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 305 | #endif |
| 306 | |
| 307 | /* Remove any unused trace macros. */ |
| 308 | #ifndef traceSTART |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 309 | /* Used to perform any necessary initialisation - for example, open a file |
| 310 | into which trace is to be written. */ |
| 311 | #define traceSTART() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 312 | #endif |
| 313 | |
| 314 | #ifndef traceEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 315 | /* Use to close a trace, for example close a file into which trace has been |
| 316 | written. */ |
| 317 | #define traceEND() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 318 | #endif |
| 319 | |
| 320 | #ifndef traceTASK_SWITCHED_IN |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 321 | /* Called after a task has been selected to run. pxCurrentTCB holds a pointer |
| 322 | to the task control block of the selected task. */ |
| 323 | #define traceTASK_SWITCHED_IN() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 324 | #endif |
| 325 | |
| 326 | #ifndef traceINCREASE_TICK_COUNT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 327 | /* Called before stepping the tick count after waking from tickless idle |
| 328 | sleep. */ |
| 329 | #define traceINCREASE_TICK_COUNT( x ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 330 | #endif |
| 331 | |
| 332 | #ifndef traceLOW_POWER_IDLE_BEGIN |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 333 | /* Called immediately before entering tickless idle. */ |
| 334 | #define traceLOW_POWER_IDLE_BEGIN() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 335 | #endif |
| 336 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 337 | #ifndef traceLOW_POWER_IDLE_END |
| 338 | /* Called when returning to the Idle task after a tickless idle. */ |
| 339 | #define traceLOW_POWER_IDLE_END() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 340 | #endif |
| 341 | |
| 342 | #ifndef traceTASK_SWITCHED_OUT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 343 | /* Called before a task has been selected to run. pxCurrentTCB holds a pointer |
| 344 | to the task control block of the task being switched out. */ |
| 345 | #define traceTASK_SWITCHED_OUT() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 346 | #endif |
| 347 | |
| 348 | #ifndef traceTASK_PRIORITY_INHERIT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 349 | /* Called when a task attempts to take a mutex that is already held by a |
| 350 | lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task |
| 351 | that holds the mutex. uxInheritedPriority is the priority the mutex holder |
| 352 | will inherit (the priority of the task that is attempting to obtain the |
| 353 | muted. */ |
| 354 | #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 355 | #endif |
| 356 | |
| 357 | #ifndef traceTASK_PRIORITY_DISINHERIT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 358 | /* Called when a task releases a mutex, the holding of which had resulted in |
| 359 | the task inheriting the priority of a higher priority task. |
| 360 | pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the |
| 361 | mutex. uxOriginalPriority is the task's configured (base) priority. */ |
| 362 | #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 363 | #endif |
| 364 | |
| 365 | #ifndef traceBLOCKING_ON_QUEUE_RECEIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 366 | /* Task is about to block because it cannot read from a |
| 367 | queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore |
| 368 | upon which the read was attempted. pxCurrentTCB points to the TCB of the |
| 369 | task that attempted the read. */ |
| 370 | #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 371 | #endif |
| 372 | |
| 373 | #ifndef traceBLOCKING_ON_QUEUE_PEEK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 374 | /* Task is about to block because it cannot read from a |
| 375 | queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore |
| 376 | upon which the read was attempted. pxCurrentTCB points to the TCB of the |
| 377 | task that attempted the read. */ |
| 378 | #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 379 | #endif |
| 380 | |
| 381 | #ifndef traceBLOCKING_ON_QUEUE_SEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 382 | /* Task is about to block because it cannot write to a |
| 383 | queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore |
| 384 | upon which the write was attempted. pxCurrentTCB points to the TCB of the |
| 385 | task that attempted the write. */ |
| 386 | #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 387 | #endif |
| 388 | |
| 389 | #ifndef configCHECK_FOR_STACK_OVERFLOW |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 390 | #define configCHECK_FOR_STACK_OVERFLOW 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 391 | #endif |
| 392 | |
| 393 | #ifndef configRECORD_STACK_HIGH_ADDRESS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 394 | #define configRECORD_STACK_HIGH_ADDRESS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 395 | #endif |
| 396 | |
| 397 | #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 398 | #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 399 | #endif |
| 400 | |
| 401 | /* The following event macros are embedded in the kernel API calls. */ |
| 402 | |
| 403 | #ifndef traceMOVED_TASK_TO_READY_STATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 404 | #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 405 | #endif |
| 406 | |
| 407 | #ifndef tracePOST_MOVED_TASK_TO_READY_STATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 408 | #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 409 | #endif |
| 410 | |
| 411 | #ifndef traceQUEUE_CREATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 412 | #define traceQUEUE_CREATE( pxNewQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 413 | #endif |
| 414 | |
| 415 | #ifndef traceQUEUE_CREATE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 416 | #define traceQUEUE_CREATE_FAILED( ucQueueType ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 417 | #endif |
| 418 | |
| 419 | #ifndef traceCREATE_MUTEX |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 420 | #define traceCREATE_MUTEX( pxNewQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 421 | #endif |
| 422 | |
| 423 | #ifndef traceCREATE_MUTEX_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 424 | #define traceCREATE_MUTEX_FAILED() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 425 | #endif |
| 426 | |
| 427 | #ifndef traceGIVE_MUTEX_RECURSIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 428 | #define traceGIVE_MUTEX_RECURSIVE( pxMutex ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 429 | #endif |
| 430 | |
| 431 | #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 432 | #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 433 | #endif |
| 434 | |
| 435 | #ifndef traceTAKE_MUTEX_RECURSIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 436 | #define traceTAKE_MUTEX_RECURSIVE( pxMutex ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 437 | #endif |
| 438 | |
| 439 | #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 440 | #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 441 | #endif |
| 442 | |
| 443 | #ifndef traceCREATE_COUNTING_SEMAPHORE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 444 | #define traceCREATE_COUNTING_SEMAPHORE() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 445 | #endif |
| 446 | |
| 447 | #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 448 | #define traceCREATE_COUNTING_SEMAPHORE_FAILED() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 449 | #endif |
| 450 | |
| 451 | #ifndef traceQUEUE_SEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 452 | #define traceQUEUE_SEND( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 453 | #endif |
| 454 | |
| 455 | #ifndef traceQUEUE_SEND_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 456 | #define traceQUEUE_SEND_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 457 | #endif |
| 458 | |
| 459 | #ifndef traceQUEUE_RECEIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 460 | #define traceQUEUE_RECEIVE( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 461 | #endif |
| 462 | |
| 463 | #ifndef traceQUEUE_PEEK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 464 | #define traceQUEUE_PEEK( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 465 | #endif |
| 466 | |
| 467 | #ifndef traceQUEUE_PEEK_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 468 | #define traceQUEUE_PEEK_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 469 | #endif |
| 470 | |
| 471 | #ifndef traceQUEUE_PEEK_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 472 | #define traceQUEUE_PEEK_FROM_ISR( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 473 | #endif |
| 474 | |
| 475 | #ifndef traceQUEUE_RECEIVE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 476 | #define traceQUEUE_RECEIVE_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 477 | #endif |
| 478 | |
| 479 | #ifndef traceQUEUE_SEND_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 480 | #define traceQUEUE_SEND_FROM_ISR( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 481 | #endif |
| 482 | |
| 483 | #ifndef traceQUEUE_SEND_FROM_ISR_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 484 | #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 485 | #endif |
| 486 | |
| 487 | #ifndef traceQUEUE_RECEIVE_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 488 | #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 489 | #endif |
| 490 | |
| 491 | #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 492 | #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 493 | #endif |
| 494 | |
| 495 | #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 496 | #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 497 | #endif |
| 498 | |
| 499 | #ifndef traceQUEUE_DELETE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 500 | #define traceQUEUE_DELETE( pxQueue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 501 | #endif |
| 502 | |
| 503 | #ifndef traceTASK_CREATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 504 | #define traceTASK_CREATE( pxNewTCB ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 505 | #endif |
| 506 | |
| 507 | #ifndef traceTASK_CREATE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 508 | #define traceTASK_CREATE_FAILED() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 509 | #endif |
| 510 | |
| 511 | #ifndef traceTASK_DELETE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 512 | #define traceTASK_DELETE( pxTaskToDelete ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 513 | #endif |
| 514 | |
| 515 | #ifndef traceTASK_DELAY_UNTIL |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 516 | #define traceTASK_DELAY_UNTIL( x ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 517 | #endif |
| 518 | |
| 519 | #ifndef traceTASK_DELAY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 520 | #define traceTASK_DELAY() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 521 | #endif |
| 522 | |
| 523 | #ifndef traceTASK_PRIORITY_SET |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 524 | #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 525 | #endif |
| 526 | |
| 527 | #ifndef traceTASK_SUSPEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 528 | #define traceTASK_SUSPEND( pxTaskToSuspend ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 529 | #endif |
| 530 | |
| 531 | #ifndef traceTASK_RESUME |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 532 | #define traceTASK_RESUME( pxTaskToResume ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 533 | #endif |
| 534 | |
| 535 | #ifndef traceTASK_RESUME_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 536 | #define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 537 | #endif |
| 538 | |
| 539 | #ifndef traceTASK_INCREMENT_TICK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 540 | #define traceTASK_INCREMENT_TICK( xTickCount ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 541 | #endif |
| 542 | |
| 543 | #ifndef traceTIMER_CREATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 544 | #define traceTIMER_CREATE( pxNewTimer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 545 | #endif |
| 546 | |
| 547 | #ifndef traceTIMER_CREATE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 548 | #define traceTIMER_CREATE_FAILED() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 549 | #endif |
| 550 | |
| 551 | #ifndef traceTIMER_COMMAND_SEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 552 | #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 553 | #endif |
| 554 | |
| 555 | #ifndef traceTIMER_EXPIRED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 556 | #define traceTIMER_EXPIRED( pxTimer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 557 | #endif |
| 558 | |
| 559 | #ifndef traceTIMER_COMMAND_RECEIVED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 560 | #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 561 | #endif |
| 562 | |
| 563 | #ifndef traceMALLOC |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 564 | #define traceMALLOC( pvAddress, uiSize ) // printf("debug alloc %p %8u %8u\n", pvAddress, uiSize, xPortGetFreeHeapSize()) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 565 | #endif |
| 566 | |
| 567 | #ifndef traceFREE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 568 | #define traceFREE( pvAddress, uiSize ) // printf("debug free %p %8u %8u\n", pvAddress, uiSize, xPortGetFreeHeapSize()) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 569 | #endif |
| 570 | |
| 571 | #ifndef traceEVENT_GROUP_CREATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 572 | #define traceEVENT_GROUP_CREATE( xEventGroup ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 573 | #endif |
| 574 | |
| 575 | #ifndef traceEVENT_GROUP_CREATE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 576 | #define traceEVENT_GROUP_CREATE_FAILED() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 577 | #endif |
| 578 | |
| 579 | #ifndef traceEVENT_GROUP_SYNC_BLOCK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 580 | #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 581 | #endif |
| 582 | |
| 583 | #ifndef traceEVENT_GROUP_SYNC_END |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 584 | #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 585 | #endif |
| 586 | |
| 587 | #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 588 | #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 589 | #endif |
| 590 | |
| 591 | #ifndef traceEVENT_GROUP_WAIT_BITS_END |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 592 | #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 593 | #endif |
| 594 | |
| 595 | #ifndef traceEVENT_GROUP_CLEAR_BITS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 596 | #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 597 | #endif |
| 598 | |
| 599 | #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 600 | #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 601 | #endif |
| 602 | |
| 603 | #ifndef traceEVENT_GROUP_SET_BITS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 604 | #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 605 | #endif |
| 606 | |
| 607 | #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 608 | #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 609 | #endif |
| 610 | |
| 611 | #ifndef traceEVENT_GROUP_DELETE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 612 | #define traceEVENT_GROUP_DELETE( xEventGroup ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 613 | #endif |
| 614 | |
| 615 | #ifndef tracePEND_FUNC_CALL |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 616 | #define tracePEND_FUNC_CALL(xFunctionToPend, pvParameter1, ulParameter2, ret) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 617 | #endif |
| 618 | |
| 619 | #ifndef tracePEND_FUNC_CALL_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 620 | #define tracePEND_FUNC_CALL_FROM_ISR(xFunctionToPend, pvParameter1, ulParameter2, ret) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 621 | #endif |
| 622 | |
| 623 | #ifndef traceQUEUE_REGISTRY_ADD |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 624 | #define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 625 | #endif |
| 626 | |
| 627 | #ifndef traceTASK_NOTIFY_TAKE_BLOCK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 628 | #define traceTASK_NOTIFY_TAKE_BLOCK() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 629 | #endif |
| 630 | |
| 631 | #ifndef traceTASK_NOTIFY_TAKE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 632 | #define traceTASK_NOTIFY_TAKE() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 633 | #endif |
| 634 | |
| 635 | #ifndef traceTASK_NOTIFY_WAIT_BLOCK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 636 | #define traceTASK_NOTIFY_WAIT_BLOCK() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 637 | #endif |
| 638 | |
| 639 | #ifndef traceTASK_NOTIFY_WAIT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 640 | #define traceTASK_NOTIFY_WAIT() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 641 | #endif |
| 642 | |
| 643 | #ifndef traceTASK_NOTIFY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 644 | #define traceTASK_NOTIFY() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 645 | #endif |
| 646 | |
| 647 | #ifndef traceTASK_NOTIFY_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 648 | #define traceTASK_NOTIFY_FROM_ISR() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 649 | #endif |
| 650 | |
| 651 | #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 652 | #define traceTASK_NOTIFY_GIVE_FROM_ISR() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 653 | #endif |
| 654 | |
| 655 | #ifndef traceSTREAM_BUFFER_CREATE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 656 | #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 657 | #endif |
| 658 | |
| 659 | #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 660 | #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 661 | #endif |
| 662 | |
| 663 | #ifndef traceSTREAM_BUFFER_CREATE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 664 | #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 665 | #endif |
| 666 | |
| 667 | #ifndef traceSTREAM_BUFFER_DELETE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 668 | #define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 669 | #endif |
| 670 | |
| 671 | #ifndef traceSTREAM_BUFFER_RESET |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 672 | #define traceSTREAM_BUFFER_RESET( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 673 | #endif |
| 674 | |
| 675 | #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 676 | #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 677 | #endif |
| 678 | |
| 679 | #ifndef traceSTREAM_BUFFER_SEND |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 680 | #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 681 | #endif |
| 682 | |
| 683 | #ifndef traceSTREAM_BUFFER_SEND_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 684 | #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 685 | #endif |
| 686 | |
| 687 | #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 688 | #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 689 | #endif |
| 690 | |
| 691 | #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 692 | #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 693 | #endif |
| 694 | |
| 695 | #ifndef traceSTREAM_BUFFER_RECEIVE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 696 | #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 697 | #endif |
| 698 | |
| 699 | #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 700 | #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 701 | #endif |
| 702 | |
| 703 | #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 704 | #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 705 | #endif |
| 706 | |
| 707 | #ifndef configGENERATE_RUN_TIME_STATS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 708 | #define configGENERATE_RUN_TIME_STATS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 709 | #endif |
| 710 | |
| 711 | #if ( configGENERATE_RUN_TIME_STATS == 1 ) |
| 712 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 713 | #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS |
| 714 | #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base. |
| 715 | #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 716 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 717 | #ifndef portGET_RUN_TIME_COUNTER_VALUE |
| 718 | #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE |
| 719 | #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information. |
| 720 | #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */ |
| 721 | #endif /* portGET_RUN_TIME_COUNTER_VALUE */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 722 | |
| 723 | #endif /* configGENERATE_RUN_TIME_STATS */ |
| 724 | |
| 725 | #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 726 | #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 727 | #endif |
| 728 | |
| 729 | #ifndef configUSE_MALLOC_FAILED_HOOK |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 730 | #define configUSE_MALLOC_FAILED_HOOK 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 731 | #endif |
| 732 | |
| 733 | #ifndef portPRIVILEGE_BIT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 734 | #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 735 | #endif |
| 736 | |
| 737 | #ifndef portYIELD_WITHIN_API |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 738 | #define portYIELD_WITHIN_API portYIELD |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 739 | #endif |
| 740 | |
| 741 | #ifndef portSUPPRESS_TICKS_AND_SLEEP |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 742 | #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 743 | #endif |
| 744 | |
| 745 | #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 746 | #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 747 | #endif |
| 748 | |
| 749 | #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 750 | #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 751 | #endif |
| 752 | |
| 753 | #ifndef configUSE_TICKLESS_IDLE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 754 | #define configUSE_TICKLESS_IDLE 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 755 | #endif |
| 756 | |
| 757 | #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 758 | #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 759 | #endif |
| 760 | |
| 761 | #ifndef configPRE_SLEEP_PROCESSING |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 762 | #define configPRE_SLEEP_PROCESSING( x ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 763 | #endif |
| 764 | |
| 765 | #ifndef configPOST_SLEEP_PROCESSING |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 766 | #define configPOST_SLEEP_PROCESSING( x ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 767 | #endif |
| 768 | |
| 769 | #ifndef configUSE_QUEUE_SETS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 770 | #define configUSE_QUEUE_SETS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 771 | #endif |
| 772 | |
| 773 | #ifndef portTASK_USES_FLOATING_POINT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 774 | #define portTASK_USES_FLOATING_POINT() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 775 | #endif |
| 776 | |
| 777 | #ifndef portALLOCATE_SECURE_CONTEXT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 778 | #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 779 | #endif |
| 780 | |
| 781 | #ifndef portDONT_DISCARD |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 782 | #define portDONT_DISCARD |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 783 | #endif |
| 784 | |
| 785 | #ifndef configUSE_TIME_SLICING |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 786 | #define configUSE_TIME_SLICING 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 787 | #endif |
| 788 | |
| 789 | #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 790 | #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 791 | #endif |
| 792 | |
| 793 | #ifndef configUSE_STATS_FORMATTING_FUNCTIONS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 794 | #define configUSE_STATS_FORMATTING_FUNCTIONS 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 795 | #endif |
| 796 | |
| 797 | #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 798 | #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 799 | #endif |
| 800 | |
| 801 | #ifndef configUSE_TRACE_FACILITY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 802 | #define configUSE_TRACE_FACILITY 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 803 | #endif |
| 804 | |
| 805 | #ifndef mtCOVERAGE_TEST_MARKER |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 806 | #define mtCOVERAGE_TEST_MARKER() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 807 | #endif |
| 808 | |
| 809 | #ifndef mtCOVERAGE_TEST_DELAY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 810 | #define mtCOVERAGE_TEST_DELAY() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 811 | #endif |
| 812 | |
| 813 | #ifndef portASSERT_IF_IN_ISR |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 814 | #define portASSERT_IF_IN_ISR() |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 815 | #endif |
| 816 | |
| 817 | #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 818 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 819 | #endif |
| 820 | |
| 821 | #ifndef configAPPLICATION_ALLOCATED_HEAP |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 822 | #define configAPPLICATION_ALLOCATED_HEAP 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 823 | #endif |
| 824 | |
| 825 | #ifndef configUSE_TASK_NOTIFICATIONS |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 826 | #define configUSE_TASK_NOTIFICATIONS 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 827 | #endif |
| 828 | |
| 829 | #ifndef configUSE_POSIX_ERRNO |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 830 | #define configUSE_POSIX_ERRNO 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 831 | #endif |
| 832 | |
| 833 | #ifndef portTICK_TYPE_IS_ATOMIC |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 834 | #define portTICK_TYPE_IS_ATOMIC 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 835 | #endif |
| 836 | |
| 837 | #ifndef configSUPPORT_STATIC_ALLOCATION |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 838 | /* Defaults to 0 for backward compatibility. */ |
| 839 | #define configSUPPORT_STATIC_ALLOCATION 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 840 | #endif |
| 841 | |
| 842 | #ifndef configSUPPORT_DYNAMIC_ALLOCATION |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 843 | /* Defaults to 1 for backward compatibility. */ |
| 844 | #define configSUPPORT_DYNAMIC_ALLOCATION 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 845 | #endif |
| 846 | |
| 847 | #ifndef configSTACK_DEPTH_TYPE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 848 | /* Defaults to uint16_t for backward compatibility, but can be overridden |
| 849 | in FreeRTOSConfig.h if uint16_t is too restrictive. */ |
| 850 | #define configSTACK_DEPTH_TYPE uint16_t |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 851 | #endif |
| 852 | |
| 853 | #ifndef configMESSAGE_BUFFER_LENGTH_TYPE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 854 | /* Defaults to size_t for backward compatibility, but can be overridden |
| 855 | in FreeRTOSConfig.h if lengths will always be less than the number of bytes |
| 856 | in a size_t. */ |
| 857 | #define configMESSAGE_BUFFER_LENGTH_TYPE size_t |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 858 | #endif |
| 859 | |
| 860 | /* Sanity check the configuration. */ |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 861 | #if( configUSE_TICKLESS_IDLE != 0 ) |
| 862 | #if( INCLUDE_vTaskSuspend != 1 ) |
| 863 | #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0 |
| 864 | #endif /* INCLUDE_vTaskSuspend */ |
| 865 | #endif /* configUSE_TICKLESS_IDLE */ |
| 866 | |
| 867 | #if( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) ) |
| 868 | #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 869 | #endif |
| 870 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 871 | #if( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) ) |
| 872 | #error configUSE_MUTEXES must be set to 1 to use recursive mutexes |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 873 | #endif |
| 874 | |
| 875 | #ifndef configINITIAL_TICK_COUNT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 876 | #define configINITIAL_TICK_COUNT 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 877 | #endif |
| 878 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 879 | #if( portTICK_TYPE_IS_ATOMIC == 0 ) |
| 880 | /* Either variables of tick type cannot be read atomically, or |
| 881 | portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when |
| 882 | the tick count is returned to the standard critical section macros. */ |
| 883 | #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL() |
| 884 | #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL() |
| 885 | #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR() |
| 886 | #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 887 | #else |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 888 | /* The tick type can be read atomically, so critical sections used when the |
| 889 | tick count is returned can be defined away. */ |
| 890 | #define portTICK_TYPE_ENTER_CRITICAL() |
| 891 | #define portTICK_TYPE_EXIT_CRITICAL() |
| 892 | #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0 |
| 893 | #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x |
| 894 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 895 | |
| 896 | /* Definitions to allow backward compatibility with FreeRTOS versions prior to |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 897 | V8 if desired. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 898 | #ifndef configENABLE_BACKWARD_COMPATIBILITY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 899 | #define configENABLE_BACKWARD_COMPATIBILITY 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 900 | #endif |
| 901 | |
| 902 | #ifndef configPRINTF |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 903 | /* configPRINTF() was not defined, so define it away to nothing. To use |
| 904 | configPRINTF() then define it as follows (where MyPrintFunction() is |
| 905 | provided by the application writer): |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 906 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 907 | void MyPrintFunction(const char *pcFormat, ... ); |
| 908 | #define configPRINTF( X ) MyPrintFunction X |
| 909 | |
| 910 | Then call like a standard printf() function, but placing brackets around |
| 911 | all parameters so they are passed as a single parameter. For example: |
| 912 | configPRINTF( ("Value = %d", MyVariable) ); */ |
| 913 | #define configPRINTF( X ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 914 | #endif |
| 915 | |
| 916 | #ifndef configMAX |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 917 | /* The application writer has not provided their own MAX macro, so define |
| 918 | the following generic implementation. */ |
| 919 | #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 920 | #endif |
| 921 | |
| 922 | #ifndef configMIN |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 923 | /* The application writer has not provided their own MAX macro, so define |
| 924 | the following generic implementation. */ |
| 925 | #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 926 | #endif |
| 927 | |
| 928 | #if configENABLE_BACKWARD_COMPATIBILITY == 1 |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 929 | #define eTaskStateGet eTaskGetState |
| 930 | #define portTickType TickType_t |
| 931 | #define xTaskHandle TaskHandle_t |
| 932 | #define xQueueHandle QueueHandle_t |
| 933 | #define xSemaphoreHandle SemaphoreHandle_t |
| 934 | #define xQueueSetHandle QueueSetHandle_t |
| 935 | #define xQueueSetMemberHandle QueueSetMemberHandle_t |
| 936 | #define xTimeOutType TimeOut_t |
| 937 | #define xMemoryRegion MemoryRegion_t |
| 938 | #define xTaskParameters TaskParameters_t |
| 939 | #define xTaskStatusType TaskStatus_t |
| 940 | #define xTimerHandle TimerHandle_t |
| 941 | #define xCoRoutineHandle CoRoutineHandle_t |
| 942 | #define pdTASK_HOOK_CODE TaskHookFunction_t |
| 943 | #define portTICK_RATE_MS portTICK_PERIOD_MS |
| 944 | #define pcTaskGetTaskName pcTaskGetName |
| 945 | #define pcTimerGetTimerName pcTimerGetName |
| 946 | #define pcQueueGetQueueName pcQueueGetName |
| 947 | #define vTaskGetTaskInfo vTaskGetInfo |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 948 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 949 | /* Backward compatibility within the scheduler code only - these definitions |
| 950 | are not really required but are included for completeness. */ |
| 951 | #define tmrTIMER_CALLBACK TimerCallbackFunction_t |
| 952 | #define pdTASK_CODE TaskFunction_t |
| 953 | #define xListItem ListItem_t |
| 954 | #define xList List_t |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 955 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 956 | /* For libraries that break the list data hiding, and access list structure |
| 957 | members directly (which is not supposed to be done). */ |
| 958 | #define pxContainer pvContainer |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 959 | #endif /* configENABLE_BACKWARD_COMPATIBILITY */ |
| 960 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 961 | #if( configUSE_ALTERNATIVE_API != 0 ) |
| 962 | #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 963 | #endif |
| 964 | |
| 965 | /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 966 | if floating point hardware is otherwise supported by the FreeRTOS port in use. |
| 967 | This constant is not supported by all FreeRTOS ports that include floating |
| 968 | point support. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 969 | #ifndef configUSE_TASK_FPU_SUPPORT |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 970 | #define configUSE_TASK_FPU_SUPPORT 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 971 | #endif |
| 972 | |
| 973 | /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 974 | currently used in ARMv8M ports. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 975 | #ifndef configENABLE_MPU |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 976 | #define configENABLE_MPU 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 977 | #endif |
| 978 | |
| 979 | /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 980 | currently used in ARMv8M ports. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 981 | #ifndef configENABLE_FPU |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 982 | #define configENABLE_FPU 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 983 | #endif |
| 984 | |
| 985 | /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it. |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 986 | This is currently used in ARMv8M ports. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 987 | #ifndef configENABLE_TRUSTZONE |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 988 | #define configENABLE_TRUSTZONE 1 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 989 | #endif |
| 990 | |
| 991 | /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 992 | the Secure Side only. */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 993 | #ifndef configRUN_FREERTOS_SECURE_ONLY |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 994 | #define configRUN_FREERTOS_SECURE_ONLY 0 |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 995 | #endif |
| 996 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 997 | #ifndef configUSE_TASK_START_HOOK |
| 998 | #define configUSE_TASK_START_HOOK 0 |
Xiaohu.Huang | 2c96ef4 | 2021-10-15 16:12:27 +0800 | [diff] [blame] | 999 | #endif |
| 1000 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1001 | #ifndef portGetDspHeartBeat |
| 1002 | #define portGetDspHeartBeat() 0 |
| 1003 | #endif |
Xiaohu.Huang | 2c96ef4 | 2021-10-15 16:12:27 +0800 | [diff] [blame] | 1004 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1005 | /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using |
| 1006 | * dynamically allocated RAM, in which case when any task is deleted it is known |
| 1007 | * that both the task's stack and TCB need to be freed. Sometimes the |
| 1008 | * FreeRTOSConfig.h settings only allow a task to be created using statically |
| 1009 | * allocated RAM, in which case when any task is deleted it is known that neither |
| 1010 | * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h |
| 1011 | * settings allow a task to be created using either statically or dynamically |
| 1012 | * allocated RAM, in which case a member of the TCB is used to record whether the |
| 1013 | * stack and/or TCB were allocated statically or dynamically, so when a task is |
| 1014 | * deleted the RAM that was allocated dynamically is freed again and no attempt is |
| 1015 | * made to free the RAM that was allocated statically. |
| 1016 | * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a |
| 1017 | * task to be created using either statically or dynamically allocated RAM. Note |
| 1018 | * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with |
| 1019 | * a statically allocated stack and a dynamically allocated TCB. |
| 1020 | * |
| 1021 | * The following table lists various combinations of portUSING_MPU_WRAPPERS, |
| 1022 | * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and |
| 1023 | * when it is possible to have both static and dynamic allocation: |
| 1024 | * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ |
| 1025 | * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free | |
| 1026 | * | | | | | | Static Possible | | |
| 1027 | * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ |
| 1028 | * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No | |
| 1029 | * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| |
| 1030 | * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes | |
| 1031 | * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| |
| 1032 | * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes | |
| 1033 | * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | | |
| 1034 | * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| |
| 1035 | * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No | |
| 1036 | * | | | | xTaskCreateRestrictedStatic | | | | |
| 1037 | * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| |
| 1038 | * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes | |
| 1039 | * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | | |
| 1040 | * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| |
| 1041 | * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes | |
| 1042 | * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | | |
| 1043 | * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | | |
| 1044 | * | | | | xTaskCreateRestrictedStatic | | | | |
| 1045 | * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ |
| 1046 | */ |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1047 | #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \ |
| 1048 | ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) ) |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1049 | |
| 1050 | /* |
| 1051 | * In line with software engineering best practice, FreeRTOS implements a strict |
| 1052 | * data hiding policy, so the real structures used by FreeRTOS to maintain the |
| 1053 | * state of tasks, queues, semaphores, etc. are not accessible to the application |
| 1054 | * code. However, if the application writer wants to statically allocate such |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1055 | * an object then the size of the object needs to be know. Dummy structures |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1056 | * that are guaranteed to have the same size and alignment requirements of the |
| 1057 | * real objects are used for this purpose. The dummy list and list item |
| 1058 | * structures below are used for inclusion in such a dummy structure. |
| 1059 | */ |
| 1060 | struct xSTATIC_LIST_ITEM |
| 1061 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1062 | #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) |
| 1063 | TickType_t xDummy1; |
| 1064 | #endif |
| 1065 | TickType_t xDummy2; |
| 1066 | void *pvDummy3[ 4 ]; |
| 1067 | #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) |
| 1068 | TickType_t xDummy4; |
| 1069 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1070 | }; |
| 1071 | typedef struct xSTATIC_LIST_ITEM StaticListItem_t; |
| 1072 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1073 | /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ |
| 1074 | struct xSTATIC_MINI_LIST_ITEM |
| 1075 | { |
| 1076 | #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) |
| 1077 | TickType_t xDummy1; |
| 1078 | #endif |
| 1079 | TickType_t xDummy2; |
| 1080 | void *pvDummy3[ 2 ]; |
| 1081 | }; |
| 1082 | typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1083 | |
| 1084 | /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ |
| 1085 | typedef struct xSTATIC_LIST |
| 1086 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1087 | #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) |
| 1088 | TickType_t xDummy1; |
| 1089 | #endif |
| 1090 | UBaseType_t uxDummy2; |
| 1091 | void *pvDummy3; |
| 1092 | StaticMiniListItem_t xDummy4; |
| 1093 | #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) |
| 1094 | TickType_t xDummy5; |
| 1095 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1096 | } StaticList_t; |
| 1097 | |
| 1098 | /* |
| 1099 | * In line with software engineering best practice, especially when supplying a |
| 1100 | * library that is likely to change in future versions, FreeRTOS implements a |
| 1101 | * strict data hiding policy. This means the Task structure used internally by |
| 1102 | * FreeRTOS is not accessible to application code. However, if the application |
| 1103 | * writer wants to statically allocate the memory required to create a task then |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1104 | * the size of the task object needs to be know. The StaticTask_t structure |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1105 | * below is provided for this purpose. Its sizes and alignment requirements are |
| 1106 | * guaranteed to match those of the genuine structure, no matter which |
| 1107 | * architecture is being used, and no matter how the values in FreeRTOSConfig.h |
| 1108 | * are set. Its contents are somewhat obfuscated in the hope users will |
| 1109 | * recognise that it would be unwise to make direct use of the structure members. |
| 1110 | */ |
| 1111 | typedef struct xSTATIC_TCB |
| 1112 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1113 | void *pxDummy1; |
| 1114 | #if ( portUSING_MPU_WRAPPERS == 1 ) |
| 1115 | xMPU_SETTINGS xDummy2; |
| 1116 | #endif |
| 1117 | StaticListItem_t xDummy3[ 2 ]; |
| 1118 | UBaseType_t uxDummy5; |
| 1119 | void *pxDummy6; |
| 1120 | UBaseType_t uxDummyStackDepth; |
| 1121 | uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ]; |
| 1122 | #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) ) |
| 1123 | void *pxDummy8; |
| 1124 | #endif |
| 1125 | #if ( portCRITICAL_NESTING_IN_TCB == 1 ) |
| 1126 | UBaseType_t uxDummy9; |
| 1127 | #endif |
| 1128 | #if ( configUSE_TRACE_FACILITY == 1 ) |
| 1129 | UBaseType_t uxDummy10[ 2 ]; |
| 1130 | #endif |
| 1131 | #if ( configUSE_MUTEXES == 1 ) |
| 1132 | UBaseType_t uxDummy12[ 2 ]; |
| 1133 | #endif |
| 1134 | #if ( configUSE_APPLICATION_TASK_TAG == 1 ) |
| 1135 | void *pxDummy14; |
| 1136 | #endif |
| 1137 | #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) |
| 1138 | void *pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ]; |
| 1139 | #endif |
| 1140 | #if ( configGENERATE_RUN_TIME_STATS == 1 ) |
| 1141 | uint32_t ulDummy16; |
| 1142 | #endif |
| 1143 | #if ( configUSE_NEWLIB_REENTRANT == 1 ) |
| 1144 | struct _reent xDummy17; |
| 1145 | #endif |
| 1146 | #if ( configUSE_TASK_NOTIFICATIONS == 1 ) |
| 1147 | uint32_t ulDummy18; |
| 1148 | uint8_t ucDummy19; |
| 1149 | #endif |
| 1150 | #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) |
| 1151 | uint8_t uxDummy20; |
| 1152 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1153 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1154 | #if( INCLUDE_xTaskAbortDelay == 1 ) |
| 1155 | uint8_t ucDummy21; |
| 1156 | #endif |
| 1157 | #if ( configUSE_POSIX_ERRNO == 1 ) |
| 1158 | int iDummy22; |
| 1159 | #endif |
| 1160 | #if ( configUSE_TASK_START_HOOK == 1 ) |
| 1161 | void *pxDummy23[2]; |
| 1162 | #endif |
| 1163 | #if ENABLE_KASAN |
| 1164 | int iDummy24; |
| 1165 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1166 | } StaticTask_t; |
| 1167 | |
| 1168 | /* |
| 1169 | * In line with software engineering best practice, especially when supplying a |
| 1170 | * library that is likely to change in future versions, FreeRTOS implements a |
| 1171 | * strict data hiding policy. This means the Queue structure used internally by |
| 1172 | * FreeRTOS is not accessible to application code. However, if the application |
| 1173 | * writer wants to statically allocate the memory required to create a queue |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1174 | * then the size of the queue object needs to be know. The StaticQueue_t |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1175 | * structure below is provided for this purpose. Its sizes and alignment |
| 1176 | * requirements are guaranteed to match those of the genuine structure, no |
| 1177 | * matter which architecture is being used, and no matter how the values in |
| 1178 | * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope |
| 1179 | * users will recognise that it would be unwise to make direct use of the |
| 1180 | * structure members. |
| 1181 | */ |
| 1182 | typedef struct xSTATIC_QUEUE |
| 1183 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1184 | void *pvDummy1[ 3 ]; |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1185 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1186 | union |
| 1187 | { |
| 1188 | void *pvDummy2; |
| 1189 | UBaseType_t uxDummy2; |
| 1190 | } u; |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1191 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1192 | StaticList_t xDummy3[ 2 ]; |
| 1193 | UBaseType_t uxDummy4[ 3 ]; |
| 1194 | uint8_t ucDummy5[ 2 ]; |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1195 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1196 | #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) |
| 1197 | uint8_t ucDummy6; |
| 1198 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1199 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1200 | #if ( configUSE_QUEUE_SETS == 1 ) |
| 1201 | void *pvDummy7; |
| 1202 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1203 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1204 | #if ( configUSE_TRACE_FACILITY == 1 ) |
| 1205 | UBaseType_t uxDummy8; |
| 1206 | uint8_t ucDummy9; |
| 1207 | #endif |
| 1208 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1209 | } StaticQueue_t; |
| 1210 | typedef StaticQueue_t StaticSemaphore_t; |
| 1211 | |
| 1212 | /* |
| 1213 | * In line with software engineering best practice, especially when supplying a |
| 1214 | * library that is likely to change in future versions, FreeRTOS implements a |
| 1215 | * strict data hiding policy. This means the event group structure used |
| 1216 | * internally by FreeRTOS is not accessible to application code. However, if |
| 1217 | * the application writer wants to statically allocate the memory required to |
| 1218 | * create an event group then the size of the event group object needs to be |
| 1219 | * know. The StaticEventGroup_t structure below is provided for this purpose. |
| 1220 | * Its sizes and alignment requirements are guaranteed to match those of the |
| 1221 | * genuine structure, no matter which architecture is being used, and no matter |
| 1222 | * how the values in FreeRTOSConfig.h are set. Its contents are somewhat |
| 1223 | * obfuscated in the hope users will recognise that it would be unwise to make |
| 1224 | * direct use of the structure members. |
| 1225 | */ |
| 1226 | typedef struct xSTATIC_EVENT_GROUP |
| 1227 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1228 | TickType_t xDummy1; |
| 1229 | StaticList_t xDummy2; |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1230 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1231 | #if( configUSE_TRACE_FACILITY == 1 ) |
| 1232 | UBaseType_t uxDummy3; |
| 1233 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1234 | |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1235 | #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) |
| 1236 | uint8_t ucDummy4; |
| 1237 | #endif |
| 1238 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1239 | } StaticEventGroup_t; |
| 1240 | |
| 1241 | /* |
| 1242 | * In line with software engineering best practice, especially when supplying a |
| 1243 | * library that is likely to change in future versions, FreeRTOS implements a |
| 1244 | * strict data hiding policy. This means the software timer structure used |
| 1245 | * internally by FreeRTOS is not accessible to application code. However, if |
| 1246 | * the application writer wants to statically allocate the memory required to |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1247 | * create a software timer then the size of the queue object needs to be know. |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1248 | * The StaticTimer_t structure below is provided for this purpose. Its sizes |
| 1249 | * and alignment requirements are guaranteed to match those of the genuine |
| 1250 | * structure, no matter which architecture is being used, and no matter how the |
| 1251 | * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in |
| 1252 | * the hope users will recognise that it would be unwise to make direct use of |
| 1253 | * the structure members. |
| 1254 | */ |
| 1255 | typedef struct xSTATIC_TIMER |
| 1256 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1257 | void *pvDummy1; |
| 1258 | StaticListItem_t xDummy2; |
| 1259 | TickType_t xDummy3; |
| 1260 | void *pvDummy5; |
| 1261 | TaskFunction_t pvDummy6; |
| 1262 | #if( configUSE_TRACE_FACILITY == 1 ) |
| 1263 | UBaseType_t uxDummy7; |
| 1264 | #endif |
| 1265 | uint8_t ucDummy8; |
| 1266 | |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1267 | } StaticTimer_t; |
| 1268 | |
| 1269 | /* |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1270 | * In line with software engineering best practice, especially when supplying a |
| 1271 | * library that is likely to change in future versions, FreeRTOS implements a |
| 1272 | * strict data hiding policy. This means the stream buffer structure used |
| 1273 | * internally by FreeRTOS is not accessible to application code. However, if |
| 1274 | * the application writer wants to statically allocate the memory required to |
| 1275 | * create a stream buffer then the size of the stream buffer object needs to be |
| 1276 | * know. The StaticStreamBuffer_t structure below is provided for this purpose. |
| 1277 | * Its size and alignment requirements are guaranteed to match those of the |
| 1278 | * genuine structure, no matter which architecture is being used, and no matter |
| 1279 | * how the values in FreeRTOSConfig.h are set. Its contents are somewhat |
| 1280 | * obfuscated in the hope users will recognise that it would be unwise to make |
| 1281 | * direct use of the structure members. |
| 1282 | */ |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1283 | typedef struct xSTATIC_STREAM_BUFFER |
| 1284 | { |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1285 | size_t uxDummy1[ 4 ]; |
| 1286 | void * pvDummy2[ 3 ]; |
| 1287 | uint8_t ucDummy3; |
| 1288 | #if ( configUSE_TRACE_FACILITY == 1 ) |
| 1289 | UBaseType_t uxDummy4; |
| 1290 | #endif |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1291 | } StaticStreamBuffer_t; |
| 1292 | |
| 1293 | /* Message buffers are built on stream buffers. */ |
| 1294 | typedef StaticStreamBuffer_t StaticMessageBuffer_t; |
| 1295 | |
| 1296 | #ifdef __cplusplus |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1297 | } |
kelvin.zhang | 57fb6ae | 2021-10-15 10:19:42 +0800 | [diff] [blame] | 1298 | #endif |
| 1299 | |
| 1300 | #endif /* INC_FREERTOS_H */ |
xiaohu.huang | 4f321fb | 2024-03-22 14:50:29 +0800 | [diff] [blame] | 1301 | |