Fix compile issues

half-duplex
Phil Taylor 2023-01-12 19:39:35 +00:00
rodzic 0d9a01cd1f
commit b45bf9ce41
3 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -20,11 +20,13 @@ usbController::~usbController()
qInfo(logUsbControl) << "Ending usbController()"; qInfo(logUsbControl) << "Ending usbController()";
hid_close(handle); hid_close(handle);
hid_exit(); hid_exit();
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
if (gamepad != Q_NULLPTR) if (gamepad != Q_NULLPTR)
{ {
delete gamepad; delete gamepad;
gamepad = Q_NULLPTR; gamepad = Q_NULLPTR;
} }
#endif
} }
void usbController::init() void usbController::init()
@ -78,7 +80,7 @@ void usbController::run()
QTimer::singleShot(1000, this, SLOT(run())); QTimer::singleShot(1000, this, SLOT(run()));
return; return;
} }
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
if (gamepad == Q_NULLPTR) { if (gamepad == Q_NULLPTR) {
auto gamepads = QGamepadManager::instance()->connectedGamepads(); auto gamepads = QGamepadManager::instance()->connectedGamepads();
if (!gamepads.isEmpty()) { if (!gamepads.isEmpty()) {
@ -182,7 +184,7 @@ void usbController::run()
delete gamepad; delete gamepad;
gamepad = Q_NULLPTR; gamepad = Q_NULLPTR;
} }
#endif
handle = hid_open(0x0b33, 0x0020, NULL); handle = hid_open(0x0b33, 0x0020, NULL);
if (!handle) { if (!handle) {

Wyświetl plik

@ -11,8 +11,9 @@
#include <QColor> #include <QColor>
#include <QVector> #include <QVector>
#if defined(USB_CONTROLLER) #if defined(USB_CONTROLLER) && QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QGamepad> #include <QGamepad>
#endif
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
#include "hidapi/hidapi.h" #include "hidapi/hidapi.h"
@ -24,7 +25,6 @@
//Headers needed for sleeping. //Headers needed for sleeping.
#include <unistd.h> #include <unistd.h>
#endif #endif
#endif
// Include these so we have the various enums // Include these so we have the various enums
#include "rigidentities.h" #include "rigidentities.h"
@ -122,7 +122,9 @@ private:
QString product=""; QString product="";
QString manufacturer=""; QString manufacturer="";
QString serial="<none>"; QString serial="<none>";
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
QGamepad* gamepad=Q_NULLPTR; QGamepad* gamepad=Q_NULLPTR;
#endif
void buttonState(QString but, bool val); void buttonState(QString but, bool val);
void buttonState(QString but, double val); void buttonState(QString but, double val);

Wyświetl plik

@ -3509,7 +3509,7 @@ void wfmain::doCmd(commandtype cmddata)
case cmdGetBandStackReg: case cmdGetBandStackReg:
{ {
char band = (*std::static_pointer_cast<char>(data)); char band = (*std::static_pointer_cast<char>(data));
bandStkBand = rigCaps.bsr[band]; // 23cm Needs fixing bandStkBand = rigCaps.bsr[(availableBands)band]; // 23cm Needs fixing
bandStkRegCode = ui->bandStkPopdown->currentIndex() + 1; bandStkRegCode = ui->bandStkPopdown->currentIndex() + 1;
emit getBandStackReg(bandStkBand, bandStkRegCode); emit getBandStackReg(bandStkBand, bandStkRegCode);
break; break;