Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.

Commit 07efeb1

Browse files
committed
Change to 16 bit for hat button field
1 parent dd1be07 commit 07efeb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tinyusb/src/class/hid/hid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ typedef struct TU_ATTR_PACKED
157157
int8_t y; /**< Current delta y movement of the gamepad joystick 1. */
158158
int8_t z; /**< Current delta z movement of the gamepad joystick 2. */
159159
int8_t r_z; /**< Current delta r_z movement of the gamepad joystick 2. */
160-
uint8_t hat; /**< buttons mask for currently pressed buttons in the gamepad hat */
160+
uint16_t hat; /**< buttons mask for currently pressed buttons in the gamepad hat */
161161
}hid_gamepad_report_t;
162162

163163
/// Standard Gamepad Buttons Bitmap (from Linux input event codes)

tinyusb/src/class/hid/hid_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ TU_ATTR_WEAK bool tud_hid_set_idle_cb(uint8_t idle_rate);
276276
HID_REPORT_COUNT ( 4 ) ,\
277277
HID_REPORT_SIZE ( 8 ) ,\
278278
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
279-
/* 8 bit Hat Button Map */ \
279+
/* 16 bit Hat Button Map */ \
280280
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
281281
HID_USAGE ( HID_USAGE_DESKTOP_HAT_SWITCH ) ,\
282282
HID_LOGICAL_MIN ( 1 ) ,\

0 commit comments

Comments
 (0)