Skip to content

Commit

Permalink
Qt: Add "verify" action.
Browse files Browse the repository at this point in the history
Change-Id: Ie1a98e0134e09b53268e52c97e643a217addd92e
  • Loading branch information
7134956 authored and bbogush committed May 20, 2023
1 parent bf47988 commit 51ac521
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void MainWindow::slotProgVerifyCompleted(quint64 readBytes)

setProgress(100);
workFile.close();
buffer.clear();
buffer.buf.clear();

qInfo() << readBytes << " bytes read. Verify end." ;
}
Expand All @@ -390,9 +390,10 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
setProgress(progressPercent);

QVector<uint8_t> cmpBuffer;
cmpBuffer.resize(buffer.size());
buffer.mutex.lock();
cmpBuffer.resize(buffer.buf.size());

qint64 readSize = workFile.read((char *)cmpBuffer.data(), buffer.size());
qint64 readSize = workFile.read((char *)cmpBuffer.data(), buffer.buf.size());

if (readSize < 0)
{
Expand All @@ -405,7 +406,7 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)

for(uint32_t i = 0; i < readSize; i++)
{
if(cmpBuffer.at(i) != buffer.at(i))
if(cmpBuffer.at(i) != buffer.buf.at(i))
{
uint64_t block = progress / ui->blockSizeValueLabel->text().toULongLong(nullptr, 16)
+ ui->firstSpinBox->text().toULongLong(nullptr, 10) - 1;
Expand All @@ -419,7 +420,8 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
}
}

buffer.clear();
buffer.buf.clear();
buffer.mutex.unlock();
}

void MainWindow::slotProgVerify()
Expand Down Expand Up @@ -486,7 +488,7 @@ void MainWindow::slotProgVerify()
ui->filePathLineEdit->setDisabled(true);
ui->selectFilePushButton->setDisabled(true);

buffer.clear();
buffer.buf.clear();

prog->readChip(&buffer, start_address, areaSize, true);
}
Expand Down

0 comments on commit 51ac521

Please sign in to comment.