diff --git a/DownloadDCFirmware/main.cpp b/DownloadDCFirmware/main.cpp index ad64256..0c1267a 100644 --- a/DownloadDCFirmware/main.cpp +++ b/DownloadDCFirmware/main.cpp @@ -189,7 +189,7 @@ int main(int argc, char **argv) { } Update u(fi.absoluteFilePath(), libca, debug, noaction); - // u.run(); + u.run(); qInfo() << ""; diff --git a/DownloadDCFirmware/update.cpp b/DownloadDCFirmware/update.cpp index b57bbfe..8118617 100644 --- a/DownloadDCFirmware/update.cpp +++ b/DownloadDCFirmware/update.cpp @@ -400,19 +400,19 @@ int Update::run() { // TODO resetDeviceController(); if (startBootloader()) { -#if 0 + int currentBlock = 0; DownloadResult res = DownloadResult::OK; qInfo() << nextTimePoint().toUtf8().constData() << "64-byte block" << currentBlock; - while (res != DownloadResult::ERROR && currentBlock < m_totalBlocks) { + while (res != DownloadResult::ERROR && currentBlock <= m_totalBlocks) { if ((res = sendNextAddress(currentBlock)) != DownloadResult::ERROR) { if ((res = sendNextDataBlock(ba, currentBlock)) != DownloadResult::ERROR) { currentBlock += 1; } else break; } } -#endif + #if 0 qCritical() << "DownloadThread::run(): last 64-byte block %04d" << currentBlock;