Skip to content

Commit

Permalink
[G29 emulation] Allow to use the G920 and G29 wheels #361
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlo committed Nov 14, 2015
1 parent f311613 commit 0aa25d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
32 changes: 1 addition & 31 deletions core/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions core/ffb_logitech.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions shared/async/include/hidasync.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0aa25d2

Please sign in to comment.