前言
在開始建立FreeRTOS工程專案前,都有一些固定的常規代碼操作而記錄這些代碼,這不僅能夠加速後續專案的開發,還能確保代碼品質和一致性,經過一些專案經驗,我整理出了個人常用FreeRTOS模板的建置操作。
核心模板實現
📝 1. 主程式架構 (main.c)
#include <stdio.h>
#include "FreeRTOS.h"
#include "task.h"
#include "user_task.h"
int main() {
//create start task
BaseType_t result = xTaskCreate(
(TaskFunction_t)start_task,
(const char*)"start_