解决编译错误

This commit is contained in:
2026-05-08 16:14:00 +08:00
parent 878379f101
commit 6c56fe8a60
7 changed files with 32 additions and 171 deletions

View File

@ -285,7 +285,7 @@ void CmdRouter_Init(void);
/**
* @brief 向指定端口的解析器喂入数据
* @note 由UART中断回调调用线程安全
* @param port_id: 端口ID (PORT_UART1/PORT_UART2/PORT_UART3)
* @param port_id: 端口ID (PORT_433/PORT_DEBUG/PORT_RS485)
* @param byte: 接收到的字节
* @param current_tick: 系统时间戳
* @retval 无
@ -325,9 +325,9 @@ void CmdRouter_SendResponseFmt(port_id_t port_id, const char *fmt, ...);
```c
/** 端口ID枚举 */
typedef enum {
PORT_UART1 = 0, /**< RF433模块 */
PORT_UART2 = 1, /**< 调试串口 */
PORT_UART3 = 2, /**< RS485模块 */
PORT_433 = 0, /**< RF433模块 */
PORT_DEBUG = 1, /**< 调试串口 */
PORT_RS485 = 2, /**< RS485模块 */
PORT_COUNT
} port_id_t;
@ -396,18 +396,18 @@ void CmdParser_SetResponseCallback(response_callback_t callback);
* @note 静态表根据port_id索引查找对应UART句柄
*/
static UART_HandleTypeDef* const g_port_uart_map[PORT_COUNT] = {
[PORT_UART1] = &huart1, // RF433
[PORT_UART2] = &huart2, // DEBUG
[PORT_UART3] = &huart3, // RS485
[PORT_433] = &huart1, // RF433
[PORT_DEBUG] = &huart2, // DEBUG
[PORT_RS485] = &huart3, // RS485
};
/**
* @brief 端口名称表(用于日志输出)
*/
static const char* const g_port_name_map[PORT_COUNT] = {
[PORT_UART1] = "UART1",
[PORT_UART2] = "UART2",
[PORT_UART3] = "UART3",
[PORT_433] = "UART1",
[PORT_DEBUG] = "UART2",
[PORT_RS485] = "UART3",
};
```
@ -650,9 +650,9 @@ void Configure_UART_Priorities(void)
#include "cmd_parser.h"
typedef enum {
PORT_UART1 = 0,
PORT_UART2 = 1,
PORT_UART3 = 2,
PORT_433 = 0,
PORT_DEBUG = 1,
PORT_RS485 = 2,
PORT_COUNT
} port_id_t;
@ -683,7 +683,7 @@ void MultiUART_SendString(port_id_t port_id, const char *str);
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart->Instance == USART1) {
MultiUART_FeedByte(PORT_UART1, rf433_uart_rx_tmp, HAL_GetTick());
MultiUART_FeedByte(PORT_433, rf433_uart_rx_tmp, HAL_GetTick());
HAL_UART_Receive_IT(&huart1, &rf433_uart_rx_tmp, 1);
}
// ... 其他端口保持原样 ...