Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight refactor of joystick axis type into typedef #22445

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tmk_core/protocol/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,18 @@ typedef struct {
uint16_t y;
} PACKED report_digitizer_t;

#if JOYSTICK_AXIS_RESOLUTION > 8
typedef int16_t joystick_axis_t;
#else
typedef int8_t joystick_axis_t;
#endif

typedef struct {
#ifdef JOYSTICK_SHARED_EP
uint8_t report_id;
#endif
#if JOYSTICK_AXIS_COUNT > 0
# if JOYSTICK_AXIS_RESOLUTION > 8
int16_t axes[JOYSTICK_AXIS_COUNT];
# else
int8_t axes[JOYSTICK_AXIS_COUNT];
# endif
joystick_axis_t axes[JOYSTICK_AXIS_COUNT];
#endif

#if JOYSTICK_BUTTON_COUNT > 0
Expand Down