FreeRTOS 移植和配置
1.配置
FreeRTOSConfig.h文件是对整个FreeRTOS所需功能的宏做了定义,先来了解该宏的所有定义:
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/* Ensure stdint is only used by the compiler, and not the assembler. */
#ifdef __ICCARM__|| defined(__CC_ARM) || defined(__GNUC__)
#include <stdint.h>
extern uint32_t SystemCoreClock;
#endif
#define configUSE_PREEMPTION 1 //置1抢占式调度,置0时间片调度
#define configUSE_IDLE_HOOK 1 //空闲钩子函数,先置0
#define configUSE_TICK_HOOK 1 //时间片钩子函数,先置0
#define configCPU_CLOCK_HZ ( SystemCoreClock ) //CPU内核时钟频率
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) //系统节拍中断频率,中断进行任务调度
#define configMAX_PRIORITIES ( 5 ) //可使用最大优先级
#