若升级过程中失败,则下次升级重置提示语

This commit is contained in:
chenjiangqun
2026-05-13 14:47:25 +08:00
parent 2ae1a69422
commit 39fbf5570c

View File

@@ -77,6 +77,7 @@ namespace WinISP
private const byte MS_GET_BOARD_NAME = 0x45;
private const byte MS_GET_FW_VERSION = 0x47;
private string _fwVersionFromDDC = String.Empty;
private bool _suppressSendFileFailMessage = false;
object _lockObj = new object();
int _numberOfMonitors;
int _lastNumOfMonitors = 0;
@@ -1656,6 +1657,10 @@ namespace WinISP
frmISP.WriteLog("binFilePath is NULL", "debug");
return;
}
bool suppressSendFileFail = _suppressSendFileFailMessage;
_suppressSendFileFailMessage = false;
if (suppressSendFileFail)
SetStatusMsg("Ready");
frmISP.WriteLog("Start ISP", "debug");
//int totalFailCnt1 = 0;
int failCnt = 0;
@@ -1893,9 +1898,17 @@ namespace WinISP
{
//bypass empty sector
if (SetSentInfo(sentLen + _flashSectorSize) == false)
{
if (!suppressSendFileFail)
{
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return;
}
checkSum = 0;
@@ -1908,9 +1921,17 @@ namespace WinISP
{
//bypass empty sector
if (SetSentInfo(sentLen + _flashSectorSize) == false)
{
if (!suppressSendFileFail)
{
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return;
}
checkSum = 0;
@@ -1960,16 +1981,32 @@ namespace WinISP
//reset sent info
if (SetSentInfo(sentLen) == false)
{
if (!suppressSendFileFail)
{
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return;
}
if (retryCnt > MaxRetryCnt)
{
if (!suppressSendFileFail)
{
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return;
}
}