From bc0c69570b8a8b1d9a754a280053e49a825b24d7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 3 Jul 2024 17:18:27 +1000 Subject: [PATCH] Rename encoder pins defines (#24003) --- docs/features/encoders.md | 28 ++++++++--------- docs/features/split_keyboard.md | 4 +-- drivers/encoder/encoder_quadrature.c | 18 +++++------ .../wings42/rev2/keymaps/via/config.h | 4 +-- .../handwired/sick68/keymaps/via/config.h | 4 +-- .../gskt00/keymaps/default-poly/config.h | 4 +-- keyboards/pica40/rev2/rev2.c | 4 +-- keyboards/ploopyco/mouse/config.h | 4 +-- keyboards/ploopyco/ploopyco.c | 4 +-- keyboards/ploopyco/trackball/config.h | 4 +-- keyboards/ploopyco/trackball_mini/config.h | 4 +-- keyboards/ploopyco/trackball_thumb/config.h | 4 +-- keyboards/rgbkb/sol/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/sol/rev2/config.h | 8 ++--- keyboards/terrazzo/readme.md | 4 +-- lib/python/qmk/cli/generate/config_h.py | 4 +-- lib/python/qmk/info.py | 4 +-- quantum/encoder.h | 31 ++++++++++++------- quantum/encoder/tests/config_mock.h | 4 +-- .../tests/config_mock_split_left_eq_right.h | 8 ++--- .../tests/config_mock_split_left_gt_right.h | 8 ++--- .../tests/config_mock_split_left_lt_right.h | 8 ++--- .../encoder/tests/config_mock_split_no_left.h | 8 ++--- .../tests/config_mock_split_no_right.h | 8 ++--- .../encoder/tests/config_mock_split_role.h | 8 ++--- 25 files changed, 100 insertions(+), 91 deletions(-) diff --git a/docs/features/encoders.md b/docs/features/encoders.md index 3d1cac79af7..eea70dafecf 100644 --- a/docs/features/encoders.md +++ b/docs/features/encoders.md @@ -9,15 +9,15 @@ ENCODER_ENABLE = yes and this to your `config.h`: ```c -#define ENCODERS_PAD_A { B12 } -#define ENCODERS_PAD_B { B13 } +#define ENCODER_A_PINS { B12 } +#define ENCODER_B_PINS { B13 } ``` Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: ```c -#define ENCODERS_PAD_A { encoder1a, encoder2a } -#define ENCODERS_PAD_B { encoder1b, encoder2b } +#define ENCODER_A_PINS { encoder1a, encoder2a } +#define ENCODER_B_PINS { encoder1b, encoder2b } ``` If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. They can also be flipped with a define: @@ -49,8 +49,8 @@ For 4× encoders you also can assign default position if encoder skips pulses wh If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout (and optionally, resolutions) for the right half like this: ```c -#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a } -#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b } +#define ENCODER_A_PINS_RIGHT { encoder1a, encoder2a } +#define ENCODER_B_PINS_RIGHT { encoder1b, encoder2b } #define ENCODER_RESOLUTIONS_RIGHT { 2, 4 } ``` @@ -59,11 +59,11 @@ If the `_RIGHT` definitions aren't specified in your `config.h`, then the non-`_ Additionally, if one side does not have an encoder, you can specify `{}` for the pins/resolution -- for example, a split keyboard with only a right-side encoder: ```c -#define ENCODERS_PAD_A { } -#define ENCODERS_PAD_B { } +#define ENCODER_A_PINS { } +#define ENCODER_B_PINS { } #define ENCODER_RESOLUTIONS { } -#define ENCODERS_PAD_A_RIGHT { B12 } -#define ENCODERS_PAD_B_RIGHT { B13 } +#define ENCODER_A_PINS_RIGHT { B12 } +#define ENCODER_B_PINS_RIGHT { B13 } #define ENCODER_RESOLUTIONS_RIGHT { 4 } ``` @@ -174,13 +174,13 @@ Multiple encoders may share pins so long as each encoder has a distinct pair of For example you can support two encoders using only 3 pins like this ``` -#define ENCODERS_PAD_A { B1, B1 } -#define ENCODERS_PAD_B { B2, B3 } +#define ENCODER_A_PINS { B1, B1 } +#define ENCODER_B_PINS { B2, B3 } ``` You could even support three encoders using only three pins (one per encoder) however in this configuration, rotating two encoders which share pins simultaneously will often generate incorrect output. For example: ``` -#define ENCODERS_PAD_A { B1, B1, B2 } -#define ENCODERS_PAD_B { B2, B3, B3 } +#define ENCODER_A_PINS { B1, B1, B2 } +#define ENCODER_B_PINS { B2, B3, B3 } ``` Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case diff --git a/docs/features/split_keyboard.md b/docs/features/split_keyboard.md index 6efa1c2a35c..49582c3946f 100644 --- a/docs/features/split_keyboard.md +++ b/docs/features/split_keyboard.md @@ -417,8 +417,8 @@ This allows you to specify a different set of pins for the matrix on the right s This allows you to specify a different set of direct pins for the right side. ```c -#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a } -#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b } +#define ENCODER_A_PINS_RIGHT { encoder1a, encoder2a } +#define ENCODER_B_PINS_RIGHT { encoder1b, encoder2b } ``` This allows you to specify a different set of encoder pins for the right side. diff --git a/drivers/encoder/encoder_quadrature.c b/drivers/encoder/encoder_quadrature.c index cd589bf1e20..086f500391c 100644 --- a/drivers/encoder/encoder_quadrature.c +++ b/drivers/encoder/encoder_quadrature.c @@ -22,7 +22,7 @@ #endif #undef ENCODER_DEFAULT_PIN_API_IMPL -#if defined(ENCODERS_PAD_A) && defined(ENCODERS_PAD_B) +#if defined(ENCODER_A_PINS) && defined(ENCODER_B_PINS) // Inform the quadrature driver that it needs to implement pin init/read functions # define ENCODER_DEFAULT_PIN_API_IMPL #endif @@ -34,8 +34,8 @@ __attribute__((weak)) uint8_t encoder_quadrature_read_pin(uint8_t index, bool pa #ifdef ENCODER_DEFAULT_PIN_API_IMPL -static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_A; -static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_B; +static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODER_A_PINS; +static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODER_B_PINS; __attribute__((weak)) void encoder_wait_pullup_charge(void) { wait_us(100); @@ -123,25 +123,25 @@ void encoder_driver_init(void) { // here, but it's the simplest solution. memset(encoder_state, 0, sizeof(encoder_state)); memset(encoder_pulses, 0, sizeof(encoder_pulses)); - const pin_t encoders_pad_a_left[] = ENCODERS_PAD_A; - const pin_t encoders_pad_b_left[] = ENCODERS_PAD_B; + const pin_t encoders_pad_a_left[] = ENCODER_A_PINS; + const pin_t encoders_pad_b_left[] = ENCODER_B_PINS; for (uint8_t i = 0; i < thisCount; i++) { encoders_pad_a[i] = encoders_pad_a_left[i]; encoders_pad_b[i] = encoders_pad_b_left[i]; } #endif -#if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) +#if defined(SPLIT_KEYBOARD) && defined(ENCODER_A_PINS_RIGHT) && defined(ENCODER_B_PINS_RIGHT) // Re-initialise the pads if it's the right-hand side if (!isLeftHand) { - const pin_t encoders_pad_a_right[] = ENCODERS_PAD_A_RIGHT; - const pin_t encoders_pad_b_right[] = ENCODERS_PAD_B_RIGHT; + const pin_t encoders_pad_a_right[] = ENCODER_A_PINS_RIGHT; + const pin_t encoders_pad_b_right[] = ENCODER_B_PINS_RIGHT; for (uint8_t i = 0; i < thisCount; i++) { encoders_pad_a[i] = encoders_pad_a_right[i]; encoders_pad_b[i] = encoders_pad_b_right[i]; } } -#endif // defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) +#endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_A_PINS_RIGHT) && defined(ENCODER_B_PINS_RIGHT) // Encoder resolutions is defined differently in config.h, so concatenate #if defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) diff --git a/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h b/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h index 3e0c8d146af..6a9ab04738d 100644 --- a/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h +++ b/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h @@ -15,6 +15,6 @@ */ #pragma once -#define ENCODERS_PAD_A { B5, B6 } -#define ENCODERS_PAD_B { B4, B2 } +#define ENCODER_A_PINS { B5, B6 } +#define ENCODER_B_PINS { B4, B2 } #define ENCODER_RESOLUTION 4 diff --git a/keyboards/handwired/sick68/keymaps/via/config.h b/keyboards/handwired/sick68/keymaps/via/config.h index 4ce1e3e7859..bf6fd3ea4f7 100644 --- a/keyboards/handwired/sick68/keymaps/via/config.h +++ b/keyboards/handwired/sick68/keymaps/via/config.h @@ -15,6 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F1 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F1 } #define ENCODER_RESOLUTION 4 diff --git a/keyboards/kapcave/gskt00/keymaps/default-poly/config.h b/keyboards/kapcave/gskt00/keymaps/default-poly/config.h index 40a7c6ec47e..9d03a669c85 100644 --- a/keyboards/kapcave/gskt00/keymaps/default-poly/config.h +++ b/keyboards/kapcave/gskt00/keymaps/default-poly/config.h @@ -16,8 +16,8 @@ along with this program. If not, see . */ #pragma once -#define ENCODERS_PAD_A { D5 } -#define ENCODERS_PAD_B { D3 } +#define ENCODER_A_PINS { D5 } +#define ENCODER_B_PINS { D3 } #define WS2812_DI_PIN D0 #define RGBLIGHT_EFFECT_BREATHING diff --git a/keyboards/pica40/rev2/rev2.c b/keyboards/pica40/rev2/rev2.c index 0ba9a537341..b5d79508fca 100644 --- a/keyboards/pica40/rev2/rev2.c +++ b/keyboards/pica40/rev2/rev2.c @@ -6,8 +6,8 @@ #ifdef ENCODER_ENABLE // code based on encoder.c -#define ENCODER_PIN_A (((pin_t[])ENCODERS_PAD_A)[0]) -#define ENCODER_PIN_B (((pin_t[])ENCODERS_PAD_B)[0]) +#define ENCODER_PIN_A (((pin_t[])ENCODER_A_PINS)[0]) +#define ENCODER_PIN_B (((pin_t[])ENCODER_B_PINS)[0]) // custom handler that returns encoder B pin status from slave side void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) { diff --git a/keyboards/ploopyco/mouse/config.h b/keyboards/ploopyco/mouse/config.h index 0375a8875a4..0f8774dcd7f 100644 --- a/keyboards/ploopyco/mouse/config.h +++ b/keyboards/ploopyco/mouse/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/ploopyco.c b/keyboards/ploopyco/ploopyco.c index e4726238f26..a6f76203d64 100644 --- a/keyboards/ploopyco/ploopyco.c +++ b/keyboards/ploopyco/ploopyco.c @@ -71,8 +71,8 @@ float scroll_accumulated_v = 0; #ifdef ENCODER_ENABLE uint16_t lastScroll = 0; // Previous confirmed wheel event uint16_t lastMidClick = 0; // Stops scrollwheel from being read if it was pressed -pin_t encoder_pins_a[1] = ENCODERS_PAD_A; -pin_t encoder_pins_b[1] = ENCODERS_PAD_B; +pin_t encoder_pins_a[1] = ENCODER_A_PINS; +pin_t encoder_pins_b[1] = ENCODER_B_PINS; bool debug_encoder = false; bool encoder_update_kb(uint8_t index, bool clockwise) { diff --git a/keyboards/ploopyco/trackball/config.h b/keyboards/ploopyco/trackball/config.h index 80457d062aa..2aac27437ab 100644 --- a/keyboards/ploopyco/trackball/config.h +++ b/keyboards/ploopyco/trackball/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball_mini/config.h b/keyboards/ploopyco/trackball_mini/config.h index c5d2d5694e4..2e0b570bbae 100644 --- a/keyboards/ploopyco/trackball_mini/config.h +++ b/keyboards/ploopyco/trackball_mini/config.h @@ -38,5 +38,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F0 } -#define ENCODERS_PAD_B { F4 } +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball_thumb/config.h b/keyboards/ploopyco/trackball_thumb/config.h index 631456d9d31..f03ffc76990 100644 --- a/keyboards/ploopyco/trackball_thumb/config.h +++ b/keyboards/ploopyco/trackball_thumb/config.h @@ -42,5 +42,5 @@ /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 -#define ENCODERS_PAD_A { F4 } -#define ENCODERS_PAD_B { F0 } +#define ENCODER_A_PINS { F4 } +#define ENCODER_B_PINS { F0 } diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c index 4a6511cbfc7..8997e9a582e 100644 --- a/keyboards/rgbkb/sol/keymaps/default/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -201,7 +201,7 @@ const rgb_matrix_f rgb_matrix_functions[6][2] = { #ifdef ENCODER_ENABLE -static pin_t encoders_pad_a[] = ENCODERS_PAD_A; +static pin_t encoders_pad_a[] = ENCODER_A_PINS; #define NUMBER_OF_ENCODERS ARRAY_SIZE(encoders_pad_a) const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = { diff --git a/keyboards/rgbkb/sol/rev2/config.h b/keyboards/rgbkb/sol/rev2/config.h index ab5150051a0..5867c6dfe36 100644 --- a/keyboards/rgbkb/sol/rev2/config.h +++ b/keyboards/rgbkb/sol/rev2/config.h @@ -49,12 +49,12 @@ along with this program. If not, see . // Encoder support #ifndef EXTRA_ENCODERS_ENABLE -#define ENCODERS_PAD_A { D2 } -#define ENCODERS_PAD_B { D6 } +#define ENCODER_A_PINS { D2 } +#define ENCODER_B_PINS { D6 } #else #ifdef OLED_ENABLE #error Extra encoders cannot be enabled at the same time as the OLED Driver as they use the same pins. #endif -#define ENCODERS_PAD_A { D2, D1, B0 } -#define ENCODERS_PAD_B { D6, B1, D0 } +#define ENCODER_A_PINS { D2, D1, B0 } +#define ENCODER_B_PINS { D6, B1, D0 } #endif diff --git a/keyboards/terrazzo/readme.md b/keyboards/terrazzo/readme.md index e0f4f3457f0..828819f7b45 100644 --- a/keyboards/terrazzo/readme.md +++ b/keyboards/terrazzo/readme.md @@ -82,8 +82,8 @@ Change pinouts, Pro Micro does not have the "F0" pin. Set encoder to just top or bottom position. ``` -#define ENCODERS_PAD_A { C6 } -#define ENCODERS_PAD_B { D4 } +#define ENCODER_A_PINS { C6 } +#define ENCODER_B_PINS { D4 } ``` ## Encoder Setup diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index fc681300a37..d613f7b92c1 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -135,8 +135,8 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''): b_pads.append(encoder["pin_b"]) resolutions.append(encoder.get("resolution", None)) - config_h_lines.append(generate_define(f'ENCODERS_PAD_A{postfix}', f'{{ {", ".join(a_pads)} }}')) - config_h_lines.append(generate_define(f'ENCODERS_PAD_B{postfix}', f'{{ {", ".join(b_pads)} }}')) + config_h_lines.append(generate_define(f'ENCODER_A_PINS{postfix}', f'{{ {", ".join(a_pads)} }}')) + config_h_lines.append(generate_define(f'ENCODER_B_PINS{postfix}', f'{{ {", ".join(b_pads)} }}')) if None in resolutions: cli.log.debug(f"Unable to generate ENCODER_RESOLUTION{postfix} configuration") diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 091a11854c0..5b3b2490150 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -375,8 +375,8 @@ def _extract_audio(info_data, config_c): def _extract_encoders_values(config_c, postfix=''): """Common encoder extraction logic """ - a_pad = config_c.get(f'ENCODERS_PAD_A{postfix}', '').replace(' ', '')[1:-1] - b_pad = config_c.get(f'ENCODERS_PAD_B{postfix}', '').replace(' ', '')[1:-1] + a_pad = config_c.get(f'ENCODER_A_PINS{postfix}', '').replace(' ', '')[1:-1] + b_pad = config_c.get(f'ENCODER_B_PINS{postfix}', '').replace(' ', '')[1:-1] resolutions = config_c.get(f'ENCODER_RESOLUTIONS{postfix}', '').replace(' ', '')[1:-1] default_resolution = config_c.get('ENCODER_RESOLUTION', None) diff --git a/quantum/encoder.h b/quantum/encoder.h index 317a91f1da5..1d2f1f46c7f 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -22,6 +22,21 @@ #include "gpio.h" #include "util.h" +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ENCODERS_PAD_A +# define ENCODER_A_PINS ENCODERS_PAD_A +#endif +#ifdef ENCODERS_PAD_B +# define ENCODER_B_PINS ENCODERS_PAD_B +#endif +#ifdef ENCODERS_PAD_A_RIGHT +# define ENCODER_A_PINS_RIGHT ENCODERS_PAD_A_RIGHT +#endif +#ifdef ENCODERS_PAD_B_RIGHT +# define ENCODER_B_PINS_RIGHT ENCODERS_PAD_B_RIGHT +#endif +// ======== + #ifdef ENCODER_ENABLE __attribute__((weak)) bool should_process_encoder(void); @@ -36,16 +51,16 @@ bool encoder_update_user(uint8_t index, bool clockwise); # ifdef SPLIT_KEYBOARD -# if defined(ENCODERS_PAD_A_RIGHT) +# if defined(ENCODER_A_PINS_RIGHT) # ifndef NUM_ENCODERS_LEFT -# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # ifndef NUM_ENCODERS_RIGHT -# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A_RIGHT)) +# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS_RIGHT)) # endif # else # ifndef NUM_ENCODERS_LEFT -# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # ifndef NUM_ENCODERS_RIGHT # define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT @@ -58,19 +73,13 @@ bool encoder_update_user(uint8_t index, bool clockwise); # else // SPLIT_KEYBOARD # ifndef NUM_ENCODERS -# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODER_A_PINS)) # endif # define NUM_ENCODERS_LEFT NUM_ENCODERS # define NUM_ENCODERS_RIGHT 0 # endif // SPLIT_KEYBOARD -# ifndef NUM_ENCODERS -# define NUM_ENCODERS 0 -# define NUM_ENCODERS_LEFT 0 -# define NUM_ENCODERS_RIGHT 0 -# endif // NUM_ENCODERS - # define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT) # ifndef MAX_QUEUED_ENCODER_EVENTS diff --git a/quantum/encoder/tests/config_mock.h b/quantum/encoder/tests/config_mock.h index 9eb59ddc881..b5a1537d8a2 100644 --- a/quantum/encoder/tests/config_mock.h +++ b/quantum/encoder/tests/config_mock.h @@ -7,9 +7,9 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_eq_right.h b/quantum/encoder/tests/config_mock_split_left_eq_right.h index ea795657ef1..a4aa051ef1a 100644 --- a/quantum/encoder/tests/config_mock_split_left_eq_right.h +++ b/quantum/encoder/tests/config_mock_split_left_eq_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_gt_right.h b/quantum/encoder/tests/config_mock_split_left_gt_right.h index abcfe039189..77190797add 100644 --- a/quantum/encoder/tests/config_mock_split_left_gt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_gt_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2, 4 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3, 5 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 6, 8 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 7, 9 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_left_lt_right.h b/quantum/encoder/tests/config_mock_split_left_lt_right.h index 075c774b0d1..61808e866e1 100644 --- a/quantum/encoder/tests/config_mock_split_left_lt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_lt_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6, 8 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7, 9 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_no_left.h b/quantum/encoder/tests/config_mock_split_no_left.h index dfd8358929b..599e584ff16 100644 --- a/quantum/encoder/tests/config_mock_split_no_left.h +++ b/quantum/encoder/tests/config_mock_split_no_left.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ {} -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ {} -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 0, 2 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 1, 3 } #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_no_right.h b/quantum/encoder/tests/config_mock_split_no_right.h index 5683eade8c9..c3f753014c0 100644 --- a/quantum/encoder/tests/config_mock_split_no_right.h +++ b/quantum/encoder/tests/config_mock_split_no_right.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ {} -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ {} #ifdef __cplusplus diff --git a/quantum/encoder/tests/config_mock_split_role.h b/quantum/encoder/tests/config_mock_split_role.h index ea795657ef1..a4aa051ef1a 100644 --- a/quantum/encoder/tests/config_mock_split_role.h +++ b/quantum/encoder/tests/config_mock_split_role.h @@ -7,13 +7,13 @@ #define MATRIX_COLS 1 /* Here, "pins" from 0 to 31 are allowed. */ -#define ENCODERS_PAD_A \ +#define ENCODER_A_PINS \ { 0, 2 } -#define ENCODERS_PAD_B \ +#define ENCODER_B_PINS \ { 1, 3 } -#define ENCODERS_PAD_A_RIGHT \ +#define ENCODER_A_PINS_RIGHT \ { 4, 6 } -#define ENCODERS_PAD_B_RIGHT \ +#define ENCODER_B_PINS_RIGHT \ { 5, 7 } #ifdef __cplusplus