3288 更新进度不显示bug

This commit is contained in:
lovelyyoung 2021-10-20 14:26:00 +08:00
parent 0e7bf9dd64
commit 4eb7c9affb
1 changed files with 8 additions and 2 deletions

View File

@ -353,9 +353,15 @@ bool GScn_Drv::Updata(std::string filename, std::function<void(long, long)> func
updatefile.read(uotstream, length); updatefile.read(uotstream, length);
m_usb->write_bulk(uotstream, length); m_usb->write_bulk(uotstream, length);
m_usb->read_bulk(&update, sizeof(update)); m_usb->read_bulk(&update, sizeof(update));
if (update.u32_Count != length)
return false;
delete[] uotstream; delete[] uotstream;
if (update.u32_Count != length)
{
return false;
}
else
{
func(update.u32_Count, length);
}
} }
else else
{ {