From a63e7018a4d5d9987c3a85a810abf5862b2bcdf3 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 9 Feb 2024 12:44:04 +0100 Subject: [PATCH] Minor: add some exteneded debug output. --- src/download_thread.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/download_thread.cpp b/src/download_thread.cpp index 47b11e8..e43c3c5 100644 --- a/src/download_thread.cpp +++ b/src/download_thread.cpp @@ -354,9 +354,7 @@ DownloadThread::sendNextDataBlock(QByteArray const &binary, int bNum) const { } } else { // qInfo() << "data for block" << bNum << "OK"; - - // TODO: hier ins shared mem schreiben - + // TODO: hier ins shared mem schreiben return res; } } else { @@ -368,64 +366,65 @@ DownloadThread::sendNextDataBlock(QByteArray const &binary, int bNum) const { } bool DownloadThread::startBootloader() const { - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "starting bootloader..."; int nTry = 5; while (--nTry >= 0) { m_hw->bl_startBL(); - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) << "bl_startBL() ..." << nTry; - QThread::msleep(1000); + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bl_startBL() ..." << nTry; + QThread::msleep(500); m_hw->bl_checkBL(); - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) << "bl_checkBL() ..." << nTry; - QThread::msleep(1000); + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bl_checkBL() ..." << nTry; + QThread::msleep(500); if (m_hw->bl_isUp()) { - qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODate) << "bootloader... isUP" << nTry; + qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bootloader... isUP" << nTry; return true; } else { - qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bootloader not up (" << nTry << ")"; } } - qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "starting bootloader FAILED"; return false; } bool DownloadThread::stopBootloader() const { - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "stopping bootloader..."; int nTry = 5; while (--nTry >= 0) { m_hw->bl_stopBL(); - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bl_stopBL() ..."; QThread::msleep(500); m_hw->bl_checkBL(); - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) << "bl_checkBL() ..." << nTry; + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "bl_checkBL() ..." << nTry; if (!m_hw->bl_isUp()) { - qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "stopping bootloader OK"; return true; } } - qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qCritical() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "stopping bootloader FAILED"; return false; } bool DownloadThread::resetDeviceController() const { - qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qDebug() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "resetting device controller..."; m_hw->bl_rebootDC(); // wait maximally 3 seconds, before starting bootloader QThread::sleep(1); - qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODate) + qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << "resetting device controller...OK"; return true; } QByteArray DownloadThread::loadBinaryDCFile(QString filename) const { - qDebug() << "loading dc binary" << filename << "..."; + qInfo() << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) + << "loading dc binary" << filename << "..."; QFile file(filename); // closed in destructor call if (!file.exists()) {