mirror of https://github.com/nirenjan/libx52.git
Correct handling of URB for stick axes - closes #1
The le32_to_cpu function doesn't quite work for some reason. Manually writing the 32-bit conversion seems to fix the axes reporting for ABS_X, ABS_Y and ABS_RZ.pull/3/head v0.0.1
parent
75346c745a
commit
2fd5f29ade
|
@ -29,7 +29,10 @@
|
||||||
static void x52pro_decode_urb(struct x52_joy *joy, unsigned char *data)
|
static void x52pro_decode_urb(struct x52_joy *joy, unsigned char *data)
|
||||||
{
|
{
|
||||||
struct input_dev *idev = joy->idev;
|
struct input_dev *idev = joy->idev;
|
||||||
u32 stick_axis = le32_to_cpu(&data[0]);
|
u32 stick_axis = data[3];
|
||||||
|
stick_axis = (stick_axis << 8) | data[2];
|
||||||
|
stick_axis = (stick_axis << 8) | data[1];
|
||||||
|
stick_axis = (stick_axis << 8) | data[0];
|
||||||
|
|
||||||
input_report_key(idev, BTN_TRIGGER_HAPPY1, data[8] & 0x01);
|
input_report_key(idev, BTN_TRIGGER_HAPPY1, data[8] & 0x01);
|
||||||
input_report_key(idev, BTN_TRIGGER_HAPPY2, data[8] & 0x02);
|
input_report_key(idev, BTN_TRIGGER_HAPPY2, data[8] & 0x02);
|
||||||
|
|
Loading…
Reference in New Issue