Minor: add some exteneded debug output.
This commit is contained in:
parent
b05325e5f4
commit
a63e7018a4
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user