From 448d6c050697a6bb7f4b7b02f08ef8fc8e5cd027 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 17 十月 2022 03:20:54 +0800 Subject: [PATCH] Merge branch 'dev1' of file://hasee-k680e/GitBase/F030C8xx_KLink into dev1 --- Inc/KBus.h | 31 +++++++++++++------------------ 1 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Inc/KBus.h b/Inc/KBus.h index 69341b0..f877f79 100644 --- a/Inc/KBus.h +++ b/Inc/KBus.h @@ -11,7 +11,7 @@ #define __KBUS_H__ typedef unsigned char uchar; -extern unsigned char bMaster,bSlave,bRepeater; +extern unsigned char bKBusMaster,bKBusSlave,bKBusRepeater;; enum enCMDs { cmdNone = '0', //Nothing @@ -144,7 +144,7 @@ }; } stChnStat; -extern stChnStat ChnStats[9]; +extern stChnStat ChnStats[8]; typedef struct tagSlaveStat { @@ -190,13 +190,13 @@ typedef struct tagPacket { - unsigned char Sign; //起始标记 - unsigned char DstHost; //目标地址 - unsigned char SrcAddr; //源地址 - unsigned char nCMD; //命令 - unsigned char nSEQ; //序列号 - unsigned char PacketLen; //数据载荷长度 不包括头部5个字节,不包括尾部BCC。 - unsigned char data[1]; //数据载荷,最末尾是BCC,数据长度为0时,实际也有一个数据。 + 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; enum eResult @@ -206,10 +206,6 @@ S_TIMEOUT=2 } ; - -int RepeaterFunc(int nChn); -int MasterFunc(int nChn); -int SlaveFunc(int nChn); unsigned char BCC(void * pData, int nSize); // @@ -223,7 +219,7 @@ int ParsePacket(int nChn, pPacket p1, int Len1); typedef struct tagMachineConfig { - int bMaster; + int bKBusMaster; int nAddr; }stMachineConfig; @@ -243,10 +239,9 @@ int GetStat(void); - - - - +int KBusRepeaterFunc(int nChn); +int KBusMasterFunc(int nChn); +int KBusSlaveFunc(int nChn); #endif /* __KBUS_H__ */ -- Gitblit v1.9.1