1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Fix "Halt" command on Windows XP sp2.

This commit is contained in:
elafargue 2011-05-10 21:19:51 +02:00
parent 94c49ac6d0
commit d5fbc0be4d

View File

@ -29,10 +29,12 @@
#include <cmath>
#include <qwaitcondition.h>
#include <QMetaType>
#include <QApplication>
using namespace OP_DFU;
DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname): debug(_debug),use_serial(_use_serial),mready(true)
DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname):
debug(_debug),use_serial(_use_serial),mready(true)
{
info = NULL;
@ -88,6 +90,10 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname): debug(_debu
if (debug)
qDebug() << ".";
delay::msleep(500);
// processEvents enables XP to process the system
// plug/unplug events, otherwise it will not process
// those events before the end of the call!
QApplication::processEvents();
devices = USBMonitor::instance()->availableDevices(0x20a0,-1,-1,USBMonitor::Bootloader);
count++;
}
@ -95,6 +101,7 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname): debug(_debu
hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0);
} else {
qDebug() << "More than one device, don't know what to do!";
mready = false;
}
}