From 4392349b649164f2b498ca5157ecd141631ea96f Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期三, 01 二月 2023 18:18:47 +0800 Subject: [PATCH] KBus fix project name --- Src/KMachine.c | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 39 insertions(+), 18 deletions(-) diff --git a/Src/KMachine.c b/Src/KMachine.c index cad2702..bd2ec96 100644 --- a/Src/KMachine.c +++ b/Src/KMachine.c @@ -28,18 +28,30 @@ //uint32_t * pUID = (uint32_t *)(UID_BASE); const stKMInfoBlock KMInfoBlock = { - BOARD_TYPE, //nDeviceType + (BOARD_TYPE<<8) + BOARD_VER, //nDeviceType BOARD_VER, //nDevieVer 0x0100, //ProgVer 0x0100, //KLinkVer - 0x0100, //nCapacity - 16, //nDInput; - 16, //nDOutput + 0x0100, //KBusVer +// 0x0100, //KNetVer +// 0x0100, //KWLVer + + 4, //nCapacity1 ?K + 1, //nCapacity2 ?k + + DINPUT, //nDInput; + DOUTPUT, //nDOutput + 0, //nAInput 0, //nAOutput 0, //nHInput 0, //nHOutput 0, //nExt1; 0, //nExt2; + 0, //nLogSize; + 0, //nPorts; + 0, //nManSize; + 0, //nAbility; + 6, //nSwitchBits; }; const char VersionStr[] __attribute__((at(FLASH_BASE + 0X1000))) //__attribute__((at(0X8001000))) = "3.00"; @@ -52,33 +64,42 @@ CFG_VER, 0x0000, 0x0000, - {0,0,0,0,0,0}, + 0x0000, { { - 1, - 0, - 2304, //Buadrate * 100; PortType_KLink, //PorttType - 1, //ByteSize + 1, //Station + 2304, //Buadrate = * 100; + 0, //ByteSize 0, //Parity 0, //StopBits + 0, //endType 0, //EofChar 0, //SofChar + 0, //endtime + 0, //recvbuf + 0, //bufsize }, { - 1, - 0, - 2304, //Buadrate * 100; PortType_KBus, //PorttType - 1, //ByteSize + 0, //Station + 2304, //Buadrate = * 100; + 0, //ByteSize 0, //Parity 0, //StopBits + 0, //endType 0, //EofChar 0, //SofChar + 0, //endtime + 0, //recvbuf + 0, //bufsize } }, {{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}}, {{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}}, + { //default port mapping + 0,0,0,0,0,0 + }, 0x0003, 0x0004, 0x0005, @@ -89,11 +110,7 @@ 0x000a, 0x000b, 0x000c, - 0x000d, - 0x000e, - 0x000f, - 0x0010, - {0}, + 0x0011, END_SIGN, }; @@ -190,6 +207,10 @@ } int WriteFactoryData(void * pDataBuf, int nByteCount) { + stFactoryData * p1 = (stFactoryData*) pDataBuf; + stFactoryData * p2 = (stFactoryData *)FACTORY_DATA_BASE; + p1->Seq1= p2->Seq1+1; + EraseAndWriteToFlashMem(pDataBuf, (stFactoryData *)FACTORY_DATA_BASE,nByteCount); return 0; } -- Gitblit v1.9.1