Files
STM32F4-Base/App/task/rs485_task.c
2026-07-19 15:27:49 +08:00

46 lines
1.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 模块名称RS485 Communication Task
* 模块功能RS-485 轮询收发、协议帧解析与响应
* 适用平台STM32F407ZGTx
* 作者:王建锋
* 创建日期2026-07-19
* 修改记录:
* v1.0 2026-07-19 王建锋 创建初始版本
*/
#include "rs485_task.h"
#include "cmsis_os.h"
#include "rs485.h"
#define DBG_TAG "[RS485_TASK]"
#include "dbg_log.h"
/*
* 函数功能RS485 任务初始化
* 入口参数:无
* 返 回 值0 - 成功,-1 - 失败
* 限定条件UART 和 GPIO 已由 CubeMX 初始化
* 函数说明:配置 RS-485 通信参数,注册接收回调
*/
int rs485_task_init(void)
{
DBG_INFO("rs485_task_init");
return 0;
}
/*
* 函数功能RS485 任务主函数
* 入口参数arg - FreeRTOS 传入参数(未使用)
* 返 回 值:无
* 限定条件rs485_task_init() 已成功调用
* 函数说明:轮询接收缓冲区并解析协议帧
*/
void rs485_task_func(void const *arg)
{
(void)arg;
for (;;) {
osDelay(100);
}
}