summaryrefslogtreecommitdiffstats
path: root/quantum/encoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/encoder.h')
-rw-r--r--quantum/encoder.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/encoder.h b/quantum/encoder.h
index 82f95b4931..4eb67fa25d 100644
--- a/quantum/encoder.h
+++ b/quantum/encoder.h
@@ -32,17 +32,17 @@ void encoder_state_raw(uint8_t* slave_state);
void encoder_update_raw(uint8_t* slave_state);
# if defined(ENCODERS_PAD_A_RIGHT)
-# define NUM_ENCODERS_LEFT (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t))
-# define NUM_ENCODERS_RIGHT (sizeof(((pin_t[])ENCODERS_PAD_A_RIGHT)) / sizeof(pin_t))
+# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
+# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A_RIGHT))
# else
-# define NUM_ENCODERS_LEFT (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t))
+# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
# define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT
# endif
# define NUM_ENCODERS (NUM_ENCODERS_LEFT + NUM_ENCODERS_RIGHT)
#else // SPLIT_KEYBOARD
-# define NUM_ENCODERS (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t))
+# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
# define NUM_ENCODERS_LEFT NUM_ENCODERS
# define NUM_ENCODERS_RIGHT 0