FreeRTOSConfig.h 配置文件详解

目录

1 Constants that describe the hardware and memory usage

2 Constants related to the behaviour or the scheduler

3 Software timer definitions

4  Constants that build features in or out

5 Constants provided for debugging and optimisation assistance

6 Constants that define which hook (callback) functions should be used

7 Port specific configuration(该配置至对ARMv8M起作用)

8 API function config


1 Constants that describe the hardware and memory usage

configCPU_CLOCK_HZSystemCoreClockCPU时钟频率
configTICK_RATE_HZ1000Sets the tick interrupt frequency. The value is specified in Hz.
configTOTAL_HEAP_SIZE4096The kernel allocates memory from the heap each time a task, queue or semaphore is created(栈大小)
configMINIMAL_STACK_SIZE256Sets the size of the stack allocated to the Idle task.
configSUPPORT_DYNAMIC_ALLOCATION1RTOS objects can be created using  RAM  that  is  automatically  allocated  from  the  FreeRTOS  heap(动态创建对象)
configSUPPORT_STATIC_ALLOCATION0then RTOS objects can be created using RAM provided by the application writer(静态创建对象)

2 Constants related to the behaviour or the scheduler

configMAX_PRIORITIES5Sets the maximum priority that can be assigned to a task
configUSE_PREEMPTION1

1:cause the pre-emptive scheduler to be used(抢占式调度器)

0:cause the co-operative scheduler to be used(协作式调度器)

configUSE_TIME_SLICING1switch  between  tasks  of  equal  priority  on  every  RTOS  tick  interrupt( 使能时间片调度)
configIDLE_SHOULD_YIELD1空闲任务放弃 CPU 使用权给其他同优先级的用户任务
configMAX_TASK_NAME_LEN10Sets the maximum number of characters that can be used for the name of a task
configUSE_16_BIT_TICKS0

1:TickType_t is defined to be an unsigned 16-bit type

0:TickType_t is defined to be an unsigned 32-bit type

3 Software timer definitions

configUSE_TIMERS1使能软件定时器
configTIMER_TASK_PRIORITY2设置软件定时优先级
configTIMER_QUEUE_LENGTH5软件定时器队列长度
configTIMER_TASK_STACK_DEPTHconfigMINIMAL_STACK_SIZE * 2软件定时器堆栈大小

4  Constants that build features in or out

configUSE_MUTEXES              1使能互斥量
configUSE_RECURSIVE_MUTEXES1使能递归互斥量
configUSE_COUNTING_SEMAPHORES1使能信号量
configUSE_QUEUE_SETS1使能队列
configUSE_TASK_NOTIFICATIONS1使能任务通知
configUSE_TRACE_FACILITY1启用可视化跟踪调试
configUSE_TICKLESS_IDLE1使能低功耗 tickless 模式
configUSE_APPLICATION_TASK_TAG0配置是否使用任务标签
configUSE_NEWLIB_REENTRANT0配置使用Newlib库
configUSE_CO_ROUTINES0Co-routines are light weight tasks that save RAM by sharing a stack, but have limitedfunctionality

5 Constants provided for debugging and optimisation assistance

configCHECK_FOR_STACK_OVERFLOW0大于 0 时启用堆栈溢出检测功能,如果使用此功能用户必须提供一个栈溢出钩子函数,如果使用的话此值可以为 1 或者 2,因为有两种栈溢出检测方法
configQUEUE_REGISTRY_SIZE0设置可以注册的信号量和消息队列个数
configASSERT( x ) 断言

6 Constants that define which hook (callback) functions should be used

configUSE_IDLE_HOOK0空闲任务钩子函数void vApplicationIdleHook(void )
configUSE_TICK_HOOK0时间片钩子函数void vApplicationTickHook(void )
configUSE_DAEMON_TASK_STARTUP_HOOK0任务启动钩子函数
configUSE_MALLOC_FAILED_HOOK0内存分配失败钩子函数

7 Port specific configuration(该配置至对ARMv8M起作用)

configENABLE_MPU0配置是否使用MPU
configENABLE_FPU1配置是否使用FPU
configENABLE_TRUSTZONE1 
configMINIMAL_SECURE_STACK_SIZE1024 
configRUN_FREERTOS_SECURE_ONLY0 

8 API function config

#define INCLUDE_vTaskPrioritySet              1
#define INCLUDE_uxTaskPriorityGet             1
#define INCLUDE_vTaskDelete                   1
#define INCLUDE_vTaskSuspend                  1
#define INCLUDE_vTaskDelayUntil               1
#define INCLUDE_vTaskDelay                    1
#define INCLUDE_xTaskGetIdleTaskHandle        1
#define INCLUDE_xTaskAbortDelay               1
#define INCLUDE_xQueueGetMutexHolder          1
#define INCLUDE_xSemaphoreGetMutexHolder      1
#define INCLUDE_xTaskGetHandle                1
#define INCLUDE_uxTaskGetStackHighWaterMark   1
#define INCLUDE_uxTaskGetStackHighWaterMark2  1
#define INCLUDE_eTaskGetState                 1
#define INCLUDE_xTaskResumeFromISR            1
#define INCLUDE_xTimerPendFunctionCall        1
#define INCLUDE_xTaskGetSchedulerState        1
#define INCLUDE_xTaskGetCurrentTaskHandle     1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值