Defuzz additional axes
Add .ffb file for effect testing Mention Monocoque in readme for telemetry stuff
This commit is contained in:
committed by
Tomasz Pakuła
parent
9e27df12cb
commit
092bdbd661
@@ -12,6 +12,9 @@
|
||||
#include "hid-ids.h"
|
||||
#include "hid-pidff.h"
|
||||
|
||||
#define MOZA_ADDITIONAL_AXES {ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ, ABS_THROTTLE, ABS_RUDDER}
|
||||
#define CAMMUS_ADDITIONAL_AXES {}
|
||||
|
||||
static const struct hid_device_id pidff_wheel_devices[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_MOZA, USB_DEVICE_ID_MOZA_R3),
|
||||
.driver_data = PIDFF_QUIRK_FIX_WHEEL_DIRECTION },
|
||||
@@ -87,11 +90,42 @@ err:
|
||||
static int universal_pidff_input_configured(struct hid_device *hdev,
|
||||
struct hid_input *hidinput)
|
||||
{
|
||||
// Remove fuzz and deadzone
|
||||
// Remove fuzz and deadzone from the wheel axis
|
||||
struct input_dev *input = hidinput->input;
|
||||
input_set_abs_params(input, ABS_X,
|
||||
input->absinfo[ABS_X].minimum, input->absinfo[ABS_X].maximum, 0, 0);
|
||||
|
||||
// Decrease fuzz and deadzone on additional axes
|
||||
// Default Linux values are 255 for fuzz and 4096 for flat (deadzone)
|
||||
short *additional_axes;
|
||||
short moza_axes[] = MOZA_ADDITIONAL_AXES;
|
||||
short cammus_axes[] = CAMMUS_ADDITIONAL_AXES;
|
||||
short axes_cnt = 0;
|
||||
|
||||
switch (hdev->vendor)
|
||||
{
|
||||
case USB_VENDOR_ID_MOZA:
|
||||
hid_dbg(hdev, "Defuzzing MOZA wheelbase");
|
||||
additional_axes = moza_axes;
|
||||
axes_cnt = sizeof(moza_axes) / sizeof(moza_axes[0]);
|
||||
break;
|
||||
|
||||
case USB_VENDOR_ID_CAMMUS:
|
||||
hid_dbg(hdev, "Defuzzing CAMMUS wheelbase");
|
||||
additional_axes = cammus_axes;
|
||||
axes_cnt = sizeof(cammus_axes) / sizeof(cammus_axes[0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Perform defuzzing
|
||||
for (short i = 0; i < axes_cnt; i++)
|
||||
input_set_abs_params(input, additional_axes[i],
|
||||
input->absinfo[additional_axes[i]].minimum,
|
||||
input->absinfo[additional_axes[i]].maximum, 32, 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user