Fix Joystick HID detection, add ADC Joystick mode, fix build on MacOS#408
Fix Joystick HID detection, add ADC Joystick mode, fix build on MacOS#408dim13 wants to merge 14 commits intoOpenI6X:masterfrom
Conversation
|
Test firmware: openi6x-1.11.1-joystick.bin.gz -- confirmed to work on MacOS, Debian 10 and Windows 7. SHA1 (openi6x-1.11.1-joystick.bin) = b43928371f537b7026863470da6ee12885806aa2 |
|
In order to build natively on Mac, you'll need instead of as it is missing includes. |
|
successfully built the firmware on a mac with sonoma 14.5 and flashed i6x and tested as a joystick successfully using https://hardwaretester.com/gamepad |
|
Closes #275 |
|
Raw ADC test firmware: Reduces number of axels to 6 (4 axes + 2 potentiometers) and buttons number to 8 (the upper half wasn't used anyway):
|
ajjjjjjjj
left a comment
There was a problem hiding this comment.
Thanks for the fix!
This issue gave me a lot of headaches.
| #else | ||
| if (USBD_HID_SendReport(&USB_OTG_dev, 0, 0) == USBD_OK) { | ||
| #endif | ||
| //buttons |
There was a problem hiding this comment.
Also here - please keep it as in EdgeTX/OpenTX, it keeps this project as close to EdgeTX as possible to backport features and track issues, see:
https://github.com/EdgeTX/edgetx/blob/main/radio/src/targets/common/arm/stm32/usb_driver.cpp
There was a problem hiding this comment.
I would argue, that upstream implementation is plain broken and not worth to keep. Even with detection fix it does not work as generally expected. For example it depends on currently chosen model. You get different results with different models.
I would say, that it is would be more expected for it to "just work" as game controller independent from transmitter settings.
However I'm willing to keep old broken implementation in-place and make it configurable instead.
However keep in mind, that buttons are not working at all with old definition.
There was a problem hiding this comment.
Buttons are not working, or are not set up in model inputs?
| { | ||
| 0x05, 0x01, // USAGE_PAGE (Generic Desktop) | ||
| 0x09, 0x05, // USAGE (Game Pad) | ||
| 0x09, 0x04, // USAGE (Joystick) |
There was a problem hiding this comment.
It is 0x05 in EdgeTX, I'm not against the change but is there a specific reason to change it?
There was a problem hiding this comment.
Value from original firmware, IMHO more suitable for the use. Doesn't do much however.
There was a problem hiding this comment.
As this is port of OpenTX/EdgeTX and there is no specific reason to change that, it should stay as it was.
|
I finally have tested it on Linux: Crrcsim, jstest-gtk, . Some other thoughts:
I have cherry picked your original change with your name as the author. I hope you don't mind. |

Fix detection of Joystick HID on MacOS.
Cleanup mis-configured HID descriptor.
Fix native build on MacOS.
Closes #129
Relates to #152, #348, #401
The magic part was:
Tested with https://www.geo-fs.com/, AbsoluteRC, Heli-X10 and crrcsim.