FreeRTOSconfig.h初步认识

 FreeRTOSconfig.h在移植的时候,需要从FreeRTOS提供的源文件外获取,

官方提供的DEMO中的FreeRTOSconfig.h如下,具体含义已经做了简单的注释

* See http://www.freertos.org/a00110.html
 *----------------------------------------------------------*/

#define configUSE_PREEMPTION		1//使用抢占式内核,0使用协程
#define configUSE_IDLE_HOOK		0//
#define configUSE_TICK_HOOK		0//
#define configCPU_CLOCK_HZ		( ( unsigned long ) 72000000 )//时钟	
#define configTICK_RATE_HZ		( ( TickType_t ) 500 )//任务周期
#define configMAX_PRIORITIES		( 5 )//可使用的最大优先级
#define configMINIMAL_STACK_SIZE	( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE		( ( size_t ) ( 12 * 1024 ) )//系统所有总的堆大小,即动态内存最大占用大小
#define configMAX_TASK_NAME_LEN		( 16 )//任务名最大字符串长度
#define configUSE_TRACE_FACILITY	0//可视化跟踪调试
#define configUSE_16_BIT_TICKS		0//系统节拍计数器变量数据类型,变量类型为TickType_t,
                                         //1表示为16位无符号整形,0表示为32位无符号整形
#define configIDLE_SHOULD_YIELD		1//为1时空闲任务放弃CPU使用权给其他同优先级的用户任务

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 		0//设置为1,将使用
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )//协程的有效优先级数目

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */

#define INCLUDE_vTaskPrioritySet		1//任务优先级设置
#define INCLUDE_uxTaskPriorityGet		1//任务优先级获取
#define INCLUDE_vTaskDelete			1//删除自己或其它任务
#define INCLUDE_vTaskCleanUpResources	        0//可以回收删除任务后的资源(RAM等)
#define INCLUDE_vTaskSuspend			1//任务挂起
#define INCLUDE_vTaskDelayUntil			1//精准延时
#define INCLUDE_vTaskDelay			1//延时

/* This is the raw value as per the Cortex-M3 NVIC.  Values can be 255
(lowest) to 0 (1?) (highest). */
#define configKERNEL_INTERRUPT_PRIORITY 		255//设置内核中断优先级
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 	191 /* equivalent to 0xb0, or priority 11. */
     //设置优先级,低于此优先级的中断可以安全的调用FreeRTOS 的API函数

当然FreeRTOS不仅仅是以上参数 ,详细可参考官方FreeRTOS - The Free RTOS configuration constants and configuration options - FREE Open Source RTOS for small real time embedded systemsicon-default.png?t=M85Bhttps://www.freertos.org/a00110.htmlFreeRTOSconfig.h初步认识_第1张图片

FreeRTOSconfig.h初步认识_第2张图片 

 FreeRTOSconfig.h初步认识_第3张图片

 截图如下,具体含义这里暂时不一一介绍,

这里只是初步认识一下这文件,就是设置两类参数,一个定义INCLUDE_开启该API函数功能

一个congfig设置该变量值

 

 

你可能感兴趣的:(c语言,开发语言)