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/KLink.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ComLib/Src/KLink.c b/ComLib/Src/KLink.c
index 9141d7b..374885e 100644
--- a/ComLib/Src/KLink.c
+++ b/ComLib/Src/KLink.c
@@ -9,6 +9,10 @@
 #include "string.h"
 #include "PLCFunctions.h"
 #include "stm32f0xx_hal.h"
+#ifdef KWLESS
+#include "KWireless.h"
+#endif
+//extern stWLRunStat KwRunStat;
 
 unsigned char KLPacketBuf1[256];
 unsigned char KLPacketBuf2[256];
@@ -213,7 +217,9 @@
 				else if (nDataType == KLDataTypeTest)	{		pData=KMem.SDT+nWordAddr;	}
 				else if (nDataType == KLDataTypeWDT)	{		pData=KMem.WDT+nWordAddr;	}
 				else if (nDataType == KLDataTypeKBD)	{		pData=(unsigned short *)&KBusChnStats  +nWordAddr;	}
-//				else if (nDataType == KLDataTypeKWLD)	{		pData=(unsigned short *)&KwRunStat  +nWordAddr;	}
+#ifdef KWLESS
+				else if (nDataType == KLDataTypeKWLD)	{		pData=(unsigned short *)&KwRunStat  +nWordAddr;	}
+#endif
 				else if (nDataType == KLDataSysCfg) { pData = (unsigned short *)&storedKMSysCfg.theKMSysCfg + nWordAddr;}
 				else if (nDataType == KLDataTypeFlash) { pData = (unsigned short *)FLASH_BASE + nWordAddr;}
 				else				{					pData=KLBufferOut+nWordAddr;				}
@@ -244,7 +250,9 @@
 				else if (nDataType == KLDataTypeTest)	{		pData=KMem.SDT+nWordAddr;	DataLen=0;}
 				else if (nDataType == KLDataTypeWDT)	{		pData=KMem.WDT+nWordAddr;	DataLen=0;}
 				else if (nDataType == KLDataTypeKBD)	{		pData=(unsigned short *)KBusChnStats +nWordAddr;	DataLen=0;}
-//				else if (nDataType == KLDataTypeKWLD)	{		pData=(unsigned short *)&KwRunStat  +nWordAddr;	}
+#ifdef KWLESS				
+				else if (nDataType == KLDataTypeKWLD)	{		pData=(unsigned short *)&KwRunStat  +nWordAddr;	}
+#endif
 				else if (nDataType == KLDataSysCfg)		{ pData = (unsigned short *)&(storedKMSysCfg) + nWordAddr;}
 				else if (nDataType == KLDataTypeFlash) { pData = (unsigned short *)FLASH_BASE + nWordAddr;}
 				else				{					pData=KLBufferOut+nWordAddr;	DataLen=0;			}

--
Gitblit v1.9.1