From b6290b94cac76a5634cd90b495b65d91ee92d85e Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期三, 22 二月 2023 08:57:38 +0800
Subject: [PATCH] fix conflict

---
 Src/KMachine.c |   44 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/Src/KMachine.c b/Src/KMachine.c
index cad2702..5d36461 100644
--- a/Src/KMachine.c
+++ b/Src/KMachine.c
@@ -28,10 +28,14 @@
 //uint32_t * pUID = (uint32_t *)(UID_BASE);
 const stKMInfoBlock KMInfoBlock =
 {
-	BOARD_TYPE,			//nDeviceType
+//	sizeof(stKMInfoBlock),
+	(BOARD_TYPE<<8) + BOARD_VER,			//nDeviceType 	BOARD_VER,			//nDevieVer
 	0x0100,			//ProgVer
 	0x0100,			//KLinkVer
-	0x0100,			//nCapacity
+	0x0100,			//KBusVer
+	
+	4,					//nCapacity1	?K
+	1,					//nCapacity2	?k
 	16,					//nDInput;
 	16,					//nDOutput
 	0,					//nAInput
@@ -40,6 +44,11 @@
 	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 +61,48 @@
 	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 +113,7 @@
 		0x000a,
 		0x000b,
 		0x000c,
-		0x000d,
-		0x000e,
-		0x000f,
-		0x0010,
-	{0},
+
 	0x0011,
 	END_SIGN,
 };
@@ -190,6 +210,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