From 0fe6b074f3f3994d87af195f37e349a83e27882c Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期六, 10 十二月 2022 16:55:40 +0800
Subject: [PATCH] FP0 fix utf8 char

---
 Inc/KBus.h |   68 ++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 28 deletions(-)

diff --git a/Inc/KBus.h b/Inc/KBus.h
index f877f79..aef83a4 100644
--- a/Inc/KBus.h
+++ b/Inc/KBus.h
@@ -41,25 +41,38 @@
 extern unsigned char PacketBuf1[128];
 extern unsigned char PacketBuf2[128];
 
+typedef struct tagKBusRunStat
+{
+	unsigned char bMaster;
+	unsigned char nStationID;
+	unsigned char nChildren;
+	unsigned char nCurPollId;
+	unsigned char nSeq;
+
+	unsigned char bMasterRecved;
+	unsigned char bMasterRecvOK;
+	unsigned char bSlaveRecved;
+	unsigned int nSendTimeuS;
+
+}stKBusRunStat , * pstKBusRunStat;
+
 extern unsigned char BufferIn[16];
 extern unsigned char BufferOut[16];
-extern unsigned char nAddr;
+extern unsigned char nStationID;
 extern unsigned char nChilds;
 extern int ChildStat[16];
 extern unsigned char nCurPollId;
 extern unsigned char nSeq;
 
-extern volatile unsigned char MasterRecved;
-extern volatile unsigned char MasterRecvOK;
-extern volatile unsigned char SlaveRecved;
-extern unsigned int SendTimeuS;
-extern volatile int RecvTimeuS;
-extern int DelayuS;
-extern int MaxDelayuS;
+extern volatile unsigned char KBusMasterRecved;
+extern volatile unsigned char KBusMasterRecvOK;
+extern volatile unsigned char KBusSlaveRecved;
+extern unsigned int KBusSendTimeuS;
+extern volatile int KBusRecvTimeuS;
+extern int KBusDelayuS;
+extern int KBusMaxDelayuS;
 
 extern volatile unsigned int nSlaveTick;
-
-
 
 typedef struct tagVerInfo
 {
@@ -107,8 +120,7 @@
 	unsigned char OutPutCount;
 	unsigned char InDWCount;
 	unsigned char OutDWCount;
-	
-	unsigned char Online;
+	unsigned char bOnline;
 };
 
 #pragma anon_unions
@@ -144,7 +156,7 @@
 	};
 } stChnStat;
 
-extern stChnStat ChnStats[8];
+extern stChnStat KBusChnStats[8];
 
 typedef struct tagSlaveStat
 {
@@ -188,16 +200,16 @@
 	evClosed = 4,
 };
 
-typedef struct tagPacket
+typedef struct tagKBPacket
 	{
-		unsigned char Sign;		//锟斤拷始锟斤拷锟�		
-		unsigned char DstHost;	//目锟斤拷锟街�
-		unsigned char SrcAddr;	//源锟斤拷址
-		unsigned char nCMD;		//锟斤拷锟斤拷
-		unsigned char nSEQ;		//锟斤拷锟叫猴拷
-		unsigned char PacketLen;	//锟斤拷锟斤拷锟截荷筹拷锟斤拷	锟斤拷锟斤拷锟斤拷头锟斤拷5锟斤拷锟街节o拷锟斤拷锟斤拷锟斤拷尾锟斤拷BCC锟斤拷
-		unsigned char data[1];		//锟斤拷锟斤拷锟截猴拷,锟斤拷末尾锟斤拷BCC锟斤拷锟斤拷锟捷筹拷锟斤拷为0时锟斤拷实锟斤拷也锟斤拷一锟斤拷锟斤拷锟捷★拷
-	}stPacket,* pPacket;	
+		unsigned char Sign;		//璧峰鏍囪		
+		unsigned char DstHost;	//鐩爣鍦板潃
+		unsigned char SrcAddr;	//婧愬湴鍧�
+		unsigned char nCMD;		//鍛戒护
+		unsigned char nSEQ;		//搴忓垪鍙�
+		unsigned char PacketLen;	//鏁版嵁杞借嵎闀垮害	涓嶅寘鎷ご閮�5涓瓧鑺傦紝涓嶅寘鎷熬閮˙CC銆�
+		unsigned char data[1];		//鏁版嵁杞借嵎,鏈�鏈熬鏄疊CC锛屾暟鎹暱搴︿负0鏃讹紝瀹為檯涔熸湁涓�涓暟鎹��
+	}stKBPacket,* pKBPacket;	
 
 enum eResult
 {	
@@ -207,22 +219,22 @@
 
 }	;
 
-unsigned char BCC(void * pData, int nSize);
+unsigned char KBusBCC(void * pData, int nSize);
 //
 	/* Make a Packet and return Packet Length */
-int MakePacket(pPacket p1,uchar Src, uchar Dst, uchar nType, uchar nSEQ, uchar DataLen, void *pData );
+int KBusMakePacket(pKBPacket p1,uchar Src, uchar Dst, uchar nType, uchar nSEQ, uchar DataLen, void *pData );
 
 /*   */
-int CheckPacket(int nChn, pPacket p1, int len1);
+int KBusCheckPacket(int nChn, pKBPacket p1, int len1);
 
 /* */
-int ParsePacket(int nChn, pPacket p1, int Len1);
+int KBusParsePacket(int nChn, pKBPacket p1, int Len1);
 typedef struct tagMachineConfig
 {
 	int bKBusMaster;
 	int nAddr;
 }stMachineConfig;
-
+/*
 int InitMachine(stMachineConfig * pConfig);
 
 int SetConfig(void );
@@ -238,7 +250,7 @@
 int WriteData(void);
 
 int GetStat(void);
-
+*/
 int KBusRepeaterFunc(int nChn);
 int KBusMasterFunc(int nChn);
 int KBusSlaveFunc(int nChn);

--
Gitblit v1.9.1