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

Wyświetl plik

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

Wyświetl plik

@ -3509,7 +3509,7 @@ void wfmain::doCmd(commandtype cmddata)
case cmdGetBandStackReg:
{
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;
emit getBandStackReg(bandStkBand, bandStkRegCode);
break;