mirror of
https://github.com/speedypotato/Pico-Game-Controller.git
synced 2026-10-12 00:58:17 +03:00
Switched to Joystick mode for mobile compatibility
This commit is contained in:
@@ -7,7 +7,7 @@ Currently working/fixed:
|
||||
- Gamepad mode - default boot mode
|
||||
- Keyboard & Mouse Mode - limited to 6KRO - hold btn-a to enter kb mode
|
||||
- HID LEDs with Reactive LED fallback
|
||||
- sdvx/iidx spoof - untested on EAC
|
||||
- sdvx/iidx spoof - Tested on EAC
|
||||
- 1000hz polling
|
||||
- Reversable Encoders
|
||||
- Switch and LED pins are now staggered for easier wiring
|
||||
|
||||
Binary file not shown.
@@ -145,7 +145,7 @@ void joy_mode() {
|
||||
}
|
||||
|
||||
if (send_report) {
|
||||
tud_hid_n_report(0x00, REPORT_ID_GAMEPAD, &report, sizeof(report));
|
||||
tud_hid_n_report(0x00, REPORT_ID_JOYSTICK, &report, sizeof(report));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ uint8_t const* tud_descriptor_device_cb(void) {
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
uint8_t const desc_hid_report[] = {
|
||||
GAMECON_REPORT_DESC_GAMEPAD(HID_REPORT_ID(REPORT_ID_GAMEPAD)),
|
||||
GAMECON_REPORT_DESC_JOYSTICK(HID_REPORT_ID(REPORT_ID_JOYSTICK)),
|
||||
GAMECON_REPORT_DESC_LIGHTS(HID_REPORT_ID(REPORT_ID_LIGHTS)),
|
||||
TUD_HID_REPORT_DESC_KEYBOARD(HID_REPORT_ID(REPORT_ID_KEYBOARD)),
|
||||
TUD_HID_REPORT_DESC_MOUSE(HID_REPORT_ID(REPORT_ID_MOUSE))};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define USB_DESCRIPTORS_H_
|
||||
|
||||
enum {
|
||||
REPORT_ID_GAMEPAD = 1,
|
||||
REPORT_ID_JOYSTICK = 1,
|
||||
REPORT_ID_LIGHTS,
|
||||
REPORT_ID_KEYBOARD,
|
||||
REPORT_ID_MOUSE,
|
||||
@@ -13,11 +13,11 @@ enum {
|
||||
|
||||
#endif /* USB_DESCRIPTORS_H_ */
|
||||
|
||||
// Gamepad Report Descriptor Template - Based off Drewol/rp2040-gamecon
|
||||
// Joystick Report Descriptor Template - Based off Drewol/rp2040-gamecon
|
||||
// 11 Button Map | X | Y
|
||||
#define GAMECON_REPORT_DESC_GAMEPAD(...) \
|
||||
#define GAMECON_REPORT_DESC_JOYSTICK(...) \
|
||||
HID_USAGE_PAGE(HID_USAGE_PAGE_DESKTOP), \
|
||||
HID_USAGE(HID_USAGE_DESKTOP_GAMEPAD), \
|
||||
HID_USAGE(HID_USAGE_DESKTOP_JOYSTICK), \
|
||||
HID_COLLECTION(HID_COLLECTION_APPLICATION), \
|
||||
__VA_ARGS__ HID_USAGE_PAGE(HID_USAGE_PAGE_BUTTON), HID_USAGE_MIN(1), \
|
||||
HID_USAGE_MAX(11), /*11 buttons*/ \
|
||||
|
||||
Reference in New Issue
Block a user