diff --git a/dfu_manager.cpp b/dfu_manager.cpp index 65c555b..36a6d85 100644 --- a/dfu_manager.cpp +++ b/dfu_manager.cpp @@ -217,7 +217,7 @@ void DFUManager::flash(QString *filename) dfu_makeidle(handle, iface); for (bindata_offset = 0; bindata_offset < binfile_content.size(); bindata_offset += block_size) { - emit flashProgressUpdate((bindata_offset*100)/binfile_content.size()); + emit flashProgressUpdate(LOAD_ADDRESS + bindata_offset, (bindata_offset*100)/binfile_content.size()); if (stm32_mem_erase(handle, iface, LOAD_ADDRESS + bindata_offset) != 0) { /* TODO: emit error */ diff --git a/dfu_manager.h b/dfu_manager.h index ae1176a..5b7cea5 100644 --- a/dfu_manager.h +++ b/dfu_manager.h @@ -51,7 +51,7 @@ class DFUManager : public QObject void foundDevice(QString *string); void lostDevice(); void finishedFlash(); - void flashProgressUpdate(int percentage); + void flashProgressUpdate(int address, int percentage); private slots: void findIFace(); diff --git a/mainwindow.cpp b/mainwindow.cpp index d236198..6739788 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -44,7 +44,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(&dfu_manager, SIGNAL(lostDevice()), this, SLOT(lostDevice())); connect(&dfu_thread, SIGNAL(started()), &dfu_manager, SLOT(start())); connect(&dfu_manager, SIGNAL(finishedFlash()), this, SLOT(finishedFlash())); - connect(&dfu_manager, SIGNAL(flashProgressUpdate(int)), this, SLOT(onFlashProgressUpdate(int))); + connect(&dfu_manager, SIGNAL(flashProgressUpdate(int, int)), this, SLOT(onFlashProgressUpdate(int, int))); connect(this, SIGNAL(doFlash(QString*)), &dfu_manager, SLOT(flash(QString*))); dfu_thread.start(); @@ -131,7 +131,8 @@ void MainWindow::finishedFlash() ui->label_Iface->setText("Done Flashing!"); } -void MainWindow::onFlashProgressUpdate(int percent) +void MainWindow::onFlashProgressUpdate(int address, int percent) { + ui->label_Iface->setText(QString("Flashing address 0x%1 %2%").arg(QString::number(address, 16)).arg(percent)); ui->progressBar->setValue(percent); } diff --git a/mainwindow.h b/mainwindow.h index b3dab6d..6556057 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -51,7 +51,7 @@ private slots: void lostDevice(); void flash(); void finishedFlash(); - void onFlashProgressUpdate(int percent); + void onFlashProgressUpdate(int address, int percent); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index 8519632..b4ed903 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -86,6 +86,12 @@ 0 + + true + + + %p% +