Merge branch 'hid_joystick' of git://github.com/a-chol/qmk_firmware into a-chol-hid_joystick

This commit is contained in:
Jack Humbert 2020-05-04 13:19:48 -04:00
commit 708bb4f55d
23 changed files with 1556 additions and 5 deletions

View file

@ -71,6 +71,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef MIDI_ENABLE
# include "process_midi.h"
#endif
#ifdef JOYSTICK_ENABLE
# include "process_joystick.h"
#endif
#ifdef HD44780_ENABLE
# include "hd44780.h"
#endif
@ -403,6 +406,10 @@ MATRIX_LOOP_END:
}
#endif
#ifdef JOYSTICK_ENABLE
joystick_task();
#endif
// update LED
if (led_status != host_keyboard_leds()) {
led_status = host_keyboard_leds();

View file

@ -29,7 +29,8 @@ enum hid_report_ids {
REPORT_ID_MOUSE,
REPORT_ID_SYSTEM,
REPORT_ID_CONSUMER,
REPORT_ID_NKRO
REPORT_ID_NKRO,
REPORT_ID_JOYSTICK
};
/* Mouse buttons */
@ -186,6 +187,16 @@ typedef struct {
int8_t h;
} __attribute__((packed)) report_mouse_t;
typedef struct {
#if JOYSTICK_AXES_COUNT > 0
int8_t axes[JOYSTICK_AXES_COUNT];
#endif
#if JOYSTICK_BUTTON_COUNT > 0
uint8_t buttons[(JOYSTICK_BUTTON_COUNT - 1) / 8 + 1];
#endif
} __attribute__((packed)) joystick_report_t;
/* keycode to system usage */
static inline uint16_t KEYCODE2SYSTEM(uint8_t key) {
switch (key) {