mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Improve Uploader gadget widget behaviour when clicking on halt & boot (prevent double clicking)
This commit is contained in:
parent
50f1e15f54
commit
65201ec81c
@ -100,7 +100,7 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname):
|
||||
if (devices.length()==1) {
|
||||
hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0);
|
||||
} else {
|
||||
qDebug() << "More than one device, don't know what to do!";
|
||||
qDebug() << devices.length() << " device(s) detected, don't know what to do!";
|
||||
mready = false;
|
||||
}
|
||||
|
||||
|
@ -161,6 +161,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
|
||||
switch (currentStep) {
|
||||
case IAP_STATE_READY:
|
||||
m_config->haltButton->setEnabled(false);
|
||||
getSerialPorts(); // Useful in case a new serial port appeared since the initial list,
|
||||
// otherwise we won't find it when we stop the board.
|
||||
// The board is running, send the 1st IAP Reset order:
|
||||
@ -179,6 +180,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
log("Reset did NOT happen");
|
||||
currentStep = IAP_STATE_READY;
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
delay::msleep(600);
|
||||
@ -193,6 +195,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
log("Reset did NOT happen");
|
||||
currentStep = IAP_STATE_READY;
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
delay::msleep(600);
|
||||
@ -208,6 +211,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
log("Oops, failure step 3");
|
||||
log("Reset did NOT happen");
|
||||
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool)));
|
||||
m_config->haltButton->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -247,6 +251,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
cm->resumePolling();
|
||||
currentStep = IAP_STATE_READY;
|
||||
m_config->boardStatus->setText("Bootloader?");
|
||||
m_config->haltButton->setEnabled(true);
|
||||
return;
|
||||
}
|
||||
dfu->AbortOperation();
|
||||
@ -353,7 +358,6 @@ void UploaderGadgetWidget::systemBoot()
|
||||
log("Could not enter DFU mode.");
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
m_config->bootButton->setEnabled(true);
|
||||
return;
|
||||
}
|
||||
log("Booting system...");
|
||||
|
Loading…
Reference in New Issue
Block a user