Fix bool option setting and add xinput driver install callback

This commit is contained in:
Ian Scott committed 2024-07-07 17:51:42 -06:00
1 parent afd68487c1
commit 6a7c1eb50a
2 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -366,7 +366,7 @@ if (e != 1) { \
usage(argv[0], mode, false); \
return 5; \
} \
option = (tmp_arg[0] == 1) ? 1 : 0;
option = (tmp_arg[0] == '1') ? 1 : 0;
#define process_port_opt(option) \
+5
View File
@@ -335,6 +335,11 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons
}
#ifdef USB_JOYSTICK
usbh_class_driver_t const* usbh_app_driver_get_cb(uint8_t* driver_count) {
*driver_count = 1;
return &usbh_xinput_driver;
}
static inline void update_joystate_xinput(uint16_t wButtons, int16_t sThumbLX, int16_t sThumbLY, int16_t sThumbRX, int16_t sThumbRY, uint8_t bLeftTrigger, uint8_t bRightTrigger) {
uint8_t dpad = wButtons & 0xf;
if (!dpad) {