From 95322c84888cbe2e92024d4d65698f59b016cb52 Mon Sep 17 00:00:00 2001
From: QuakeGod <quakegod@sina.com>
Date: 星期日, 25 二月 2024 12:29:35 +0800
Subject: [PATCH] move some define from Kbus.h to KBusDefine.h

---
 ComLib/Src/KBus.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/ComLib/Src/KBus.c b/ComLib/Src/KBus.c
index ca87064..e306619 100644
--- a/ComLib/Src/KBus.c
+++ b/ComLib/Src/KBus.c
@@ -50,6 +50,10 @@
 unsigned char Datas[128];		
 volatile int PacketLength = 0;
 
+stClientInfo ClientInfo[16];
+
+
+
 unsigned char KBusBCC(void * pData, int nSize)
 {
 	unsigned char k;
@@ -345,7 +349,13 @@
 
 #if (BOARD_TYPE == 14)				
 				BufferIn[ChildId]=p1->data[0];
+				BufferIn[ChildId + 1] = p1->data[1];
+				BufferIn[ChildId + 2 ] = p1->data[2];
+			
 				KMem.WXB[ChildId-1]=BufferIn[ChildId];
+				KMem.WXB[ChildId]=BufferIn[ChildId+1];
+				KMem.WXB[ChildId+1]=BufferIn[ChildId+2];
+			
 				if (KMRunStat.WorkMode==0) {	
 				//	KMem.WY[0]= KMem.WX[1]+(KMem.WX[2]<<8)	;
 				//	PutOutput (KMem.WY[0]);
@@ -450,6 +460,10 @@
 				break;
 			case cmdExChgData:
 				BufferIn[0]=p1->data[0];
+				BufferIn[1]=p1->data[1];
+//				KMem.WLYB[1] = BufferIn[1];
+		
+				KMem.WYB[1] = BufferIn[1];
 				nSlaveTick=p1->data[4]+(p1->data[5]<<8);//+(p1->data[6]<<16)+(p1->data[7]<<24);
 #if (BOARD_TYPE == 14)
 			//	PutOutput(BufferIn[0]);
@@ -467,8 +481,11 @@
 		//		KBusChnStats[0].ClientDatas[7]++;
 //				BufferOut[0]=GetInput();
 				BufferOut[0]=GetInput();
+				BufferOut[1]=KMem.WXB[1];			
 #endif
 				p1->data[0]=BufferOut[0];
+				p1->data[1]=BufferOut[1];
+				
 				p1->data[3]=nIndex;
 				p1->data[4]=KBusChnStats[0].ClientDatas[nIndex];
 				p1->data[5]=KBusChnStats[0].ClientDatas[nIndex]>>8;
@@ -622,8 +639,14 @@
 				{
 					KBusChnStats[nCurPollId].Stat=0;
 					KMem.ErrStat=200;
-					 
-					{BufferIn[nCurPollId]=0;}
+#if (BOARD_TYPE == 14)
+					BufferIn[nCurPollId]=0;
+					KMem.WXB[nCurPollId-1]=BufferIn[nCurPollId];				
+#else					
+					{BufferIn[nCurPollId]=0;
+						KMem.WLX[nCurPollId]=BufferIn[nCurPollId];					
+					}
+#endif
 				}
 			//	LL_GPIO_SetOutputPin(GPIOA,LL_GPIO_PIN_7);
 			}else

--
Gitblit v1.9.1