kopia lustrzana https://gitlab.com/eliggett/wfview
Fix for old hidapi without version info.
rodzic
0ff2551026
commit
1515e135e5
|
@ -42,7 +42,7 @@ void usbController::init(int sens)
|
||||||
{
|
{
|
||||||
sensitivity = sens;
|
sensitivity = sens;
|
||||||
emit sendSensitivity(sensitivity);
|
emit sendSensitivity(sensitivity);
|
||||||
|
#ifdef HID_API_VERSION_MAJOR
|
||||||
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
|
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
|
||||||
qInfo(logUsbControl) << QString("Compile-time version matches runtime version of hidapi: %0.%1.%2")
|
qInfo(logUsbControl) << QString("Compile-time version matches runtime version of hidapi: %0.%1.%2")
|
||||||
.arg(hid_version()->major)
|
.arg(hid_version()->major)
|
||||||
|
@ -58,7 +58,7 @@ void usbController::init(int sens)
|
||||||
.arg(hid_version()->minor)
|
.arg(hid_version()->minor)
|
||||||
.arg(hid_version()->patch);
|
.arg(hid_version()->patch);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
hidStatus = hid_init();
|
hidStatus = hid_init();
|
||||||
if (hidStatus) {
|
if (hidStatus) {
|
||||||
qInfo(logUsbControl()) << "Failed to intialize HID Devices";
|
qInfo(logUsbControl()) << "Failed to intialize HID Devices";
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "hidapi.h"
|
#include "hidapi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HID_API_VERSION_MAJOR
|
||||||
#ifndef HID_API_MAKE_VERSION
|
#ifndef HID_API_MAKE_VERSION
|
||||||
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
|
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,7 +30,6 @@
|
||||||
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
|
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
|
#if defined(__APPLE__) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
|
||||||
#include <hidapi/hidapi_darwin.h>
|
#include <hidapi/hidapi_darwin.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if defined(USING_HIDAPI_LIBUSB) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
|
#if defined(USING_HIDAPI_LIBUSB) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
|
||||||
#include <hidapi_libusb.h>
|
#include <hidapi_libusb.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
|
|
Ładowanie…
Reference in New Issue