diff options
Diffstat (limited to 'quantum/joystick.h')
| -rw-r--r-- | quantum/joystick.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/quantum/joystick.h b/quantum/joystick.h index a95472b9f..87dbc24af 100644 --- a/quantum/joystick.h +++ b/quantum/joystick.h | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | #include <stdint.h> | ||
| 6 | |||
| 3 | #ifndef JOYSTICK_BUTTON_COUNT | 7 | #ifndef JOYSTICK_BUTTON_COUNT |
| 4 | # define JOYSTICK_BUTTON_COUNT 8 | 8 | # define JOYSTICK_BUTTON_COUNT 8 |
| 5 | #endif | 9 | #endif |
| @@ -8,9 +12,13 @@ | |||
| 8 | # define JOYSTICK_AXES_COUNT 4 | 12 | # define JOYSTICK_AXES_COUNT 4 |
| 9 | #endif | 13 | #endif |
| 10 | 14 | ||
| 11 | #include "quantum.h" | 15 | #ifndef JOYSTICK_AXES_RESOLUTION |
| 16 | # define JOYSTICK_AXES_RESOLUTION 8 | ||
| 17 | #elif JOYSTICK_AXES_RESOLUTION < 8 || JOYSTICK_AXES_RESOLUTION > 16 | ||
| 18 | # error JOYSTICK_AXES_RESOLUTION must be between 8 and 16 | ||
| 19 | #endif | ||
| 12 | 20 | ||
| 13 | #include <stdint.h> | 21 | #define JOYSTICK_RESOLUTION ((1L << (JOYSTICK_AXES_RESOLUTION - 1)) - 1) |
| 14 | 22 | ||
| 15 | // configure on input_pin of the joystick_axes array entry to JS_VIRTUAL_AXIS | 23 | // configure on input_pin of the joystick_axes array entry to JS_VIRTUAL_AXIS |
| 16 | // to prevent it from being read from the ADC. This allows outputing forged axis value. | 24 | // to prevent it from being read from the ADC. This allows outputing forged axis value. |
