From c05e8afe454bf3706d69314c251dc5266c557007 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 27 Mar 2022 05:38:09 +1100 Subject: Joystick feature updates (#16732) * Joystick feature updates * Move new functions to joystick.h * Docs --- quantum/joystick.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'quantum/joystick.h') diff --git a/quantum/joystick.h b/quantum/joystick.h index 9156491aca..002df3a6d9 100644 --- a/quantum/joystick.h +++ b/quantum/joystick.h @@ -1,8 +1,7 @@ #pragma once -#include "quantum.h" - #include +#include "gpio.h" #ifndef JOYSTICK_BUTTON_COUNT # define JOYSTICK_BUTTON_COUNT 8 @@ -58,5 +57,7 @@ typedef struct { extern joystick_t joystick_status; -// to be implemented in the hid protocol library -void send_joystick_packet(joystick_t *joystick); +void joystick_flush(void); + +void register_joystick_button(uint8_t button); +void unregister_joystick_button(uint8_t button); -- cgit v1.2.3 From 645359e5d06758172fe3b6c22ad62641af56b4ad Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 26 Apr 2022 08:54:34 +1000 Subject: Joystick: Simplify report descriptor and clean up error messages (#16926) --- quantum/joystick.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'quantum/joystick.h') diff --git a/quantum/joystick.h b/quantum/joystick.h index 002df3a6d9..5d81b14ef2 100644 --- a/quantum/joystick.h +++ b/quantum/joystick.h @@ -5,10 +5,18 @@ #ifndef JOYSTICK_BUTTON_COUNT # define JOYSTICK_BUTTON_COUNT 8 +#elif JOYSTICK_BUTTON_COUNT > 32 +# error Joystick feature only supports up to 32 buttons #endif #ifndef JOYSTICK_AXES_COUNT # define JOYSTICK_AXES_COUNT 4 +#elif JOYSTICK_AXES_COUNT > 6 +# error Joystick feature only supports up to 6 axes +#endif + +#if JOYSTICK_AXES_COUNT == 0 && JOYSTICK_BUTTON_COUNT == 0 +# error Joystick feature requires at least one axis or button #endif #ifndef JOYSTICK_AXES_RESOLUTION -- cgit v1.2.3