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

Commit 2c5e1d7

Browse files
committed
performed hathach suggested changes
1 parent 07efeb1 commit 2c5e1d7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tinyusb/src/class/hid/hid.h

Lines changed: 2 additions & 2 deletions
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-
uint16_t hat; /**< buttons mask for currently pressed buttons in the gamepad hat */
160+
uint8_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)
@@ -178,7 +178,7 @@ typedef enum
178178
GAMEPAD_BUTTON_MODE = TU_BIT(12), ///< Mode button
179179
GAMEPAD_BUTTON_THUMBL = TU_BIT(13), ///< L3 button
180180
GAMEPAD_BUTTON_THUMBR = TU_BIT(14), ///< R3 button
181-
GAMEPAD_BUTTON_ = TU_BIT(15), ///< Undefined button
181+
//GAMEPAD_BUTTON_ = TU_BIT(15), ///< Undefined button
182182
}hid_gamepad_button_bm_t;
183183

184184
/// Standard Gamepad HAT/DPAD Buttons Bitmap (from Linux input event codes)

tinyusb/src/class/hid/hid_device.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,13 @@ 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-
/* 16 bit Hat Button Map */ \
279+
/* 8 bit Hat Button Map */ \
280280
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
281281
HID_USAGE ( HID_USAGE_DESKTOP_HAT_SWITCH ) ,\
282-
HID_LOGICAL_MIN ( 1 ) ,\
282+
HID_LOGICAL_MIN ( 0 ) ,\
283283
HID_LOGICAL_MAX ( 8 ) ,\
284284
HID_PHYSICAL_MIN ( 0 ) ,\
285-
HID_PHYSICAL_MAX ( 315 ) ,\
285+
HID_PHYSICAL_MAX_N ( 315, 2 ) ,\
286286
HID_REPORT_COUNT ( 1 ) ,\
287287
HID_REPORT_SIZE ( 8 ) ,\
288288
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\

0 commit comments

Comments
 (0)