mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Merge remote-tracking branch 'origin/pt/haltfixes' into next
This commit is contained in:
commit
3e44389fa8
@ -90,6 +90,8 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname):
|
|||||||
if (devices.length()==1 && hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0)==1) {
|
if (devices.length()==1 && hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0)==1) {
|
||||||
qDebug()<<"OP_DFU detected first time";
|
qDebug()<<"OP_DFU detected first time";
|
||||||
mready=true;
|
mready=true;
|
||||||
|
QTimer::singleShot(200,&m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
} else {
|
} else {
|
||||||
// Wait for the board to appear on the USB bus:
|
// Wait for the board to appear on the USB bus:
|
||||||
USBSignalFilter filter(0x20a0,-1,-1,USBMonitor::Bootloader);
|
USBSignalFilter filter(0x20a0,-1,-1,USBMonitor::Bootloader);
|
||||||
@ -107,6 +109,8 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname):
|
|||||||
if (devices.length()==1) {
|
if (devices.length()==1) {
|
||||||
if(hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0)==1)
|
if(hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0)==1)
|
||||||
{
|
{
|
||||||
|
QTimer::singleShot(200,&m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
qDebug()<<"OP_DFU detected after delay";
|
qDebug()<<"OP_DFU detected after delay";
|
||||||
mready=true;
|
mready=true;
|
||||||
break;
|
break;
|
||||||
|
@ -213,7 +213,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
|||||||
m_config->haltButton->setEnabled(true);
|
m_config->haltButton->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
delay::msleep(600);
|
QTimer::singleShot(600, &m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
fwIAP->getField("Command")->setValue("2233");
|
fwIAP->getField("Command")->setValue("2233");
|
||||||
currentStep = IAP_STATE_STEP_2;
|
currentStep = IAP_STATE_STEP_2;
|
||||||
log(QString("IAP Step 2"));
|
log(QString("IAP Step 2"));
|
||||||
@ -228,7 +229,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
|||||||
m_config->haltButton->setEnabled(true);
|
m_config->haltButton->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
delay::msleep(600);
|
QTimer::singleShot(600, &m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
fwIAP->getField("Command")->setValue("3344");
|
fwIAP->getField("Command")->setValue("3344");
|
||||||
currentStep = IAP_STEP_RESET;
|
currentStep = IAP_STEP_RESET;
|
||||||
log(QString("IAP Step 3"));
|
log(QString("IAP Step 3"));
|
||||||
@ -250,8 +252,12 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
|||||||
QString dli = cm->getCurrentDevice().Name;
|
QString dli = cm->getCurrentDevice().Name;
|
||||||
QString dlj = cm->getCurrentDevice().devName;
|
QString dlj = cm->getCurrentDevice().devName;
|
||||||
cm->disconnectDevice();
|
cm->disconnectDevice();
|
||||||
|
QTimer::singleShot(200, &m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
// Tell connections to stop their polling threads: otherwise it will mess up DFU
|
// Tell connections to stop their polling threads: otherwise it will mess up DFU
|
||||||
cm->suspendPolling();
|
cm->suspendPolling();
|
||||||
|
QTimer::singleShot(200, &m_eventloop, SLOT(quit()));
|
||||||
|
m_eventloop.exec();
|
||||||
log("Board Halt");
|
log("Board Halt");
|
||||||
m_config->boardStatus->setText("Bootloader");
|
m_config->boardStatus->setText("Bootloader");
|
||||||
if (dlj.startsWith("USB"))
|
if (dlj.startsWith("USB"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user