00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef INC_FREERTOS_H
00055 #define INC_FREERTOS_H
00056
00057
00058
00059
00060
00061 #include <stddef.h>
00062
00063
00064 #include "projdefs.h"
00065
00066
00067 #include "FreeRTOSConfig.h"
00068
00069
00070 #include "portable.h"
00071
00072
00073
00074
00075 typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #ifndef configUSE_PREEMPTION
00088 #error Missing definition: configUSE_PREEMPTION should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00089 #endif
00090
00091 #ifndef configUSE_IDLE_HOOK
00092 #error Missing definition: configUSE_IDLE_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00093 #endif
00094
00095 #ifndef configUSE_TICK_HOOK
00096 #error Missing definition: configUSE_TICK_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00097 #endif
00098
00099 #ifndef configUSE_CO_ROUTINES
00100 #error Missing definition: configUSE_CO_ROUTINES should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00101 #endif
00102
00103 #ifndef INCLUDE_vTaskPrioritySet
00104 #error Missing definition: INCLUDE_vTaskPrioritySet should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00105 #endif
00106
00107 #ifndef INCLUDE_uxTaskPriorityGet
00108 #error Missing definition: INCLUDE_uxTaskPriorityGet should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00109 #endif
00110
00111 #ifndef INCLUDE_vTaskDelete
00112 #error Missing definition: INCLUDE_vTaskDelete should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00113 #endif
00114
00115 #ifndef INCLUDE_vTaskCleanUpResources
00116 #error Missing definition: INCLUDE_vTaskCleanUpResources should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00117 #endif
00118
00119 #ifndef INCLUDE_vTaskSuspend
00120 #error Missing definition: INCLUDE_vTaskSuspend should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00121 #endif
00122
00123 #ifndef INCLUDE_vTaskDelayUntil
00124 #error Missing definition: INCLUDE_vTaskDelayUntil should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00125 #endif
00126
00127 #ifndef INCLUDE_vTaskDelay
00128 #error Missing definition: INCLUDE_vTaskDelay should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00129 #endif
00130
00131 #ifndef configUSE_16_BIT_TICKS
00132 #error Missing definition: configUSE_16_BIT_TICKS should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
00133 #endif
00134
00135 #ifndef configUSE_APPLICATION_TASK_TAG
00136 #define configUSE_APPLICATION_TASK_TAG 0
00137 #endif
00138
00139 #ifndef INCLUDE_uxTaskGetStackHighWaterMark
00140 #define INCLUDE_uxTaskGetStackHighWaterMark 0
00141 #endif
00142
00143 #ifndef configUSE_RECURSIVE_MUTEXES
00144 #define configUSE_RECURSIVE_MUTEXES 0
00145 #endif
00146
00147 #ifndef configUSE_MUTEXES
00148 #define configUSE_MUTEXES 0
00149 #endif
00150
00151 #ifndef configUSE_COUNTING_SEMAPHORES
00152 #define configUSE_COUNTING_SEMAPHORES 0
00153 #endif
00154
00155 #ifndef configUSE_ALTERNATIVE_API
00156 #define configUSE_ALTERNATIVE_API 0
00157 #endif
00158
00159 #ifndef portCRITICAL_NESTING_IN_TCB
00160 #define portCRITICAL_NESTING_IN_TCB 0
00161 #endif
00162
00163 #ifndef configMAX_TASK_NAME_LEN
00164 #define configMAX_TASK_NAME_LEN 16
00165 #endif
00166
00167 #ifndef configIDLE_SHOULD_YIELD
00168 #define configIDLE_SHOULD_YIELD 1
00169 #endif
00170
00171 #if configMAX_TASK_NAME_LEN < 1
00172 #undef configMAX_TASK_NAME_LEN
00173 #define configMAX_TASK_NAME_LEN 1
00174 #endif
00175
00176 #ifndef INCLUDE_xTaskResumeFromISR
00177 #define INCLUDE_xTaskResumeFromISR 1
00178 #endif
00179
00180 #ifndef INCLUDE_xTaskGetSchedulerState
00181 #define INCLUDE_xTaskGetSchedulerState 0
00182 #endif
00183
00184 #if ( configUSE_MUTEXES == 1 )
00185
00186
00187 #undef INCLUDE_xTaskGetCurrentTaskHandle
00188 #define INCLUDE_xTaskGetCurrentTaskHandle 1
00189 #else
00190 #ifndef INCLUDE_xTaskGetCurrentTaskHandle
00191 #define INCLUDE_xTaskGetCurrentTaskHandle 0
00192 #endif
00193 #endif
00194
00195
00196 #ifndef portSET_INTERRUPT_MASK_FROM_ISR
00197 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
00198 #endif
00199
00200 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
00201 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
00202 #endif
00203
00204
00205 #ifndef configQUEUE_REGISTRY_SIZE
00206 #define configQUEUE_REGISTRY_SIZE 0
00207 #endif
00208
00209 #if configQUEUE_REGISTRY_SIZE < 1
00210 #define configQUEUE_REGISTRY_SIZE 0
00211 #define vQueueAddToRegistry( xQueue, pcName )
00212 #define vQueueUnregisterQueue( xQueue )
00213 #endif
00214
00215
00216
00217 #ifndef traceSTART
00218
00219
00220 #define traceSTART()
00221 #endif
00222
00223 #ifndef traceEND
00224
00225
00226 #define traceEND()
00227 #endif
00228
00229 #ifndef traceTASK_SWITCHED_IN
00230
00231
00232 #define traceTASK_SWITCHED_IN()
00233 #endif
00234
00235 #ifndef traceTASK_SWITCHED_OUT
00236
00237
00238 #define traceTASK_SWITCHED_OUT()
00239 #endif
00240
00241 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
00242
00243
00244
00245
00246 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
00247 #endif
00248
00249 #ifndef traceBLOCKING_ON_QUEUE_SEND
00250
00251
00252
00253
00254 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
00255 #endif
00256
00257 #ifndef configCHECK_FOR_STACK_OVERFLOW
00258 #define configCHECK_FOR_STACK_OVERFLOW 0
00259 #endif
00260
00261
00262
00263 #ifndef traceQUEUE_CREATE
00264 #define traceQUEUE_CREATE( pxNewQueue )
00265 #endif
00266
00267 #ifndef traceQUEUE_CREATE_FAILED
00268 #define traceQUEUE_CREATE_FAILED()
00269 #endif
00270
00271 #ifndef traceCREATE_MUTEX
00272 #define traceCREATE_MUTEX( pxNewQueue )
00273 #endif
00274
00275 #ifndef traceCREATE_MUTEX_FAILED
00276 #define traceCREATE_MUTEX_FAILED()
00277 #endif
00278
00279 #ifndef traceGIVE_MUTEX_RECURSIVE
00280 #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
00281 #endif
00282
00283 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
00284 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
00285 #endif
00286
00287 #ifndef traceTAKE_MUTEX_RECURSIVE
00288 #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
00289 #endif
00290
00291 #ifndef traceCREATE_COUNTING_SEMAPHORE
00292 #define traceCREATE_COUNTING_SEMAPHORE()
00293 #endif
00294
00295 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
00296 #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
00297 #endif
00298
00299 #ifndef traceQUEUE_SEND
00300 #define traceQUEUE_SEND( pxQueue )
00301 #endif
00302
00303 #ifndef traceQUEUE_SEND_FAILED
00304 #define traceQUEUE_SEND_FAILED( pxQueue )
00305 #endif
00306
00307 #ifndef traceQUEUE_RECEIVE
00308 #define traceQUEUE_RECEIVE( pxQueue )
00309 #endif
00310
00311 #ifndef traceQUEUE_PEEK
00312 #define traceQUEUE_PEEK( pxQueue )
00313 #endif
00314
00315 #ifndef traceQUEUE_RECEIVE_FAILED
00316 #define traceQUEUE_RECEIVE_FAILED( pxQueue )
00317 #endif
00318
00319 #ifndef traceQUEUE_SEND_FROM_ISR
00320 #define traceQUEUE_SEND_FROM_ISR( pxQueue )
00321 #endif
00322
00323 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
00324 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
00325 #endif
00326
00327 #ifndef traceQUEUE_RECEIVE_FROM_ISR
00328 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
00329 #endif
00330
00331 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
00332 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
00333 #endif
00334
00335 #ifndef traceQUEUE_DELETE
00336 #define traceQUEUE_DELETE( pxQueue )
00337 #endif
00338
00339 #ifndef traceTASK_CREATE
00340 #define traceTASK_CREATE( pxNewTCB )
00341 #endif
00342
00343 #ifndef traceTASK_CREATE_FAILED
00344 #define traceTASK_CREATE_FAILED( pxNewTCB )
00345 #endif
00346
00347 #ifndef traceTASK_DELETE
00348 #define traceTASK_DELETE( pxTaskToDelete )
00349 #endif
00350
00351 #ifndef traceTASK_DELAY_UNTIL
00352 #define traceTASK_DELAY_UNTIL()
00353 #endif
00354
00355 #ifndef traceTASK_DELAY
00356 #define traceTASK_DELAY()
00357 #endif
00358
00359 #ifndef traceTASK_PRIORITY_SET
00360 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
00361 #endif
00362
00363 #ifndef traceTASK_SUSPEND
00364 #define traceTASK_SUSPEND( pxTaskToSuspend )
00365 #endif
00366
00367 #ifndef traceTASK_RESUME
00368 #define traceTASK_RESUME( pxTaskToResume )
00369 #endif
00370
00371 #ifndef traceTASK_RESUME_FROM_ISR
00372 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
00373 #endif
00374
00375 #ifndef traceTASK_INCREMENT_TICK
00376 #define traceTASK_INCREMENT_TICK( xTickCount )
00377 #endif
00378
00379 #ifndef configGENERATE_RUN_TIME_STATS
00380 #define configGENERATE_RUN_TIME_STATS 0
00381 #endif
00382
00383 #if ( configGENERATE_RUN_TIME_STATS == 1 )
00384
00385 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
00386 #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.
00387 #endif
00388
00389 #ifndef portGET_RUN_TIME_COUNTER_VALUE
00390 #error If configGENERATE_RUN_TIME_STATS is defined then portGET_RUN_TIME_COUNTER_VALUE must also be defined. portGET_RUN_TIME_COUNTER_VALUE should evaluate to the counter value of the timer/counter peripheral used as the run time counter time base.
00391 #endif
00392
00393 #endif
00394
00395 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
00396 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
00397 #endif
00398
00399 #ifndef configUSE_MALLOC_FAILED_HOOK
00400 #define configUSE_MALLOC_FAILED_HOOK 0
00401 #endif
00402
00403 #ifndef portPRIVILEGE_BIT
00404 #define portPRIVILEGE_BIT ( ( unsigned portBASE_TYPE ) 0x00 )
00405 #endif
00406
00407 #ifndef portYIELD_WITHIN_API
00408 #define portYIELD_WITHIN_API portYIELD
00409 #endif
00410
00411 #ifndef pvPortMallocAligned
00412 #define pvPortMallocAligned( xSize, pvBuffer ) pvPortMalloc( xSize ); ( void ) pvBuffer
00413 #endif
00414
00415 #ifndef vPortFreeAligned
00416 #define vPortFreeAligned( pvBlockToFree ) vPortFree( pvBlockToFree )
00417 #endif
00418
00419 #endif
00420