feat(channel): 6通道独立调度+MQueue/DEBUG_Printf重构/冗余清理
通道系统: - 新增Channel_m枚举(CH_NULL/DBG/CH1/CH2/ETH/LORA/CAT1) - Much/Auch/Duch/CuchMask替代旧Comm/DebugChannel - ChannelIsActive宏四重身份检查, ChannelMQ每通道独立队列 - much/auch/duch/cuch命令(互斥检查+USART1 pair冲突) - 各通道任务按ChannelIsActive休眠/活跃 双回调分离: - SvrRegFlag->MuchRegFlag+AuchRegFlag - _NetRevCallBack+pRegFlag实现Much/Auch回调复用 MQ重构: - ChMQ[6]每通道独立队列替代NetSendData_MQ - UploadSend无条件下发Much+Auch双队列 - Cat1/ETH/RS485/Lora各自消费ChMQ 注册流程: - 注册帧绕MQ直接发送(解决FIFO顺序冲突) - NetCommOrgData输入输出buffer分离(解决重叠bug) - Much首次连上必注册, Auch跳过注册直接发送 - ETH_REG_SVR SendRetryCnt首次清零(解决无限重试) - 状态机不再清零注册标志 调试通道: - Debug_Printf->rt_kprintf->rt_hw_console_output全ch路由 - rt_hw_console_output 6通道switch - EthTxMutex保护USART4多线程安全 - ETH接收线程非0x7A帧头->DebugAnalyze(网络debug指令) - EthOverHandler阈值>5->>0(短指令接收) 冗余清理: - 删Cat1UpdateCallback/Cat1SendRegister/ETHSendRegister - 删InfTest/FSInit/SDCardTest死代码 - 删unused includes/macros/variables - 删vcom_Print/buff/ir中间层 - DEBUG_CMD_CNT实际对齐 - 中文标点修正 - 默认: Much=ETH Auch=null Duch=ETH Cuch=LORA
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <rtthread.h>
|
||||
#include "bsp.h"
|
||||
#include "main.h"
|
||||
#include "sx127x.h"
|
||||
|
||||
extern GateWayPara_t GateWay;
|
||||
|
||||
@@ -20,7 +21,7 @@ extern GateWayPara_t GateWay;
|
||||
* Please modify RT_HEAP_SIZE if you enable RT_USING_HEAP
|
||||
* the RT_HEAP_SIZE max value = (sram size - ZI size), 1024 means 1024 bytes
|
||||
*/
|
||||
#define RT_HEAP_SIZE (32*1024)
|
||||
#define RT_HEAP_SIZE (48*1024)
|
||||
static rt_uint8_t rt_heap[RT_HEAP_SIZE];
|
||||
|
||||
RT_WEAK void *rt_heap_begin_get(void)
|
||||
@@ -85,14 +86,14 @@ INIT_BOARD_EXPORT(uart_init);
|
||||
void rt_hw_console_output(const char *str)
|
||||
{
|
||||
rt_enter_critical();
|
||||
if(GateWay.ConfigPara.DebugChannel == DEBUG_CH_RS485_1) {
|
||||
RS485Ch1UartSend((uint8_t *)str, strlen(str));
|
||||
}
|
||||
else if(GateWay.ConfigPara.DebugChannel == DEBUG_CH_RS485_2) {
|
||||
RS485Ch2UartSend((uint8_t *)str, strlen(str));
|
||||
}
|
||||
else {
|
||||
DebugOrCat1UartSend((uint8_t *)str, strlen(str));
|
||||
switch(GateWay.ConfigPara.Duch) {
|
||||
case CH_RS485_1: RS485Ch1UartSend((uint8_t *)str, strlen(str)); break;
|
||||
case CH_RS485_2: RS485Ch2UartSend((uint8_t *)str, strlen(str)); break;
|
||||
case CH_ETH: EthUartSend((uint8_t *)str, strlen(str)); break;
|
||||
case CH_LORA: Sx1276LoRaSendBuffer((uint8_t *)str, strlen(str)); break;
|
||||
case CH_DBG:
|
||||
case CH_CAT1:
|
||||
default: DebugOrCat1UartSend((uint8_t *)str, strlen(str)); break;
|
||||
}
|
||||
rt_exit_critical();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user