add wireless support
This commit is contained in:
+6
-2
@@ -7,8 +7,12 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "libusb-1.0.30/libusb/libusb.h"
|
#include "libusb-1.0.30/libusb/libusb.h"
|
||||||
|
|
||||||
// mouse pid
|
// mouse pids
|
||||||
#define TARGET_VID 0x3554
|
#define TARGET_VID 0x3554
|
||||||
#define TARGET_PID 0xf54d
|
#define TARGET_PID_WIRED 0xf54d
|
||||||
|
#define TARGET_PID_WIRELESS 0xf54f
|
||||||
|
|
||||||
|
// mouse pid helper
|
||||||
|
#define IS_TARGET_PID(pid) ((pid) == TARGET_PID_WIRED || (pid) == TARGET_PID_WIRELESS)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+6
-1
@@ -10,7 +10,12 @@ void run_driver(int sens) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID);
|
// wired/wireless support
|
||||||
|
handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID_WIRED);
|
||||||
|
if (!handle) {
|
||||||
|
handle = libusb_open_device_with_vid_pid(NULL, TARGET_VID, TARGET_PID_WIRELESS);
|
||||||
|
}
|
||||||
|
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
fprintf(stderr, "mouse not found!!\n");
|
fprintf(stderr, "mouse not found!!\n");
|
||||||
libusb_exit(NULL);
|
libusb_exit(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user