1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-35 Update to GCS Uploader plugin to reflect latest BL changes. Bug fixes too, should be more stable & reliable.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2138 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-11-22 22:31:59 +00:00 committed by edouard
parent d57441e8f4
commit d233d65e86
2 changed files with 34 additions and 17 deletions

View File

@ -116,7 +116,18 @@ void deviceWidget::uploadFirmware()
return;
}
status("Starting firmware upload.");
status("Starting firmware upload");
// We don't know which device was used previously, so we
// are cautious and reenter DFU for this deviceID:
if(!m_dfu->enterDFU(deviceID))
{
status("Error:Could not enter DFU mode");
return;
}
OP_DFU::Status ret=m_dfu->StatusRequest();
qDebug() << m_dfu->StatusToString(ret);
m_dfu->AbortOperation(); // Necessary, otherwise I get random failures.
connect(m_dfu, SIGNAL(progressUpdated(int)), this, SLOT(setProgress(int)));
connect(m_dfu, SIGNAL(operationProgress(QString)), this, SLOT(status(QString)));
connect(m_dfu, SIGNAL(uploadFinished(OP_DFU::Status)), this, SLOT(uploadFinished(OP_DFU::Status)));

View File

@ -241,25 +241,39 @@ void UploaderGadgetWidget::systemRescue()
log("** Follow those instructions to attempt a system rescue **");
log("**********************************************************");
log("You will be prompted to first connect USB, then system power");
log ("Connect USB in 3 seconds...");
log ("Connect USB in 2 seconds...");
rescueStep = RESCUE_STEP1;
QTimer::singleShot(1000, this, SLOT(systemRescue()));
}
break;
case RESCUE_STEP1:
rescueStep = RESCUE_STEP2;
log (" ...2...");
log (" ...1...");
QTimer::singleShot(1000, this, SLOT(systemRescue()));
break;
case RESCUE_STEP2:
rescueStep = RESCUE_STEP3;
log(" ...1...");
log(" ...Now!");
QTimer::singleShot(1000, this, SLOT(systemRescue()));
break;
case RESCUE_STEP3:
log("... NOW!\n***\n");
log("Connect Power in 1 second...");
rescueStep = RESCUE_POWER2;
log("... Detecting Mainboard...");
repaint();
if (!dfu)
dfu = new DFUObject(true);
dfu->AbortOperation();
if(!dfu->enterDFU(0))
{
log("Could not enter DFU mode.");
return;
}
if(!dfu->findDevices())
{
log("Could not detect mainboard.");
return;
}
rescueStep = RESCUE_POWER1;
log("Connect Power in 2 second...");
QTimer::singleShot(1000, this, SLOT(systemRescue()));
break;
case RESCUE_POWER1:
@ -270,19 +284,12 @@ void UploaderGadgetWidget::systemRescue()
case RESCUE_POWER2:
log("... NOW!\n***\nWaiting...");
rescueStep = RESCUE_DETECT;
QTimer::singleShot(3000, this, SLOT(systemRescue()));
QTimer::singleShot(4000, this, SLOT(systemRescue()));
break;
case RESCUE_DETECT:
rescueStep = RESCUE_STEP0;
log("Polling for devices...");
log("Detecting AHRS...");
repaint();
if (!dfu)
dfu = new DFUObject(true);
if(!dfu->enterDFU(0))
{
log("Could not enter DFU mode.");
return;
}
if(!dfu->findDevices())
{
log("Could not detect devices.");
@ -304,7 +311,6 @@ void UploaderGadgetWidget::systemRescue()
m_config->resetButton->setEnabled(false);
m_config->bootButton->setEnabled(true);
currentStep = IAP_STATE_BOOTLOADER; // So that we can boot from the GUI afterwards.
}