移植FreeRTOS一定要修改startup

xiaoxiao2021-02-28  146

在Cortex M使用FreeRTOS时,建立工程项目,经常会应为start_xxx.s与port.c、portasm.s中的中断函数名不同困惑:是在start_xxx.s修改为:vPortSVCHandler/xPortPendSVHandler/xPortSysTickHandler?还是在port.c、portasm.s 修改为SVC_Handler/PendSV_Handler/SysTick_Handler?不管怎么样,都要修改文件,造成移植不便。

为了解决这个不便,可以在FreeRTOSConfig.h文件中增加下列几行:

/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */

#define vPortSVCHandler SVC_Handler #define xPortPendSVHandler PendSV_Handler #define xPortSysTickHandler SysTick_Handler

即修改配置文件,可避免修改芯片厂商提供的库文件和FreeRTOS移植接口文件。

转载请注明原文地址: https://www.6miu.com/read-17295.html

最新回复(0)