From fc8a81d80e32cdafdae319cf439145db6613c793 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期五, 22 七月 2022 15:00:10 +0800
Subject: [PATCH] fix HvserialPort and Klink

---
 MTerm2/MTerm2CommDevView.cpp |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/MTerm2/MTerm2CommDevView.cpp b/MTerm2/MTerm2CommDevView.cpp
index da7e706..00eb853 100644
--- a/MTerm2/MTerm2CommDevView.cpp
+++ b/MTerm2/MTerm2CommDevView.cpp
@@ -275,7 +275,8 @@
 	//	s1.AppendFormat(_T("Total S %8d \r\nTotal R %8d \r\n"), MySerialCom1.TotalSendBytes, MySerialCom1.TotalRecvBytes);
 	s1 += intToString(pDoc->myHvSerialPort1.TotalRecvBytes) + _T("\r\n");
 	//	stepCount++;
-	static double LastCalTime = GetTimemS();
+
+	static double LastCalTime = 0;
 	double thisTime = GetTimemS();
 	if (thisTime - LastCalTime > 500)
 	{
@@ -357,6 +358,20 @@
 		}
 		s2.Append(_T("\r\n"));
 	}
+	s2.Append(_T("\r\n"));
+
+	for (int i = 8; i < (nCount + 15) / 16; i++)
+	{
+		s2.AppendFormat(_T("%3X: "), i * 16);
+		for (int j = 0; j < 16; j++)
+		{
+			s2.AppendFormat(_T("%02X"), pDoc->MyKLink1.MEM.SDB[i * 16 + j]);
+			if (j == 7) { s2.Append(_T("  ")); }
+			else { s2.Append(_T(" ")); }
+		}
+		s2.Append(_T("\r\n"));
+	}
+
 	//	s2.AppendFormat(_T("%d\r\n"), pDoc->MyKLink1.MEM.SDD[5]);
 
 	nCount = 32;
@@ -1076,14 +1091,16 @@
 		nStep++;
 //		if (nStep == 2) { nStep = 3; }
 		if (nStep > 4) { nStep = 0; }
+		MonitorSuccessCount += nThisSuccessCount;
+		MonitorFailCount += nThisFailCount;
 		if (nThisFailCount == 0)
 		{
-			MonitorSuccessCount++;
+
 
 		}
 		else
 		{
-			MonitorFailCount++;
+
 		}
 	}
 	return 0;

--
Gitblit v1.9.1