diff options
author | Ryan <fauxpark@gmail.com> | 2022-11-27 03:14:45 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 03:14:45 +1100 |
commit | 1e95f7be8f214c544bf99f415916a4a5f07a1e9b (patch) | |
tree | 99e7148ab4c464f40da8f0ee01e079843a26cf14 /keyboards | |
parent | a5a20cc792540c0de61f064bd8dafcdc5815d4cc (diff) |
Joystick feature improvements (#19052)
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/handwired/battleship_gamepad/battleship_gamepad.c | 2 | ||||
-rw-r--r-- | keyboards/handwired/battleship_gamepad/config.h | 4 | ||||
-rw-r--r-- | keyboards/handwired/misterdeck/keymaps/default/config.h | 2 | ||||
-rw-r--r-- | keyboards/handwired/misterdeck/keymaps/default/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/handwired/misterdeck/keymaps/nobuttons/config.h | 2 | ||||
-rw-r--r-- | keyboards/handwired/misterdeck/keymaps/nobuttons/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/joystick/config.h | 2 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/joystick/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/handwired/onekey/proton_c/halconf.h | 26 | ||||
-rw-r--r-- | keyboards/handwired/onekey/proton_c/mcuconf.h | 22 | ||||
-rw-r--r-- | keyboards/lime/keymaps/default/keymap.c | 2 | ||||
-rw-r--r-- | keyboards/lime/rev1/config.h | 4 | ||||
-rw-r--r-- | keyboards/synthlabs/solo/config.h | 4 | ||||
-rw-r--r-- | keyboards/synthlabs/solo/keymaps/gamepad/keymap.c | 2 |
14 files changed, 63 insertions, 15 deletions
diff --git a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c index 2c9de15a9f..faec437f36 100644 --- a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c +++ b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c @@ -17,7 +17,7 @@ #include "battleship_gamepad.h" /* joystick config */ -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_IN(F5, 1023, 512, 0), [1] = JOYSTICK_AXIS_IN(F4, 0, 512, 1023) }; diff --git a/keyboards/handwired/battleship_gamepad/config.h b/keyboards/handwired/battleship_gamepad/config.h index 25389c0245..a1ebc585de 100644 --- a/keyboards/handwired/battleship_gamepad/config.h +++ b/keyboards/handwired/battleship_gamepad/config.h @@ -28,8 +28,8 @@ /* joystick configuration */ #define JOYSTICK_BUTTON_COUNT 25 -#define JOYSTICK_AXES_COUNT 2 -#define JOYSTICK_AXES_RESOLUTION 10 +#define JOYSTICK_AXIS_COUNT 2 +#define JOYSTICK_AXIS_RESOLUTION 10 /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/misterdeck/keymaps/default/config.h b/keyboards/handwired/misterdeck/keymaps/default/config.h index 92157a0938..f96ac1468b 100644 --- a/keyboards/handwired/misterdeck/keymaps/default/config.h +++ b/keyboards/handwired/misterdeck/keymaps/default/config.h @@ -17,5 +17,5 @@ #pragma once -#define JOYSTICK_AXES_COUNT 4 +#define JOYSTICK_AXIS_COUNT 4 #define JOYSTICK_BUTTON_COUNT 4 diff --git a/keyboards/handwired/misterdeck/keymaps/default/keymap.c b/keyboards/handwired/misterdeck/keymaps/default/keymap.c index 0992e06f87..2da6737e17 100644 --- a/keyboards/handwired/misterdeck/keymaps/default/keymap.c +++ b/keyboards/handwired/misterdeck/keymaps/default/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_IN(F4, 0, 512, 1023), [1] = JOYSTICK_AXIS_IN(F5, 0, 512, 1023), [2] = JOYSTICK_AXIS_IN(F6, 0, 512, 1023), diff --git a/keyboards/handwired/misterdeck/keymaps/nobuttons/config.h b/keyboards/handwired/misterdeck/keymaps/nobuttons/config.h index f609bf2962..59fdfc3e7a 100644 --- a/keyboards/handwired/misterdeck/keymaps/nobuttons/config.h +++ b/keyboards/handwired/misterdeck/keymaps/nobuttons/config.h @@ -17,5 +17,5 @@ #pragma once -#define JOYSTICK_AXES_COUNT 4 +#define JOYSTICK_AXIS_COUNT 4 #define JOYSTICK_BUTTON_COUNT 0 diff --git a/keyboards/handwired/misterdeck/keymaps/nobuttons/keymap.c b/keyboards/handwired/misterdeck/keymaps/nobuttons/keymap.c index 5c69d2bc21..51a75fe204 100644 --- a/keyboards/handwired/misterdeck/keymaps/nobuttons/keymap.c +++ b/keyboards/handwired/misterdeck/keymaps/nobuttons/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_IN(F4, 0, 512, 1023), [1] = JOYSTICK_AXIS_IN(F5, 0, 512, 1023), [2] = JOYSTICK_AXIS_IN(F6, 0, 512, 1023), diff --git a/keyboards/handwired/onekey/keymaps/joystick/config.h b/keyboards/handwired/onekey/keymaps/joystick/config.h index a3b5858ad2..8a4e461b27 100644 --- a/keyboards/handwired/onekey/keymaps/joystick/config.h +++ b/keyboards/handwired/onekey/keymaps/joystick/config.h @@ -1,4 +1,4 @@ #pragma once -#define JOYSTICK_AXES_COUNT 2 +#define JOYSTICK_AXIS_COUNT 2 #define JOYSTICK_BUTTON_COUNT 1 diff --git a/keyboards/handwired/onekey/keymaps/joystick/keymap.c b/keyboards/handwired/onekey/keymaps/joystick/keymap.c index 96115aa496..6463900b7b 100644 --- a/keyboards/handwired/onekey/keymaps/joystick/keymap.c +++ b/keyboards/handwired/onekey/keymaps/joystick/keymap.c @@ -14,7 +14,7 @@ void matrix_scan_user() { } // Joystick config -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_IN(ADC_PIN, 0, 512, 1023), [1] = JOYSTICK_AXIS_VIRTUAL }; diff --git a/keyboards/handwired/onekey/proton_c/halconf.h b/keyboards/handwired/onekey/proton_c/halconf.h new file mode 100644 index 0000000000..4c66e56bba --- /dev/null +++ b/keyboards/handwired/onekey/proton_c/halconf.h @@ -0,0 +1,26 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f401/halconf.h -r platforms/chibios/common/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_ADC TRUE + +#include_next <halconf.h> diff --git a/keyboards/handwired/onekey/proton_c/mcuconf.h b/keyboards/handwired/onekey/proton_c/mcuconf.h new file mode 100644 index 0000000000..935056eb6a --- /dev/null +++ b/keyboards/handwired/onekey/proton_c/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright 2020 Nick Brassel (tzarc) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#pragma once + +#include_next "mcuconf.h" + +#undef STM32_ADC_USE_ADC1 +#define STM32_ADC_USE_ADC1 TRUE diff --git a/keyboards/lime/keymaps/default/keymap.c b/keyboards/lime/keymaps/default/keymap.c index 5760bd9359..9dd2894879 100644 --- a/keyboards/lime/keymaps/default/keymap.c +++ b/keyboards/lime/keymaps/default/keymap.c @@ -179,7 +179,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } /* Joystick axes settings */ - joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { + joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_IN(JOYSTICK_X_PIN, 268, 514, 813), [1] = JOYSTICK_AXIS_IN(JOYSTICK_Y_PIN, 865, 519, 260) }; diff --git a/keyboards/lime/rev1/config.h b/keyboards/lime/rev1/config.h index 942cb9c7b8..70f1cc419b 100644 --- a/keyboards/lime/rev1/config.h +++ b/keyboards/lime/rev1/config.h @@ -40,9 +40,9 @@ /* joystick support */ #ifdef JOYSTICK_ENABLE -# define JOYSTICK_AXES_COUNT 2 +# define JOYSTICK_AXIS_COUNT 2 # define JOYSTICK_BUTTON_COUNT 1 -# define JOYSTICK_AXES_RESOLUTION 8 +# define JOYSTICK_AXIS_RESOLUTION 8 #endif #define TAP_CODE_DELAY 10 diff --git a/keyboards/synthlabs/solo/config.h b/keyboards/synthlabs/solo/config.h index e8d9870e46..2352ba2972 100644 --- a/keyboards/synthlabs/solo/config.h +++ b/keyboards/synthlabs/solo/config.h @@ -54,5 +54,5 @@ #define BOOTMAGIC_LITE_COLUMN 1 #define JOYSTICK_BUTTON_COUNT 13 -#define JOYSTICK_AXES_COUNT 1 -#define JOYSTICK_AXES_RESOLUTION 16 +#define JOYSTICK_AXIS_COUNT 1 +#define JOYSTICK_AXIS_RESOLUTION 16 diff --git a/keyboards/synthlabs/solo/keymaps/gamepad/keymap.c b/keyboards/synthlabs/solo/keymaps/gamepad/keymap.c index e6f9678fbb..f450769b43 100644 --- a/keyboards/synthlabs/solo/keymaps/gamepad/keymap.c +++ b/keyboards/synthlabs/solo/keymaps/gamepad/keymap.c @@ -16,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { int16_t joystick_position = 0; int16_t pulses_per_revolution = 24; // Depends on encoder model. Usually 18ppr or 24ppr for Bourns EC11s. int16_t full_joystick_value = 32767; // Equivalent to max value of int16. +full_joystick_value is +1.0 axis output. -full_joystick_value is -1.0 axis output. -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { [0] = JOYSTICK_AXIS_VIRTUAL }; |