Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Driver] mk_arcade_joystick_rpi GPIO Driver
At this point, I don't want to push a update to Github for this "work in process" modification.

- [Pushed to Github] debug parameter added to output various debug data to dmesg.
- [Pushed to Github] ADC_OffsetCenter() : constrain corrected value for 0-4095 to 1-4094 to try to fix Reicast analog input overflow when using evdev.
- [Pushed to Github] adc_val default is now 2048 (was 0).

Attached file is not to be considered a update but a testing file.
So after some dig, when the driver fail to get analog value, there is 2 possibles return:
110 : Connection timed out
5 : I/O error (due to noises?)

Maybe found the source and the solution for the i2c problems.

To my understand i2c-bcm2708 driver emulate SMbus functionality, there is part of the problem if the CPU is not able to track all simultaneous (or in a very short time) transactions.

The solution so far is to change in /boot/config.txt :  "dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6" to "dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6,combine=off"
Due to how evdev work, this is a "glitch" when a program read analog value from '/dev/input/input0', this can be easily seen via 'evtest'.
Fuzz and deadzone parameters are simply ignored.
This problem does not exist when reading from '/dev/input/js0' via jstest.

Edit: This is normal, evdev and joystick are 2 different things.

The workaround for deadzone could is to constrain the analog values in the driver.
For fuzz, there is nothing to do.

/include/uapi/linux/input.h:66 : struct input_absinfo
@flat: values that are within this value will be discarded by joydev interface and reported as 0 instead.

- [Pushed to Github] Workaround to apply analog deadzone to evdev, addition of ADC_Deadzone() function, no additional modification in config file.

Forum Jump:

Users browsing this thread: 1 Guest(s)