mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-19 09:54:15 +01:00
OP-248 Enable serial device polling on Windows too as automatic detection seems to be unreliable.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2354 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9827746847
commit
79f72bda47
@ -76,19 +76,24 @@ SerialConnection::SerialConnection()
|
||||
: m_enumerateThread(this)
|
||||
{
|
||||
serialHandle = NULL;
|
||||
#ifdef Q_OS_WIN
|
||||
//I'm cheating a little bit here:
|
||||
//Knowing if the device enumeration really changed is a bit complicated
|
||||
//so I just signal it whenever we have a device event...
|
||||
QMainWindow *mw = Core::ICore::instance()->mainWindow();
|
||||
QObject::connect(mw, SIGNAL(deviceChange()),
|
||||
this, SLOT(onEnumerationChanged()));
|
||||
#else
|
||||
|
||||
// Experimental: enable polling on all OS'es since there
|
||||
// were reports that autodetect does not work on XP amongst
|
||||
// others.
|
||||
|
||||
//#ifdef Q_OS_WIN
|
||||
// //I'm cheating a little bit here:
|
||||
// //Knowing if the device enumeration really changed is a bit complicated
|
||||
// //so I just signal it whenever we have a device event...
|
||||
// QMainWindow *mw = Core::ICore::instance()->mainWindow();
|
||||
// QObject::connect(mw, SIGNAL(deviceChange()),
|
||||
// this, SLOT(onEnumerationChanged()));
|
||||
//#else
|
||||
// Other OSes do not send such signals:
|
||||
QObject::connect(&m_enumerateThread, SIGNAL(enumerationChanged()),
|
||||
this, SLOT(onEnumerationChanged()));
|
||||
m_enumerateThread.start();
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
SerialConnection::~SerialConnection()
|
||||
|
Loading…
x
Reference in New Issue
Block a user