From 32215d5bff52262542a2f8d2a221b0303f02c019 Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Sat, 20 Nov 2021 18:06:08 +0100 Subject: Rework encoders to enable asymmetric split keyboards (#12090) Co-authored-by: Balz Guenat Co-authored-by: Nick Brassel --- quantum/split_common/transport.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'quantum/split_common') diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index 1d4f6ed0cd..ab65ff56db 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h @@ -42,7 +42,11 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, #ifdef ENCODER_ENABLE # include "encoder.h" -# define NUMBER_OF_ENCODERS (sizeof((pin_t[])ENCODERS_PAD_A) / sizeof(pin_t)) +// if no pads for right half are defined, we assume the keyboard is symmetric (i.e. same pads) +# ifndef ENCODERS_PAD_A_RIGHT +# define ENCODERS_PAD_A_RIGHT ENCODERS_PAD_A +# endif +# define NUMBER_OF_ENCODERS ((sizeof((pin_t[])ENCODERS_PAD_A) + (sizeof((pin_t[])ENCODERS_PAD_A_RIGHT)) / sizeof(pin_t)) #endif // ENCODER_ENABLE #ifdef BACKLIGHT_ENABLE -- cgit v1.2.3