diff --git a/keyboard/kimera/Makefile b/keyboard/kimera/Makefile index 1b8a6d7d..96f7dd28 100644 --- a/keyboard/kimera/Makefile +++ b/keyboard/kimera/Makefile @@ -113,6 +113,13 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# PCB Version +ifdef VER + OPT_DEFS += -DKIMERA_$(REV) +else + OPT_DEFS += -DKIMERA_V2 +endif + # Additional definitions from command line ifdef DEFS OPT_DEFS += $(foreach DEF,$(DEFS),-D$(DEF)) diff --git a/keyboard/kimera/kimera.h b/keyboard/kimera/kimera.h index 809a170d..45f1c3b8 100644 --- a/keyboard/kimera/kimera.h +++ b/keyboard/kimera/kimera.h @@ -92,29 +92,30 @@ const uint8_t PROGMEM zx_bit[] = { #define MUX_TO_ZX_BIT(x) (pgm_read_byte(zx_bit + (x))) /* + Shift Register Multiplexer ,----------. ,------------. MOSI --| SER 0 |----| INH X0~X7 |===============. - SCK --|>SCK 1 |----| A | | + SCK --|>SCK 1 |----| C | | RCK --|>RCK 2 |----| B | ,-------------+-------------. - | 3 |----| C | | | | | | | | | + | 3 |----| A | | | | | | | | | | | `------------' P26 P27 P28 P25 P29 P32 P30 P31 | | ,------------. - | 4 |----| A X0~X7 |===============. + | 4 |----| C X0~X7 |===============. | 5 |----| B | | - | 6 |----| C | ,-------------+-------------. + | 6 |----| A | ,-------------+-------------. | 7 |----| INH | | | | | | | | | | | `------------' P2 P3 P4 P1 P5 P8 P6 P7 | | ,------------. | 8 |----| INH X0~X7 |===============. - | 9 |----| A | | + | 9 |----| C | | | 10 |----| B | ,-------------+-------------. - | 11 |----| C | | | | | | | | | + | 11 |----| A | | | | | | | | | | | `------------' P10 P11 P12 P9 P13 P16 P14 P15 | | ,------------. - | 12 |----| A X0~X7 |===============. + | 12 |----| C X0~X7 |===============. | 13 |----| B | | - | 14 |----| C | ,-------------+-------------. + | 14 |----| A | ,-------------+-------------. | 15 |----| INH | | | | | | | | | `----------' `------------' P18 P19 P20 P17 P21 P24 P22 P23 */ @@ -123,6 +124,7 @@ const uint8_t PROGMEM zx_bit[] = { #define MUX_PORTS 8 #define PX_TO_MUX(x) (x>>3) // (x / MUX_PORTS) +#if defined(KIMERA_V1) enum { MUX4_INH = 0, MUX4_A, @@ -141,14 +143,44 @@ enum { MUX3_C, MUX3_INH }; +#elif defined(KIMERA_V2) +enum { + MUX4_INH = 0, + MUX4_C, + MUX4_B, + MUX4_A, + MUX1_C, + MUX1_B, + MUX1_A, + MUX1_INH, + MUX2_INH, + MUX2_C, + MUX2_B, + MUX2_A, + MUX3_C, + MUX3_B, + MUX3_A, + MUX3_INH +}; +#endif #ifdef KIMERA_C +#if defined(KIMERA_V1) const uint16_t PROGMEM px_to_shift_out[] = { 3<