From d69aae90ede578aaebc355dafd3496993ccea126 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 17 十月 2022 03:02:12 +0800 Subject: [PATCH] fix 2 --- Inc/KBus.h | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Inc/KBus.h b/Inc/KBus.h index 82dcc08..69341b0 100644 --- a/Inc/KBus.h +++ b/Inc/KBus.h @@ -11,7 +11,7 @@ #define __KBUS_H__ typedef unsigned char uchar; -extern int bMaster,bSlave; +extern unsigned char bMaster,bSlave,bRepeater; enum enCMDs { cmdNone = '0', //Nothing @@ -49,9 +49,9 @@ extern unsigned char nCurPollId; extern unsigned char nSeq; -extern volatile int MasterRecved; -extern volatile int MasterRecvOK; -extern volatile int SlaveRecved; +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; @@ -143,7 +143,8 @@ }; }; } stChnStat; -extern stChnStat ChnStats[8]; + +extern stChnStat ChnStats[9]; typedef struct tagSlaveStat { @@ -205,17 +206,21 @@ S_TIMEOUT=2 } ; + +int RepeaterFunc(int nChn); +int MasterFunc(int nChn); +int SlaveFunc(int nChn); + unsigned char BCC(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 CheckPacket(pPacket p1,int len1); +int CheckPacket(int nChn, pPacket p1, int len1); /* */ -int ParsePacket(pPacket p1, int Len1); +int ParsePacket(int nChn, pPacket p1, int Len1); typedef struct tagMachineConfig { int bMaster; -- Gitblit v1.9.1