From 0aa25d2c95a71fc45cc93bb2336aef0e39b8a702 Mon Sep 17 00:00:00 2001 From: Matlo Date: Sat, 14 Nov 2015 09:05:43 +0100 Subject: [PATCH] [G29 emulation] Allow to use the G920 and G29 wheels #361 --- core/adapter.c | 32 +------------------------------- core/ffb_logitech.c | 2 ++ shared/async/include/hidasync.h | 2 ++ 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/core/adapter.c b/core/adapter.c index 99285052..e16daef1 100644 --- a/core/adapter.c +++ b/core/adapter.c @@ -563,39 +563,9 @@ void adapter_set_usb_ids(int controller, unsigned short vendor, unsigned short p } } -static unsigned short lg_wheel_products[] = { - USB_DEVICE_ID_LOGITECH_WINGMAN_FFG, - USB_DEVICE_ID_LOGITECH_WHEEL, - USB_DEVICE_ID_LOGITECH_MOMO_WHEEL, - USB_DEVICE_ID_LOGITECH_DFP_WHEEL, - USB_DEVICE_ID_LOGITECH_G25_WHEEL, - USB_DEVICE_ID_LOGITECH_DFGT_WHEEL, - USB_DEVICE_ID_LOGITECH_G27_WHEEL, - USB_DEVICE_ID_LOGITECH_WII_WHEEL, - USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2, - USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL, -}; - -static int is_logitech_wheel(unsigned short vendor, unsigned short product) { - - if(vendor != USB_VENDOR_ID_LOGITECH) - { - return 0; - } - unsigned int i; - for(i = 0; i < sizeof(lg_wheel_products) / sizeof(*lg_wheel_products); ++i) - { - if(lg_wheel_products[i] == product) - { - return 1; - } - } - return 0; -} - static int start_hid(int id) { - if(is_logitech_wheel(adapter[id].usb_ids.vendor, adapter[id].usb_ids.product)) + if(ffb_logitech_is_logitech_wheel(adapter[id].usb_ids.vendor, adapter[id].usb_ids.product)) { adapter[id].hid_id = hidasync_open_ids(adapter[id].usb_ids.vendor, adapter[id].usb_ids.product); if(adapter[id].hid_id >= 0) diff --git a/core/ffb_logitech.c b/core/ffb_logitech.c index 73cd0a3d..9376b480 100644 --- a/core/ffb_logitech.c +++ b/core/ffb_logitech.c @@ -673,6 +673,8 @@ static unsigned short lg_wheel_products[] = { USB_DEVICE_ID_LOGITECH_WII_WHEEL, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2, USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL, + USB_DEVICE_ID_LOGITECH_G920_WHEEL, + USB_DEVICE_ID_LOGITECH_G29_WHEEL, }; int ffb_logitech_is_logitech_wheel(unsigned short vendor, unsigned short product) { diff --git a/shared/async/include/hidasync.h b/shared/async/include/hidasync.h index b6a7e0d5..132af206 100644 --- a/shared/async/include/hidasync.h +++ b/shared/async/include/hidasync.h @@ -24,6 +24,8 @@ extern "C" { #define USB_DEVICE_ID_LOGITECH_WII_WHEEL 0xc29c #define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 0xca03 #define USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL 0xca04 +#define USB_DEVICE_ID_LOGITECH_G920_WHEEL 0xc262 +#define USB_DEVICE_ID_LOGITECH_G29_WHEEL 0xc24f struct hid_device;