From 28f0ddd87433cc06b6ff8fa383c4075c25f71a26 Mon Sep 17 00:00:00 2001 From: Charly Delay <0xcharly@codesink.dev> Date: Sun, 31 Jul 2022 15:50:30 +0900 Subject: [PATCH] bastardkb/charybdis: fix splinky configuration The pinout of the splinky changed between the last beta batch, and the production one. This commit updates the keyboard definition to support the new pinout by default, while offering backward compatibility. Define `SPLINKY_BETA_PINOUT` to build the firmware with pre-production pinout. Fixes #15 --- .../charybdis/3x5/v2/splinky/config.h | 21 ++++++++++++++----- .../charybdis/3x6/v2/splinky/config.h | 21 ++++++++++++++----- .../charybdis/4x6/v2/splinky/config.h | 21 ++++++++++++++----- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/keyboards/bastardkb/charybdis/3x5/v2/splinky/config.h b/keyboards/bastardkb/charybdis/3x5/v2/splinky/config.h index 2929d3dd1e70..433752687ac6 100644 --- a/keyboards/bastardkb/charybdis/3x5/v2/splinky/config.h +++ b/keyboards/bastardkb/charybdis/3x5/v2/splinky/config.h @@ -20,8 +20,13 @@ /* Key matrix configuration. */ #define MATRIX_ROW_PINS \ { GP26, GP5, GP4, GP9 } -#define MATRIX_COL_PINS \ - { GP28, GP15, GP6, GP7, GP8 } +#ifdef SPLINKY_BETA_PINOUT +# define MATRIX_COL_PINS \ + { GP28, GP15, GP6, GP7, GP8 } +#else +# define MATRIX_COL_PINS \ + { GP28, GP21, GP6, GP7, GP8 } +#endif // SPLINKY_BETA_PINOUT /* Handedness. */ #define MASTER_RIGHT @@ -39,10 +44,16 @@ /* SPI & PMW3360 settings. */ #define SPI_DRIVER SPID0 -#define SPI_SCK_PIN GP18 -#define SPI_MOSI_PIN GP19 #define SPI_MISO_PIN GP20 -#define PMW33XX_CS_PIN GP14 +#ifdef SPLINKY_BETA_PINOUT +# define SPI_SCK_PIN GP18 +# define SPI_MOSI_PIN GP19 +# define PMW33XX_CS_PIN GP14 +#else +# define SPI_SCK_PIN GP22 +# define SPI_MOSI_PIN GP23 +# define PMW33XX_CS_PIN GP16 +#endif // SPLINKY_BETA_PINOUT /* Reset. */ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET diff --git a/keyboards/bastardkb/charybdis/3x6/v2/splinky/config.h b/keyboards/bastardkb/charybdis/3x6/v2/splinky/config.h index 9c4ced817a42..b09f4b779413 100644 --- a/keyboards/bastardkb/charybdis/3x6/v2/splinky/config.h +++ b/keyboards/bastardkb/charybdis/3x6/v2/splinky/config.h @@ -20,8 +20,13 @@ /* Key matrix configuration. */ #define MATRIX_ROW_PINS \ { GP26, GP5, GP4, GP9 } -#define MATRIX_COL_PINS \ - { GP27, GP28, GP15, GP6, GP7, GP8 } +#ifdef SPLINKY_BETA_PINOUT +# define MATRIX_COL_PINS \ + { GP27, GP28, GP15, GP6, GP7, GP8 } +#else +# define MATRIX_COL_PINS \ + { GP27, GP28, GP21, GP6, GP7, GP8 } +#endif // SPLINKY_BETA_PINOUT /* Handedness. */ #define MASTER_RIGHT @@ -39,10 +44,16 @@ /* SPI & PMW3360 settings. */ #define SPI_DRIVER SPID0 -#define SPI_SCK_PIN GP18 -#define SPI_MOSI_PIN GP19 #define SPI_MISO_PIN GP20 -#define PMW33XX_CS_PIN GP14 +#ifdef SPLINKY_BETA_PINOUT +# define SPI_SCK_PIN GP18 +# define SPI_MOSI_PIN GP19 +# define PMW33XX_CS_PIN GP14 +#else +# define SPI_SCK_PIN GP22 +# define SPI_MOSI_PIN GP23 +# define PMW33XX_CS_PIN GP16 +#endif // SPLINKY_BETA_PINOUT /* Reset. */ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET diff --git a/keyboards/bastardkb/charybdis/4x6/v2/splinky/config.h b/keyboards/bastardkb/charybdis/4x6/v2/splinky/config.h index e17ec49726fd..21ae26ffae9c 100644 --- a/keyboards/bastardkb/charybdis/4x6/v2/splinky/config.h +++ b/keyboards/bastardkb/charybdis/4x6/v2/splinky/config.h @@ -20,8 +20,13 @@ /* Key matrix configuration. */ #define MATRIX_ROW_PINS \ { GP29, GP26, GP5, GP4, GP9 } -#define MATRIX_COL_PINS \ - { GP27, GP28, GP15, GP6, GP7, GP8 } +#ifdef SPLINKY_BETA_PINOUT +# define MATRIX_COL_PINS \ + { GP27, GP28, GP15, GP6, GP7, GP8 } +#else +# define MATRIX_COL_PINS \ + { GP27, GP28, GP21, GP6, GP7, GP8 } +#endif // SPLINKY_BETA_PINOUT /* Handedness. */ #define MASTER_RIGHT @@ -39,10 +44,16 @@ /* SPI & PMW3360 settings. */ #define SPI_DRIVER SPID0 -#define SPI_SCK_PIN GP18 -#define SPI_MOSI_PIN GP19 #define SPI_MISO_PIN GP20 -#define PMW33XX_CS_PIN GP14 +#ifdef SPLINKY_BETA_PINOUT +# define SPI_SCK_PIN GP18 +# define SPI_MOSI_PIN GP19 +# define PMW33XX_CS_PIN GP14 +#else +# define SPI_SCK_PIN GP22 +# define SPI_MOSI_PIN GP23 +# define PMW33XX_CS_PIN GP16 +#endif // SPLINKY_BETA_PINOUT /* Reset. */ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET