From 005755edcdc332315ba077598d4746ac195b069e Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 14 十月 2024 11:45:56 +0800 Subject: [PATCH] increase KPLC KBus from 2 client to 16 clients --- KPLC/Inc/BoardType.h | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 42 insertions(+), 1 deletions(-) diff --git a/KPLC/Inc/BoardType.h b/KPLC/Inc/BoardType.h index a864060..1e584f3 100644 --- a/KPLC/Inc/BoardType.h +++ b/KPLC/Inc/BoardType.h @@ -43,8 +43,10 @@ }; -#define BOARD_TYPE 7 +#define BOARD_TYPE 9 #define BOARD_VER 1 + +#define ENABLE_PLC 1 #if (BOARD_TYPE == 11) #define XLAT_FREQ 12 @@ -74,4 +76,43 @@ #endif +typedef struct tagInfoBlockHdr { + unsigned short nBlkSign; // 开始标志 + unsigned short nBlkTypeVer; // 类型和版本 + unsigned short nBlkSize; // Block 大小, 包括开始和结束标志 + unsigned short Pad1; +}stInfoBlockHdr; + +typedef struct tagInfoBlockTail { + + unsigned short CRC16; + unsigned short EndSign; +}stInfoBlockTail; + +typedef struct tagBtLdrInfoBlock { + stInfoBlockHdr Hdr; + unsigned short nBtldrVer; + unsigned short nBtldrDevice; + unsigned short nBtldrSize; // 设计大小 + unsigned short nBtldrDataSize; //代码大小 + unsigned int nBtldr_AppAddr; + unsigned int nBtldr_NewAppInfoAddr; + unsigned int nBtldr_NewAppAddr; + stInfoBlockTail tail; +}stBtLdrInfoBlock, *pBtLdrInfoBlock; + +typedef struct tagAppInfoBlock { + stInfoBlockHdr Hdr; + unsigned short nAppVer; + unsigned short nAppDevice; + unsigned short nAppSize; // 代码设计大小 + unsigned short nAppDataSize; //实际代码大小 + unsigned int nAppStartAddr; + unsigned int nAppStartOffset; + unsigned int nApp; + stInfoBlockTail tail; +}stAppInfoBlock, * pAppInfoBlock; + + + #endif /* __BOARDTYPE_H__ */ -- Gitblit v1.9.1