startBootloader(): deprecated.

This commit is contained in:
Gerhard Hoffmann 2023-09-09 14:52:40 +02:00
parent 3e925756cf
commit 6765b12f0c

View File

@ -1,5 +1,8 @@
#include "update.h" #include "update.h"
#include "worker.h" #include "worker.h"
#include "utils.h"
#include "update_dc_event.h"
#include "mainwindow.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QApplication> #include <QApplication>
@ -9,6 +12,7 @@
#include <QTextStream> #include <QTextStream>
#include <QRegularExpression> #include <QRegularExpression>
#include <QRegExp> #include <QRegExp>
#include <QApplication>
//#include <iostream> //#include <iostream>
//#include <fstream> //#include <fstream>
@ -81,6 +85,7 @@ Update::Update(hwinf *hw,
QString customerRepository, QString customerRepository,
QString customerNrStr, QString customerNrStr,
QString branchName, QString branchName,
QString pluginName,
QString workingDir, QString workingDir,
bool dryRun, bool dryRun,
QObject *parent, QObject *parent,
@ -94,8 +99,17 @@ Update::Update(hwinf *hw,
, m_customerRepository(customerRepository) , m_customerRepository(customerRepository)
, m_customerNrStr(customerNrStr) , m_customerNrStr(customerNrStr)
, m_branchName(branchName) , m_branchName(branchName)
, m_pluginName(pluginName)
, m_workingDir(workingDir) , m_workingDir(workingDir)
, m_dryRun(dryRun) { , m_dryRun(dryRun) {
qInfo() << "UPDATE: m_serialInterface ..." << m_serialInterface;
qInfo() << "UPDATE: m_baudrate ..." << m_baudrate;
qInfo() << "UPDATE: m_customerRepository ..." << m_customerRepository;
qInfo() << "UPDATE: m_customerNr ..........." << m_customerNrStr;
qInfo() << "UPDATE: m_branchName ..........." << m_branchName;
qInfo() << "UPDATE: m_pluginName ..........." << m_pluginName;
qInfo() << "UPDATE: m_workingDirectory ....." << m_workingDir;
} }
Update::~Update() { Update::~Update() {
@ -221,22 +235,27 @@ Update::DownloadResult Update::dc_downloadBinary(QByteArray const &b) const {
return res; return res;
} }
bool Update::startBootloader() const { bool Update::startBootloader() const { // deprecated
qDebug() << "starting bootloader..."; return false;
int nTry = 5; #if 0
while (--nTry >= 0) { int nStartTry = 5;
while (--nStartTry >= 0) {
m_hw->bl_startBL(); m_hw->bl_startBL();
QThread::msleep(5000); QThread::msleep(500);
m_hw->bl_checkBL(); int nCheckTry = 10;
if (m_hw->bl_isUp()) { while (--nCheckTry >= 0) {
qInfo() << "starting bootloader...OK"; m_hw->bl_checkBL();
QThread::msleep(5000); QThread::msleep(500);
return true; if (m_hw->bl_isUp()) {
} else { qInfo() << "starting bootloader...OK";
qCritical() << "bootloader not up (" << nTry << ")"; return true;
} else {
qCritical() << "bootloader not up ("
<< nStartTry << "," << nCheckTry << ")" << QThread::currentThread();
}
} }
} }
qCritical() << "starting bootloader...FAILED"; qCritical() << "starting bootloader...FAILED" << QThread::currentThread();
return false; return false;
} }