chore: 源码编码GB2312统一转换为UTF-8

25个含有中文注释的.c/.h文件编码格式从GB2312转为UTF-8(无BOM)。中文字符从2字节编码变为3字节编码,注释内容保持不变。
This commit is contained in:
2026-07-20 14:27:37 +08:00
parent 26e48126c8
commit d08ca726df
24 changed files with 968 additions and 968 deletions
+58 -58
View File
@@ -17,13 +17,13 @@ SensorCommPara_t SComm2Para;
const uint8_t RS485SensorCmdPayLoadLen[RS485_SENSOR_CMD_END] = {0, 0, 0, 1, 0};
/*****************************************************************************************
* 函数名称: SavSensorData
* 功能描述: 记录传感器数据
* 参 数: SensorIdx, 传感器序号
Para,传感器结构指针
Data, 传感器数据
Len, 传感器数据长度
* 返 回 值: 无
* 函数名称: SavSensorData
* 功能描述: 记录传感器数据
* 参 数: SensorIdx, 传感器序号
Para,传感器结构指针
Data, 传感器数据
Len, 传感器数据长度
* 返 回 值: 无
*****************************************************************************************/
static void SavSensorData(uint8_t SensorIdx, CommUnitData CUData, uint8_t *Data, uint8_t Len)
{
@@ -36,13 +36,13 @@ static void SavSensorData(uint8_t SensorIdx, CommUnitData CUData, uint8_t *Data,
}
/*****************************************************************************************
* 函数名称: RS485Analyze
* 功能描述: 485数据解析
* 参 数: SCPara, 传感器发送参数
Para, 传感器结构指针
rData, 传感器数据入口
rLen, 传感器数据长度
* 返 回 值: 无
* 函数名称: RS485Analyze
* 功能描述: 485数据解析
* 参 数: SCPara, 传感器发送参数
Para, 传感器结构指针
rData, 传感器数据入口
rLen, 传感器数据长度
* 返 回 值: 无
*****************************************************************************************/
void RS485Analyze(GateWayPara GateWay, SensorCommPara SCPara, CommUnit Para, uint8_t *rData, uint8_t rLen)
{
@@ -121,13 +121,13 @@ static void update_on_start(uint8_t* frame, int len, uint8_t* pload, int size)
cfg.PackageNum = pReq->PackageNum;
cfg.AppSize = pReq->AppSize;
/**
操作FALSH ,写升级参数
操作FALSH ,写升级参数
**/
dev_boot_write_param(cfg);
update_send_cmd(0x01, 1, pReq->PackageNum);
//重启进入BOOT
//重启进入BOOT
NVIC_SystemReset();
}
@@ -179,10 +179,10 @@ static int update_process(void* frame, int len)
/*****************************************************************************************
* 函数名称: RS485SensorCmdSend
* 功能描述: 下发传感器指令函数
* 参 数: Para,通讯参数入口
* 返 回 值: 无
* 函数名称: RS485SensorCmdSend
* 功能描述: 下发传感器指令函数
* 参 数: Para,通讯参数入口
* 返 回 值: 无
*****************************************************************************************/
static void RS485SensorCmdSend(GateWayPara GateWay, SensorCommPara SensorComm)
{
@@ -217,11 +217,11 @@ static void RS485SensorCmdSend(GateWayPara GateWay, SensorCommPara SensorComm)
}
/*****************************************************************************************
* 函数名称: RS485SensorCmdSend
* 功能描述: 下发传感器指令函数
* 参 数: CommUintAddr 通讯单元地址
Para,通讯参数入口
* 返 回 值: 无
* 函数名称: RS485SensorCmdSend
* 功能描述: 下发传感器指令函数
* 参 数: CommUintAddr 通讯单元地址
Para,通讯参数入口
* 返 回 值: 无
*****************************************************************************************/
void RS485CmdSend(GateWayPara GateWay, uint8_t CommUintAddr, SensorCommPara SensorComm)
{
@@ -243,12 +243,12 @@ void RS485CmdSend(GateWayPara GateWay, uint8_t CommUintAddr, SensorCommPara Sens
/*****************************************************************************************
* 函数名称: RS485LoopHandler
* 功能描述: RS485循环处理函数
* 参 数: GateWay, 网关参数句柄
RS485Ch, RS485通道句柄
SCPara RS485通讯句柄
* 返 回 值: 无
* 函数名称: RS485LoopHandler
* 功能描述: RS485循环处理函数
* 参 数: GateWay, 网关参数句柄
RS485Ch, RS485通道句柄
SCPara RS485通讯句柄
* 返 回 值: 无
*****************************************************************************************/
static uint8_t CommUintData[512];
int test = 0;
@@ -266,8 +266,8 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
return;
}
if(RS485Ch->CommUnitEnable == true) { //使用内置通讯单元
if(RS485Ch->QuerySensorFlag == true) { //开机查找传感器
if(RS485Ch->CommUnitEnable == true) { //使用内置通讯单元
if(RS485Ch->QuerySensorFlag == true) { //开机查找传感器
if(SCPara->SensorCnt < SENSOR_NUM_MAX) {
rt_thread_delay(50);
SCPara->Cmd = RS485_SENSOR_CMD_QUERY;
@@ -328,7 +328,7 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
}
}
}
else { //读取外置通讯单元
else { //读取外置通讯单元
if(SCPara->RS485CommUnitReadTimeDelay >= (GateWay->ConfigPara.CommUnitReadInterval * 5) && SCPara->SendFlag == false) {
if(SCPara->SendUnitCommIdx < COMMUNIT_NUM_MAX) {
if(GateWay->ConfigPara.CommUnitArray[SCPara->SendUnitCommIdx].RegFlag &&
@@ -365,10 +365,10 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
RxLenTemp = SCPara->RS485RxLen;
// memset(SCPara->RS485RxBuff, 0x00, RS485_RX_BUFF_LEN_MAX);
SCPara->RS485RxLen = 0;
if(RxBuffTemp[0] == 0x7A && RS485Ch->UpgradeEnable == true) { //升级
if(RxBuffTemp[0] == 0x7A && RS485Ch->UpgradeEnable == true) { //升级
update_process(RxBuffTemp,RxLenTemp);
}
else if(RxBuffTemp[0] == 0x7A && RS485Ch->CommUnitEnable == true) { //内置通讯单元数据解析
else if(RxBuffTemp[0] == 0x7A && RS485Ch->CommUnitEnable == true) { //内置通讯单元数据解析
if(SCPara->SendFlag == false) {
SCPara->RS485RxLen = 0;
return;
@@ -376,12 +376,12 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
RS485Analyze(GateWay, SCPara, &RS485Ch->CUData, RxBuffTemp, RxLenTemp);
//rt_mutex_release(GateWay->UartRevMutex);
}
else if(RxBuffTemp[0] == 0x7B && RS485Ch->CommUnitEnable == false){ //读取外部通讯单元数据解析
else if(RxBuffTemp[0] == 0x7B && RS485Ch->CommUnitEnable == false){ //读取外部通讯单元数据解析
if(SCPara == &SComm1Para)
ret = GateWay->CommUnitRevCallBack(GateWay, RxBuffTemp, RxLenTemp, GateWay->ConfigPara.Rs485Ch1.RS485Send);
else
ret = GateWay->CommUnitRevCallBack(GateWay, RxBuffTemp, RxLenTemp, GateWay->ConfigPara.Rs485Ch2.RS485Send);
if(ret == 0xff) { //注册信息
if(ret == 0xff) { //注册信息
SCPara->RS485RxLen = 0;
return;
}
@@ -393,7 +393,7 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
return;
}
}
else { //调试命令解析
else { //调试命令解析
DebugAnalyze(GateWay, RxBuffTemp, RxLenTemp);
}
SCPara->RS485RxLen = 0;
@@ -426,7 +426,7 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
MegData[2] = COMM_UNIT_CMD_READ;
memcpy(&MegData[3], GateWay->ConfigPara.CommUnitArray[SCPara->SendUnitCommIdx].Mac[0], 6);
MegData[9] = GateWay->ConfigPara.CommUnitArray[SCPara->SendUnitCommIdx].CommStatus;
CatOneEthSendQueue(MegData, 10); //发送离线消息
CatOneEthSendQueue(MegData, 10); //发送离线消息
}
}
SCPara->SendUnitCommIdx++;
@@ -436,10 +436,10 @@ void RS485LoopHandler(GateWayPara GateWay, RS485Para RS485Ch, SensorCommPara SCP
}
/*****************************************************************************************
* 函数名称: RS485Ch1_Thread_Entry
* 功能描述: RS485通道1任务函数
* 参 数: 任务参数入口
* 返 回 值: 无
* 函数名称: RS485Ch1_Thread_Entry
* 功能描述: RS485通道1任务函数
* 参 数: 任务参数入口
* 返 回 值: 无
*****************************************************************************************/
void RS485Ch1_Thread_Entry(void *parameter)
{
@@ -469,7 +469,7 @@ void RS485Ch1_Thread_Entry(void *parameter)
if(SCPara->RS485Rev_Sem == RT_NULL) {
Debug_Printf("RS485Ch1Rev Sem Create Failed!\r\n");
}
Debug_Printf("RS485Ch1Rev Thread is running\r\n");
Debug_Printf("RS485Ch1Rev Thread is running\r\n");
rt_thread_delay(3000);
SCPara->InitOverFlag = true;
@@ -483,10 +483,10 @@ void RS485Ch1_Thread_Entry(void *parameter)
}
/*****************************************************************************************
* 函数名称: RS485Ch1RxIrqCallback
* 功能描述: RS485通道1中断处理回调函数
* 参 数: rData 接收到的数据
* 返 回 值: 无
* 函数名称: RS485Ch1RxIrqCallback
* 功能描述: RS485通道1中断处理回调函数
* 参 数: rData 接收到的数据
* 返 回 值: 无
*****************************************************************************************/
void RS485Ch1RxIrqCallback(uint8_t rData)
{
@@ -500,10 +500,10 @@ void RS485Ch1RxIrqCallback(uint8_t rData)
}
/*****************************************************************************************
* 函数名称: RS485Ch2_Thread_Entry
* 功能描述: RS485通道1任务函数
* 参 数: 任务参数入口
* 返 回 值: 无
* 函数名称: RS485Ch2_Thread_Entry
* 功能描述: RS485通道1任务函数
* 参 数: 任务参数入口
* 返 回 值: 无
*****************************************************************************************/
void RS485Ch2_Thread_Entry(void *parameter)
{
@@ -533,7 +533,7 @@ void RS485Ch2_Thread_Entry(void *parameter)
if(SCPara->RS485Rev_Sem == RT_NULL) {
Debug_Printf("RS485Ch2Rev Sem Create Failed!\r\n");
}
Debug_Printf("RS485Ch2Rev Thread is running\r\n");
Debug_Printf("RS485Ch2Rev Thread is running\r\n");
rt_thread_delay(3000);
SCPara->InitOverFlag = true;
while(1) {
@@ -543,10 +543,10 @@ void RS485Ch2_Thread_Entry(void *parameter)
}
/*****************************************************************************************
* 函数名称: RS485Ch2RxIrqCallback
* 功能描述: RS485通道1中断处理回调函数
* 参 数: rData 接收到的数据
* 返 回 值: 无
* 函数名称: RS485Ch2RxIrqCallback
* 功能描述: RS485通道1中断处理回调函数
* 参 数: rData 接收到的数据
* 返 回 值: 无
*****************************************************************************************/
void RS485Ch2RxIrqCallback(uint8_t rData)
{