Compare commits
9 Commits
78700e7bea
...
27c0aa56ee
Author | SHA1 | Date | |
---|---|---|---|
27c0aa56ee | |||
6377c6c18f | |||
e906213441 | |||
57b4ade2e5 | |||
f817d07e8c | |||
fc2bc6bafc | |||
7f672db841 | |||
d8232e0163 | |||
fc2132184e |
@ -1,6 +1,7 @@
|
|||||||
#ifndef DATEI_H
|
#ifndef DATEI_H
|
||||||
#define DATEI_H
|
#define DATEI_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -26,6 +26,8 @@ V4.0 6.9.2023: activating DC-Bootloader in slve-lib (SM)
|
|||||||
#ifndef hwapi_H
|
#ifndef hwapi_H
|
||||||
#define hwapi_H
|
#define hwapi_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
//#include <QTabWidget>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -72,6 +74,9 @@ V4.0 6.9.2023: activating DC-Bootloader in slve-lib (SM)
|
|||||||
//#undef THIS_IS_CA_MASTER
|
//#undef THIS_IS_CA_MASTER
|
||||||
|
|
||||||
//for CAmaster:
|
//for CAmaster:
|
||||||
|
#define THIS_IS_CA_MASTER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class QSharedMemory;
|
class QSharedMemory;
|
||||||
|
|
||||||
@ -1305,31 +1310,35 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// already declared in interfaces.h
|
void hwapi_templatePrintFinished_OK(void) const override;
|
||||||
void hwapi_templatePrintFinished_OK(void) const;
|
void hwapi_templatePrintFinished_Err(void) const override;
|
||||||
void hwapi_templatePrintFinished_Err(void) const;
|
|
||||||
|
|
||||||
void hwapi_coinCollectionJustStarted(void) const;
|
void hwapi_coinCollectionJustStarted(void) const override;
|
||||||
void hwapi_coinCollectionAborted(void) const;
|
void hwapi_coinCollectionAborted(void) const override;
|
||||||
|
|
||||||
void hwapi_gotNewCoin(void) const;
|
void hwapi_gotNewCoin(void) const override;
|
||||||
void hwapi_payStopByMax(void) const;
|
void hwapi_payStopByMax(void) const override;
|
||||||
void hwapi_payStopByPushbutton(void) const;
|
void hwapi_payStopByPushbutton(void) const override;
|
||||||
|
|
||||||
void hwapi_payStopByEscrow(void) const;
|
void hwapi_payStopByEscrow(void) const override;
|
||||||
void hwapi_payStopByError(void) const;
|
void hwapi_payStopByError(void) const override;
|
||||||
void hwapi_payStopByTimeout(void) const;
|
void hwapi_payStopByTimeout(void) const override;
|
||||||
void hwapi_payCancelled(void) const;
|
void hwapi_payCancelled(void) const override;
|
||||||
void hwapi_coinProcessJustStopped(void) const;
|
void hwapi_coinProcessJustStopped(void) const override;
|
||||||
|
|
||||||
// new from 2023.06.12
|
// new from 2023.06.12
|
||||||
void hwapi_doorServiceDoorOpened(void) const;
|
void hwapi_doorServiceDoorOpened(void) const override;
|
||||||
void hwapi_doorVaultDoorOpened(void) const;
|
void hwapi_doorVaultDoorOpened(void) const override;
|
||||||
void hwapi_doorCoinBoxRemoved(void) const;
|
void hwapi_doorCoinBoxRemoved(void) const override;
|
||||||
void hwapi_doorCoinBoxInserted(void) const;
|
void hwapi_doorCoinBoxInserted(void) const override;
|
||||||
void hwapi_doorCBinAndAllDoorsClosed(void) const;
|
void hwapi_doorCBinAndAllDoorsClosed(void) const override;
|
||||||
void hwapi_doorAllDoorsClosed(void) const;
|
void hwapi_doorAllDoorsClosed(void) const override;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//void hwapi_slotPrintFinished_OK(void);
|
//void hwapi_slotPrintFinished_OK(void);
|
||||||
|
@ -2276,7 +2276,32 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
virtual void hwapi_templatePrintFinished_OK(void) const=0;
|
||||||
|
virtual void hwapi_templatePrintFinished_Err(void) const=0;
|
||||||
|
|
||||||
|
virtual void hwapi_coinCollectionJustStarted(void) const=0;
|
||||||
|
virtual void hwapi_coinCollectionAborted(void) const=0;
|
||||||
|
|
||||||
|
virtual void hwapi_gotNewCoin(void) const=0;
|
||||||
|
virtual void hwapi_payStopByMax(void) const=0;
|
||||||
|
virtual void hwapi_payStopByPushbutton(void) const=0;
|
||||||
|
|
||||||
|
virtual void hwapi_payStopByEscrow(void) const=0;
|
||||||
|
virtual void hwapi_payStopByError(void) const=0;
|
||||||
|
virtual void hwapi_payStopByTimeout(void) const=0;
|
||||||
|
virtual void hwapi_payCancelled(void) const=0;
|
||||||
|
virtual void hwapi_coinProcessJustStopped(void) const=0;
|
||||||
|
|
||||||
|
virtual void hwapi_doorServiceDoorOpened(void) const=0;
|
||||||
|
virtual void hwapi_doorVaultDoorOpened(void) const=0;
|
||||||
|
virtual void hwapi_doorCoinBoxRemoved(void) const=0;
|
||||||
|
virtual void hwapi_doorCoinBoxInserted(void) const=0;
|
||||||
|
virtual void hwapi_doorCBinAndAllDoorsClosed(void) const=0;
|
||||||
|
virtual void hwapi_doorAllDoorsClosed(void) const=0;
|
||||||
|
|
||||||
|
|
||||||
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
|
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
|
||||||
|
/* GH Version, bringt Fehler
|
||||||
void hwapi_templatePrintFinished_OK() const;
|
void hwapi_templatePrintFinished_OK() const;
|
||||||
void hwapi_templatePrintFinished_Err() const;
|
void hwapi_templatePrintFinished_Err() const;
|
||||||
|
|
||||||
@ -2299,6 +2324,7 @@ signals:
|
|||||||
void hwapi_doorCoinBoxInserted() const;
|
void hwapi_doorCoinBoxInserted() const;
|
||||||
void hwapi_doorCBinAndAllDoorsClosed() const;
|
void hwapi_doorCBinAndAllDoorsClosed() const;
|
||||||
void hwapi_doorAllDoorsClosed() const;
|
void hwapi_doorAllDoorsClosed() const;
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#ifndef RUN_PROCESS_H
|
#ifndef RUN_PROCESS_H
|
||||||
#define RUN_PROCESS_H
|
#define RUN_PROCESS_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -25,7 +26,7 @@
|
|||||||
class T_runProc : public QObject
|
class T_runProc : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QTimer *hwapi_TimerPayment, *hwapi_triggerBL;
|
QTimer *hwapi_TimerPayment, *hwapi_triggerBL, *myTO;
|
||||||
|
|
||||||
void sub_emp_getAllParameters(struct T_emp *emp);
|
void sub_emp_getAllParameters(struct T_emp *emp);
|
||||||
void changer_getAllParameters(struct T_changer *mw);
|
void changer_getAllParameters(struct T_changer *mw);
|
||||||
|
@ -350,9 +350,20 @@ char T_datif::datif_cycleSend()
|
|||||||
char T_datif::sendINrequestsAutomatic(void)
|
char T_datif::sendINrequestsAutomatic(void)
|
||||||
{
|
{
|
||||||
//qDebug() << "send IN request " << dif_scanStep;
|
//qDebug() << "send IN request " << dif_scanStep;
|
||||||
// uint8_t datif_autoRequCommandList[50]={11, 12, 18, 104, 106, 103, 14, 27, 109, 17, 19, 23, 30, 31, 32, 33, 114, 35};
|
//uint8_t datif_autoRequCommandList[30]={11, 12, 14, 17, 18, 19, 22, 23, 27, 30,
|
||||||
uint8_t datif_autoRequCommandList[30]={11, 12, 14, 17, 18, 19, 22, 23, 27, 30, 31, 32, 33, 35, 102, 103, 104, 106, 107, 109, 114,0,0,0,0,0,0,0,0,0};
|
// 31, 32, 33, 35, 102, 103, 104, 106, 107, 109,
|
||||||
uint8_t datif_maxNrCommands=21, datif_sendNow;
|
// 114,0,0,0,0,0,0,0,0,0};
|
||||||
|
|
||||||
|
// extension 6.12.23, complete list:
|
||||||
|
uint8_t datif_autoRequCommandList[40]={11, 12, 13, 14, 17, 18, 19, 21, 22, 23,
|
||||||
|
24, 25, 27, 30, 31, 32, 33, 35, 39, 40,
|
||||||
|
41, 42, 102,103,104,106,107,108,109,110,
|
||||||
|
112,113,114,115,116,0, 0, 0, 0, 0};
|
||||||
|
uint8_t datif_maxNrCommands=35, datif_sendNow;
|
||||||
|
|
||||||
|
// send quicker while transaction is ongoing:
|
||||||
|
uint8_t datif_vendRequCommandList[15]={102,107,108,110,112,115,116,31,32,40,41,42,0,0,0};
|
||||||
|
uint8_t datif_maxVendingCmds=12;
|
||||||
|
|
||||||
// special commands:
|
// special commands:
|
||||||
// 102: get IOs run constantly!!!
|
// 102: get IOs run constantly!!!
|
||||||
@ -362,40 +373,44 @@ char T_datif::sendINrequestsAutomatic(void)
|
|||||||
// 107, 22: MDB: poll if needed
|
// 107, 22: MDB: poll if needed
|
||||||
|
|
||||||
doRepeat=true; // 20.9.23 15uhr (after release)
|
doRepeat=true; // 20.9.23 15uhr (after release)
|
||||||
if (datif_sendSlowCmd>0)
|
|
||||||
{
|
|
||||||
// send special command, slowly
|
|
||||||
datif_sendNow=datif_autoRequCommandList[datif_pNextCmd++];
|
|
||||||
if (datif_pNextCmd >= datif_maxNrCommands)
|
|
||||||
datif_pNextCmd=0;
|
|
||||||
if (datif_sendNow>0) // never send Command 0
|
|
||||||
datif_sendIOrequest(0, datif_sendNow, 0);
|
|
||||||
else
|
|
||||||
datif_pNextCmd=0; // falls in der Liste 0 vorkommt dann von vorne beginnen
|
|
||||||
|
|
||||||
//qDebug()<< "datif send request " << datif_sendNow;
|
if (gpi_getNowCoinPay())
|
||||||
|
{
|
||||||
|
// send only important commands while transaction in progress
|
||||||
|
if (datif_pNextCmd>=datif_maxVendingCmds ) datif_pNextCmd=0;
|
||||||
|
datif_sendNow=datif_vendRequCommandList[datif_pNextCmd++];
|
||||||
|
if (datif_sendNow>0) // never send Command 0
|
||||||
|
{
|
||||||
|
datif_sendIOrequest(0, datif_sendNow, 0);
|
||||||
|
//qDebug() << "datif, VEND-request: " << datif_sendNow;
|
||||||
|
} else
|
||||||
|
datif_pNextCmd=0; // falls in der Liste 0 vorkommt dann von vorne beginnen
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if (gpi_getNowCoinPay())
|
// no transaction, request all but request DI's more frequently
|
||||||
|
if (datif_sendSlowCmd>0) // send slow and fast commands alternating
|
||||||
{
|
{
|
||||||
// request coin input, high priority
|
// send special command, slowly
|
||||||
datif_sendIOrequest(0, 112, 0);
|
if (datif_pNextCmd>=datif_maxNrCommands ) datif_pNextCmd=0;
|
||||||
//qDebug()<< "datif send request 112 get coins";
|
datif_sendNow=datif_autoRequCommandList[datif_pNextCmd++];
|
||||||
|
if (datif_sendNow>0) // never send Command 0
|
||||||
|
{
|
||||||
|
datif_sendIOrequest(0, datif_sendNow, 0);
|
||||||
|
// qDebug() << "datif, auto-requ: " << datif_sendNow;
|
||||||
|
} else
|
||||||
|
datif_pNextCmd=0; // falls in der Liste 0 vorkommt dann von vorne beginnen
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// request inputs, high priority
|
// request inputs, high priority
|
||||||
datif_sendIOrequest(0, 31, 0); // 102
|
datif_sendIOrequest(0, 31, 0); // 102
|
||||||
// while coin collection DIs are polled slowly with datif_autoRequCommandList[]
|
// while coin collection DIs are polled slower
|
||||||
|
//qDebug()<< "datif send requ.31 get DIs";
|
||||||
//qDebug()<< "datif send request 102 get DIs";
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (++datif_sendSlowCmd>1) datif_sendSlowCmd=0; // 0,1,0,1,0,1,0....
|
if (++datif_sendSlowCmd>1) datif_sendSlowCmd=0; // 0,1,0,1,0,1,0....
|
||||||
|
}
|
||||||
|
|
||||||
return 0; // 25.9.2023, wichtig sonst bleibt die komplette PTU stehen!!!!
|
return 0; // 25.9.2023, wichtig sonst bleibt die komplette PTU stehen!!!!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -439,7 +454,7 @@ char T_datif::loadRecDataFromFrame()
|
|||||||
uint32_t ultmp;
|
uint32_t ultmp;
|
||||||
//int portNr;
|
//int portNr;
|
||||||
bool ret;
|
bool ret;
|
||||||
uint8_t uctmp; //, res; // maxai
|
uint8_t uctmp; //, nn; //, res; // maxai
|
||||||
char ctmp;
|
char ctmp;
|
||||||
//static uint8_t lastResult;
|
//static uint8_t lastResult;
|
||||||
//uint8_t prnResult;
|
//uint8_t prnResult;
|
||||||
@ -1105,9 +1120,7 @@ char T_datif::loadRecDataFromFrame()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 42: // get BNA box content and value of types
|
case 42: // get BNA box content and value of types
|
||||||
// qDebug()<< "CAmaster datif_got 42 ";
|
//qDebug()<< "CAslave datif_got 42";
|
||||||
// for (uctmp=0; uctmp<64; uctmp++)
|
|
||||||
// qDebug()<<receivedData[uctmp]<<" ";
|
|
||||||
|
|
||||||
if (RdDleng>60)
|
if (RdDleng>60)
|
||||||
{
|
{
|
||||||
|
@ -109,10 +109,6 @@ hwapi::hwapi(QWidget *parent) : QObject(parent)
|
|||||||
|
|
||||||
void hwapi::hwapi_slotPayProc(void)
|
void hwapi::hwapi_slotPayProc(void)
|
||||||
{
|
{
|
||||||
//cash_paymentProcessing();
|
|
||||||
//doors_supervise();
|
|
||||||
//dcBL_cycle();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3056,7 +3052,9 @@ bool hwapi::cash_cancelPayment(void) const
|
|||||||
{
|
{
|
||||||
// DB1: 1=encash 2=cancel & return coins
|
// DB1: 1=encash 2=cancel & return coins
|
||||||
// 3=stop and keep coins in escrow
|
// 3=stop and keep coins in escrow
|
||||||
epi_setNowCoinPay(false); // new since 20.9.23
|
//epi_setNowCoinPay(false); // new since 20.9.23
|
||||||
|
// am 6.12.23 wieder raus, waehrend Druck und wechseln auch schnell abfragen
|
||||||
|
|
||||||
//qCritical() << "cash cancel payment and return coins";
|
//qCritical() << "cash cancel payment and return coins";
|
||||||
return sendFDcmd_set(156, 0,0, 2,0,0,0);
|
return sendFDcmd_set(156, 0,0, 2,0,0,0);
|
||||||
}
|
}
|
||||||
@ -3066,7 +3064,8 @@ bool hwapi::cash_stopPayment(void) const
|
|||||||
{
|
{
|
||||||
// DB1: 1=encash 2=cancel & return coins
|
// DB1: 1=encash 2=cancel & return coins
|
||||||
// 3=stop and keep coins in escrow
|
// 3=stop and keep coins in escrow
|
||||||
epi_setNowCoinPay(false); // new since 20.9.23
|
//epi_setNowCoinPay(false); // new since 20.9.23
|
||||||
|
// am 6.12.23 wieder raus, waehrend Druck und wechseln auch schnell abfragen
|
||||||
//qCritical() << "cash stop payment and keep coins in escrow";
|
//qCritical() << "cash stop payment and keep coins in escrow";
|
||||||
// qCritical() << "emitting signal StopByPushbutton 2";
|
// qCritical() << "emitting signal StopByPushbutton 2";
|
||||||
emit hwapi_payStopByPushbutton();
|
emit hwapi_payStopByPushbutton();
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@ -1,5 +1,16 @@
|
|||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
#ifndef WIN32
|
#include <QCoreApplication>
|
||||||
|
#include "tslib.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#undef _FORTIFY_SOURCE
|
#undef _FORTIFY_SOURCE
|
||||||
|
|
||||||
|
@ -29,25 +29,31 @@ T_runProc::T_runProc()
|
|||||||
QTimer *runProc_callProcesses = new QTimer();
|
QTimer *runProc_callProcesses = new QTimer();
|
||||||
connect(runProc_callProcesses, SIGNAL(timeout()), this, SLOT(runProc_slotProcess()));
|
connect(runProc_callProcesses, SIGNAL(timeout()), this, SLOT(runProc_slotProcess()));
|
||||||
runProc_callProcesses->setSingleShot(false);
|
runProc_callProcesses->setSingleShot(false);
|
||||||
runProc_callProcesses->start(100); // in ms
|
runProc_callProcesses->start(10); // in ms
|
||||||
|
|
||||||
hwapi_lastDoorState=0; // default: all doors (should be) closed, coin box inserted
|
hwapi_lastDoorState=0; // default: all doors (should be) closed, coin box inserted
|
||||||
// bit0: upper door 1:middle 2:lower 3=cash-box out
|
// bit0: upper door 1:middle 2:lower 3=cash-box out
|
||||||
|
|
||||||
hwapi_triggerBL = new QTimer();
|
// hwapi_triggerBL = new QTimer();
|
||||||
connect(hwapi_triggerBL, SIGNAL(timeout()), this, SLOT(bl_performComplStart()));
|
// connect(hwapi_triggerBL, SIGNAL(timeout()), this, SLOT(bl_performComplStart()));
|
||||||
hwapi_triggerBL->setSingleShot(false);
|
// hwapi_triggerBL->setSingleShot(false);
|
||||||
hwapi_triggerBL->stop();
|
// hwapi_triggerBL->stop();
|
||||||
|
|
||||||
|
myTO = new QTimer();
|
||||||
|
myTO->setSingleShot(true);
|
||||||
|
myTO->start(200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void T_runProc::runProc_slotProcess(void)
|
void T_runProc::runProc_slotProcess(void)
|
||||||
{
|
{
|
||||||
|
#ifndef THIS_IS_CA_MASTER
|
||||||
cash_paymentProcessing();
|
cash_paymentProcessing();
|
||||||
doors_supervise();
|
doors_supervise();
|
||||||
|
bl_performComplStart(); // neu 1.12.23
|
||||||
dcBL_cycle();
|
dcBL_cycle();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool T_runProc::cash_startPayment(uint32_t amount)
|
bool T_runProc::cash_startPayment(uint32_t amount)
|
||||||
@ -654,7 +660,7 @@ bool T_runProc::bl_isUp(void)
|
|||||||
receivedData[3]==45 && receivedData[4] ==95 && receivedData[5]==176)
|
receivedData[3]==45 && receivedData[4] ==95 && receivedData[5]==176)
|
||||||
{
|
{
|
||||||
qDebug() << "got BL response to readFWversion";
|
qDebug() << "got BL response to readFWversion";
|
||||||
epi_clrRawReceivedString();
|
//epi_clrRawReceivedString();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// response to "start BL"
|
// response to "start BL"
|
||||||
@ -662,7 +668,7 @@ bool T_runProc::bl_isUp(void)
|
|||||||
receivedData[3]==223 && receivedData[4] ==131 )
|
receivedData[3]==223 && receivedData[4] ==131 )
|
||||||
{
|
{
|
||||||
qDebug() << "hwapi_bl_isUp: got BL response to start";
|
qDebug() << "hwapi_bl_isUp: got BL response to start";
|
||||||
epi_clrRawReceivedString();
|
//epi_clrRawReceivedString();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -677,7 +683,8 @@ void T_runProc::bl_completeStart(void)
|
|||||||
|
|
||||||
bool T_runProc::bl_performComplStart(void)
|
bool T_runProc::bl_performComplStart(void)
|
||||||
{
|
{
|
||||||
// must be called cyclic by timer
|
bool result;
|
||||||
|
|
||||||
static uint8_t retryCtr;
|
static uint8_t retryCtr;
|
||||||
|
|
||||||
if ((bl_startupStep<1) || (bl_startupStep>10))
|
if ((bl_startupStep<1) || (bl_startupStep>10))
|
||||||
@ -691,58 +698,69 @@ bool T_runProc::bl_performComplStart(void)
|
|||||||
|
|
||||||
if (bl_startupStep==2)
|
if (bl_startupStep==2)
|
||||||
{
|
{
|
||||||
|
qDebug()<<"rebooting";
|
||||||
bl_rebootDC();
|
bl_rebootDC();
|
||||||
hwapi_triggerBL->stop();
|
myTO->stop();
|
||||||
hwapi_triggerBL->start(1000); // call next step in 1s
|
myTO->start(500);
|
||||||
retryCtr=0;
|
retryCtr=0;
|
||||||
bl_startupStep++;
|
bl_startupStep++;
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (bl_startupStep==3)
|
if (bl_startupStep==3)
|
||||||
{
|
{
|
||||||
//qDebug()<<"starting BL";
|
if (!myTO->isActive())
|
||||||
|
{
|
||||||
|
qDebug()<<"starting BL";
|
||||||
bl_startBL();
|
bl_startBL();
|
||||||
hwapi_triggerBL->stop();
|
myTO->stop();
|
||||||
hwapi_triggerBL->start(100);
|
myTO->start(500);
|
||||||
bl_startupStep++;
|
bl_startupStep++;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (bl_startupStep==4)
|
if (bl_startupStep==4)
|
||||||
{
|
{
|
||||||
//if (!myTO->isActive())
|
if (!myTO->isActive())
|
||||||
//{
|
{
|
||||||
|
qDebug()<<"checking BL";
|
||||||
bl_checkBL();
|
bl_checkBL();
|
||||||
hwapi_triggerBL->stop();
|
myTO->stop();
|
||||||
hwapi_triggerBL->start(100);
|
myTO->start(200);
|
||||||
bl_startupStep++;
|
bl_startupStep++;
|
||||||
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (bl_startupStep==5)
|
if (bl_startupStep==5)
|
||||||
{
|
{
|
||||||
hwapi_triggerBL->stop();
|
if (!myTO->isActive())
|
||||||
if (bl_isUp())
|
{
|
||||||
|
qDebug()<<"step 5";
|
||||||
|
result = bl_isUp();
|
||||||
|
qDebug()<<"BL result: "<< result;
|
||||||
|
if (result)
|
||||||
{
|
{
|
||||||
bl_startupStep=99;
|
bl_startupStep=99;
|
||||||
|
qDebug()<<"BL is working now...";
|
||||||
// BL is up and running
|
// BL is up and running
|
||||||
|
return true;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
retryCtr++; // start again
|
retryCtr++; // start again
|
||||||
if (retryCtr>=15)
|
if (retryCtr>=10)
|
||||||
{
|
{
|
||||||
bl_startupStep=99;
|
bl_startupStep=99;
|
||||||
//qDebug()<<"BL error!!!";
|
qDebug()<<"BL error!!!";
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
bl_startupStep=3;
|
bl_startupStep=3;
|
||||||
//qDebug()<<"BL retry...";
|
myTO->stop();
|
||||||
|
myTO->start(200);
|
||||||
|
qDebug()<<"BL retry...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user