@@ -377,7 +377,7 @@ void MainWindow::slotProgVerifyCompleted(quint64 readBytes)
377
377
378
378
setProgress (100 );
379
379
workFile.close ();
380
- buffer.clear ();
380
+ buffer.buf . clear ();
381
381
382
382
qInfo () << readBytes << " bytes read. Verify end." ;
383
383
}
@@ -390,9 +390,10 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
390
390
setProgress (progressPercent);
391
391
392
392
QVector<uint8_t > cmpBuffer;
393
- cmpBuffer.resize (buffer.size ());
393
+ buffer.mutex .lock ();
394
+ cmpBuffer.resize (buffer.buf .size ());
394
395
395
- qint64 readSize = workFile.read ((char *)cmpBuffer.data (), buffer.size ());
396
+ qint64 readSize = workFile.read ((char *)cmpBuffer.data (), buffer.buf . size ());
396
397
397
398
if (readSize < 0 )
398
399
{
@@ -405,7 +406,7 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
405
406
406
407
for (uint32_t i = 0 ; i < readSize; i++)
407
408
{
408
- if (cmpBuffer.at (i) != buffer.at (i))
409
+ if (cmpBuffer.at (i) != buffer.buf . at (i))
409
410
{
410
411
uint64_t block = progress / ui->blockSizeValueLabel ->text ().toULongLong (nullptr , 16 )
411
412
+ ui->firstSpinBox ->text ().toULongLong (nullptr , 10 ) - 1 ;
@@ -419,7 +420,8 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
419
420
}
420
421
}
421
422
422
- buffer.clear ();
423
+ buffer.buf .clear ();
424
+ buffer.mutex .unlock ();
423
425
}
424
426
425
427
void MainWindow::slotProgVerify ()
@@ -486,7 +488,7 @@ void MainWindow::slotProgVerify()
486
488
ui->filePathLineEdit ->setDisabled (true );
487
489
ui->selectFilePushButton ->setDisabled (true );
488
490
489
- buffer.clear ();
491
+ buffer.buf . clear ();
490
492
491
493
prog->readChip (&buffer, start_address, areaSize, true );
492
494
}
0 commit comments