From e3299db9e33304589d75a5dc332a6c5c484a82be Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:21:29 -0700 Subject: [PATCH 01/14] Minidox refactor and Configurator support (#3373) * Matrix refactor * Keymap refactor: #include QMK_KEYBOARD_H * Configurator support --- keyboards/minidox/keymaps/default/keymap.c | 4 +-- keyboards/minidox/keymaps/haegin/keymap.c | 4 +-- keyboards/minidox/keymaps/khitsule/keymap.c | 4 +-- .../minidox/keymaps/that_canadian/keymap.c | 4 +-- keyboards/minidox/keymaps/tomb0y/keymap.c | 4 +-- keyboards/minidox/keymaps/xyverz/keymap.c | 2 -- keyboards/minidox/rev1/info.json | 13 ++++++++ keyboards/minidox/rev1/rev1.h | 33 ++++++++++--------- 8 files changed, 36 insertions(+), 32 deletions(-) create mode 100644 keyboards/minidox/rev1/info.json diff --git a/keyboards/minidox/keymaps/default/keymap.c b/keyboards/minidox/keymaps/default/keymap.c index 32b407e787..521db63aab 100644 --- a/keyboards/minidox/keymaps/default/keymap.c +++ b/keyboards/minidox/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "minidox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/keymaps/haegin/keymap.c b/keyboards/minidox/keymaps/haegin/keymap.c index a32492eaa1..221427b28a 100644 --- a/keyboards/minidox/keymaps/haegin/keymap.c +++ b/keyboards/minidox/keymaps/haegin/keymap.c @@ -1,6 +1,4 @@ -#include "minidox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/keymaps/khitsule/keymap.c b/keyboards/minidox/keymaps/khitsule/keymap.c index ba07e0a4e7..750510579c 100644 --- a/keyboards/minidox/keymaps/khitsule/keymap.c +++ b/keyboards/minidox/keymaps/khitsule/keymap.c @@ -1,6 +1,4 @@ -#include "minidox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/keymaps/that_canadian/keymap.c b/keyboards/minidox/keymaps/that_canadian/keymap.c index dbdd397066..9d81283b67 100644 --- a/keyboards/minidox/keymaps/that_canadian/keymap.c +++ b/keyboards/minidox/keymaps/that_canadian/keymap.c @@ -1,6 +1,4 @@ -#include "minidox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/keymaps/tomb0y/keymap.c b/keyboards/minidox/keymaps/tomb0y/keymap.c index de93789324..cb7cd4d0a5 100644 --- a/keyboards/minidox/keymaps/tomb0y/keymap.c +++ b/keyboards/minidox/keymaps/tomb0y/keymap.c @@ -1,6 +1,4 @@ -#include "minidox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/keymaps/xyverz/keymap.c b/keyboards/minidox/keymaps/xyverz/keymap.c index 3dd9903cad..3e62815655 100644 --- a/keyboards/minidox/keymaps/xyverz/keymap.c +++ b/keyboards/minidox/keymaps/xyverz/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; diff --git a/keyboards/minidox/rev1/info.json b/keyboards/minidox/rev1/info.json new file mode 100644 index 0000000000..c86e9a0d74 --- /dev/null +++ b/keyboards/minidox/rev1/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "MiniDox", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 5.75, + "layouts": { + "LAYOUT": { + "key_count": 36, + "layout": [{"x":0, "y":0.375}, {"x":1, "y":0.125}, {"x":2, "y":0}, {"x":3, "y":0.125}, {"x":4, "y":0.25}, {"x":7, "y":0.25}, {"x":8, "y":0.125}, {"x":9, "y":0}, {"x":10, "y":0.125}, {"x":11, "y":0.375}, {"x":0, "y":1.375}, {"x":1, "y":1.125}, {"x":2, "y":1}, {"x":3, "y":1.125}, {"x":4, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.125}, {"x":9, "y":1}, {"x":10, "y":1.125}, {"x":11, "y":1.375}, {"x":0, "y":2.375}, {"x":1, "y":2.125}, {"x":2, "y":2}, {"x":3, "y":2.125}, {"x":4, "y":2.25}, {"x":7, "y":2.25}, {"x":8, "y":2.125}, {"x":9, "y":2}, {"x":10, "y":2.125}, {"x":11, "y":2.375}, {"x":2.5, "y":4.75}, {"x":3.5, "y":4.75}, {"x":4.5, "y":3.75, "h":2}, {"x":6.5, "y":3.75, "h":2}, {"x":7.5, "y":4.75}, {"x":8.5, "y":4.75}] + } + } +} diff --git a/keyboards/minidox/rev1/rev1.h b/keyboards/minidox/rev1/rev1.h index b419c5fc90..99c579d6eb 100644 --- a/keyboards/minidox/rev1/rev1.h +++ b/keyboards/minidox/rev1/rev1.h @@ -8,21 +8,24 @@ //void promicro_bootloader_jmp(bool program); +// readability +#define ___ KC_NO + #define LAYOUT( \ - k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, \ - k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, \ - k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, \ - k33, k34, k35, k75, k74, k73 \ - ) \ - { \ - { k01, k02, k03, k04, k05 }, \ - { k11, k12, k13, k14, k15 }, \ - { k21, k22, k23, k24, k25 }, \ - { KC_NO, KC_NO, k33, k34, k35 }, \ - { k41, k42, k43, k44, k45 }, \ - { k51, k52, k53, k54, k55 }, \ - { k61, k62, k63, k64, k65 }, \ - { KC_NO, KC_NO, k73, k74, k75 } \ - } + k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, \ + k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, \ + k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, \ + k33, k34, k35, k75, k74, k73 \ + ) \ + { \ + { k01, k02, k03, k04, k05 }, \ + { k11, k12, k13, k14, k15 }, \ + { k21, k22, k23, k24, k25 }, \ + { ___, ___, k33, k34, k35 }, \ + { k41, k42, k43, k44, k45 }, \ + { k51, k52, k53, k54, k55 }, \ + { k61, k62, k63, k64, k65 }, \ + { ___, ___, k73, k74, k75 } \ + } #endif From f30d6dd7858dfa3a0cf214113e8b1d45b30d74ce Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Fri, 13 Jul 2018 02:23:30 +0900 Subject: [PATCH 02/14] Helix config refine (#3374) * helix config.h refine --- keyboards/helix/config.h | 22 +++++++++-- keyboards/helix/rev1/config.h | 2 - .../helix/rev1/keymaps/OLED_sample/config.h | 4 -- .../rev1/keymaps/OLED_sample/serial_config.h | 16 ++++++++ keyboards/helix/rev1/keymaps/default/config.h | 4 +- keyboards/helix/rev1/serial_config.h | 16 ++++++++ keyboards/helix/rev2/config.h | 3 -- keyboards/helix/rev2/keymaps/default/config.h | 2 - .../helix/rev2/keymaps/edvorakjp/config.h | 2 - .../helix/rev2/keymaps/five_rows/config.h | 2 - .../helix/rev2/keymaps/five_rows_jis/config.h | 4 -- keyboards/helix/rev2/keymaps/froggy/config.h | 2 - .../helix/rev2/keymaps/led_test/config.h | 2 - keyboards/helix/rev2/matrix.c | 1 - keyboards/helix/rev2/serial_config.h | 16 ++++++++ keyboards/helix/rev2/split_util.c | 1 - keyboards/helix/serial.c | 6 ++- keyboards/helix/serial.h | 37 +++++++------------ keyboards/helix/ssd1306.h | 1 - 19 files changed, 85 insertions(+), 58 deletions(-) create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h create mode 100644 keyboards/helix/rev1/serial_config.h create mode 100644 keyboards/helix/rev2/serial_config.h diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h index 8f0524f972..7bd4d26456 100644 --- a/keyboards/helix/config.h +++ b/keyboards/helix/config.h @@ -21,8 +21,22 @@ along with this program. If not, see . #include "config_common.h" -#ifdef SUBPROJECT_rev1 - #include "rev1/config.h" -#endif +// GCC include 'config.h" sequence in qmk_firmware/keyboards/helix/ +// -include keyboards/helix/config.h +// -include keyboards/helix/rev?/config.h +// -include keyboards/helix/rev?/keymaps/MAPNAME/config.h +// XXXX.c -#endif +#include + +// GCC include search path in qmk_firmare/keyboards/helix/ +// #include "..." search starts here: +// #include <...> search starts here: +// keyboards/helix/rev?/keymaps/MAPNAME +// keyboards/helix +// keyboards/helix/rev? +// . +// ./tmk_core +// ...... + +#endif /* CONFIG_H */ diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h index 3420992d83..7fec62fc83 100644 --- a/keyboards/helix/rev1/config.h +++ b/keyboards/helix/rev1/config.h @@ -19,8 +19,6 @@ along with this program. If not, see . #ifndef REV1_CONFIG_H #define REV1_CONFIG_H -#include "../config.h" - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x3060 diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h index 6cd3072b14..0e1b787a5a 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/config.h +++ b/keyboards/helix/rev1/keymaps/OLED_sample/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - /* Use I2C or Serial */ #define USE_I2C @@ -37,8 +35,6 @@ along with this program. If not, see . #define SSD1306OLED -#define USE_SERIAL_PD2 - #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h new file mode 100644 index 0000000000..be2e7cb8b1 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h @@ -0,0 +1,16 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +//// #error rev1/keymaps/OLED_sample serial config + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h index 7f33a43630..d95925d4e4 100644 --- a/keyboards/helix/rev1/keymaps/default/config.h +++ b/keyboards/helix/rev1/keymaps/default/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - /* Use I2C or Serial, not both */ #define USE_SERIAL @@ -34,4 +32,4 @@ along with this program. If not, see . // #define _MASTER_RIGHT // #define EE_HANDS -#endif \ No newline at end of file +#endif diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h new file mode 100644 index 0000000000..2b668a6afc --- /dev/null +++ b/keyboards/helix/rev1/serial_config.h @@ -0,0 +1,16 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +/// #error rev1 serial config + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h index 5307578832..058236122f 100644 --- a/keyboards/helix/rev2/config.h +++ b/keyboards/helix/rev2/config.h @@ -19,8 +19,6 @@ along with this program. If not, see . #ifndef REV2_CONFIG_H #define REV2_CONFIG_H -#include "../config.h" - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x3060 @@ -37,7 +35,6 @@ along with this program. If not, see . /* Use I2C or Serial */ #define USE_I2C #define USE_SERIAL -#define USE_SERIAL_PD2 //#define USE_MATRIX_I2C /* Select hand configuration */ diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h index 0e7967c73b..6da6849a1d 100644 --- a/keyboards/helix/rev2/keymaps/default/config.h +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h index bb569ca5df..a7a5f83600 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h @@ -1,8 +1,6 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - #undef TAPPING_FORCE_HOLD #undef TAPPING_TERM #define TAPPING_TERM 120 diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h index 0e7967c73b..6da6849a1d 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h index 17c4a30b34..b4390551ef 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - /* Use I2C or Serial */ #define USE_I2C @@ -59,8 +57,6 @@ along with this program. If not, see . #error "expected HELIX_ROWS 4 or 5" #endif -#define USE_SERIAL_PD2 - #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/helix/rev2/keymaps/froggy/config.h b/keyboards/helix/rev2/keymaps/froggy/config.h index 8161d4a25d..df72aef123 100644 --- a/keyboards/helix/rev2/keymaps/froggy/config.h +++ b/keyboards/helix/rev2/keymaps/froggy/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - #undef TAPPING_TERM #define TAPPING_TERM 200 #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ diff --git a/keyboards/helix/rev2/keymaps/led_test/config.h b/keyboards/helix/rev2/keymaps/led_test/config.h index 0e7967c73b..6da6849a1d 100644 --- a/keyboards/helix/rev2/keymaps/led_test/config.h +++ b/keyboards/helix/rev2/keymaps/led_test/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" - // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index a908360c59..8a1ce3af1e 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -30,7 +30,6 @@ along with this program. If not, see . #include "matrix.h" #include "split_util.h" #include "pro_micro.h" -#include "config.h" #ifdef USE_MATRIX_I2C # include "i2c.h" diff --git a/keyboards/helix/rev2/serial_config.h b/keyboards/helix/rev2/serial_config.h new file mode 100644 index 0000000000..82c6e4e836 --- /dev/null +++ b/keyboards/helix/rev2/serial_config.h @@ -0,0 +1,16 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +//// #error rev2 serial config + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c index 8bc064174e..beb39fa005 100644 --- a/keyboards/helix/rev2/split_util.c +++ b/keyboards/helix/rev2/split_util.c @@ -7,7 +7,6 @@ #include "split_util.h" #include "matrix.h" #include "keyboard.h" -#include "config.h" #ifdef USE_MATRIX_I2C # include "i2c.h" diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 182f222196..5919415877 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -110,16 +110,18 @@ void serial_master_init(void) { void serial_slave_init(void) { serial_input_with_pullup(); -#ifndef USE_SERIAL_PD2 +#if SERIAL_PIN_MASK == _BV(PD0) // Enable INT0 EIMSK |= _BV(INT0); // Trigger on falling edge of INT0 EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#else +#elif SERIAL_PIN_MASK == _BV(PD2) // Enable INT2 EIMSK |= _BV(INT2); // Trigger on falling edge of INT2 EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#else + #error unknown SERIAL_PIN_MASK value #endif } diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h index 8f15d66753..c3c9569b2c 100644 --- a/keyboards/helix/serial.h +++ b/keyboards/helix/serial.h @@ -1,28 +1,19 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H -#include "config.h" #include -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND - -#ifndef USE_SERIAL_PD2 -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect -#else -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect -#endif - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#ifdef KEYBOARD_helix_rev1 -#define SERIAL_MASTER_BUFFER_LENGTH 1 -#else -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -#endif +// //////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// //////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 // Buffers for master - slave communication extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; @@ -33,4 +24,4 @@ void serial_slave_init(void); int serial_update_buffers(void); bool serial_slave_data_corrupt(void); -#endif +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h index b65c505c97..77ce7c211a 100644 --- a/keyboards/helix/ssd1306.h +++ b/keyboards/helix/ssd1306.h @@ -4,7 +4,6 @@ #include #include #include "pincontrol.h" -#include "config.h" enum ssd1306_cmds { DisplayOff = 0xAE, From 9a1613dd1a86e8db65d68756cea48d9d9ba075d8 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Jul 2018 13:26:50 -0400 Subject: [PATCH 03/14] Add Quefrency Keyboard (#3376) * Fork Fourier keyboard to Quefrency * Set Quefrency pinouts and initial keymap * Set configurator layout --- keyboards/quefrency/config.h | 28 ++ keyboards/quefrency/i2c.c | 162 +++++++ keyboards/quefrency/i2c.h | 49 ++ keyboards/quefrency/info.json | 86 ++++ keyboards/quefrency/keymaps/default/config.h | 31 ++ keyboards/quefrency/keymaps/default/keymap.c | 35 ++ keyboards/quefrency/keymaps/default/rules.mk | 0 keyboards/quefrency/matrix.c | 467 +++++++++++++++++++ keyboards/quefrency/quefrency.c | 1 + keyboards/quefrency/quefrency.h | 23 + keyboards/quefrency/readme.md | 20 + keyboards/quefrency/rev1/config.h | 84 ++++ keyboards/quefrency/rev1/rev1.c | 7 + keyboards/quefrency/rev1/rev1.h | 37 ++ keyboards/quefrency/rev1/rules.mk | 0 keyboards/quefrency/rules.mk | 74 +++ keyboards/quefrency/serial.c | 228 +++++++++ keyboards/quefrency/serial.h | 26 ++ keyboards/quefrency/split_util.c | 80 ++++ keyboards/quefrency/split_util.h | 20 + 20 files changed, 1458 insertions(+) create mode 100644 keyboards/quefrency/config.h create mode 100644 keyboards/quefrency/i2c.c create mode 100644 keyboards/quefrency/i2c.h create mode 100644 keyboards/quefrency/info.json create mode 100644 keyboards/quefrency/keymaps/default/config.h create mode 100644 keyboards/quefrency/keymaps/default/keymap.c create mode 100644 keyboards/quefrency/keymaps/default/rules.mk create mode 100644 keyboards/quefrency/matrix.c create mode 100644 keyboards/quefrency/quefrency.c create mode 100644 keyboards/quefrency/quefrency.h create mode 100644 keyboards/quefrency/readme.md create mode 100644 keyboards/quefrency/rev1/config.h create mode 100644 keyboards/quefrency/rev1/rev1.c create mode 100644 keyboards/quefrency/rev1/rev1.h create mode 100644 keyboards/quefrency/rev1/rules.mk create mode 100644 keyboards/quefrency/rules.mk create mode 100644 keyboards/quefrency/serial.c create mode 100644 keyboards/quefrency/serial.h create mode 100644 keyboards/quefrency/split_util.c create mode 100644 keyboards/quefrency/split_util.h diff --git a/keyboards/quefrency/config.h b/keyboards/quefrency/config.h new file mode 100644 index 0000000000..8f0524f972 --- /dev/null +++ b/keyboards/quefrency/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#ifdef SUBPROJECT_rev1 + #include "rev1/config.h" +#endif + +#endif diff --git a/keyboards/quefrency/i2c.c b/keyboards/quefrency/i2c.c new file mode 100644 index 0000000000..084c890c40 --- /dev/null +++ b/keyboards/quefrency/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/quefrency/info.json b/keyboards/quefrency/info.json new file mode 100644 index 0000000000..cfb72e9e0d --- /dev/null +++ b/keyboards/quefrency/info.json @@ -0,0 +1,86 @@ +{ + "keyboard_name": "Quefrency", + "url": "https://keeb.io", + "maintainer": "nooges", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + + {"label":"7", "x":8, "y":0}, + {"label":"8", "x":9, "y":0}, + {"label":"9", "x":10, "y":0}, + {"label":"0", "x":11, "y":0}, + {"label":"-", "x":12, "y":0}, + {"label":"=", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0, "w":2}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"[", "x":12.5, "y":1}, + {"label":"]", "x":13.5, "y":1}, + {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, + + {"label":"Caps", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":";", "x":11.75, "y":2}, + {"label":"'", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + + {"label":"N", "x":8.25, "y":3}, + {"label":"M", "x":9.25, "y":3}, + {"label":"<", "x":10.25, "y":3}, + {"label":">", "x":11.25, "y":3}, + {"label":"?", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.75}, + {"label":"Up", "x":15, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Alt", "x":1.25, "y":4, "w":1.25}, + {"label":"Gui", "x":2.5, "y":4, "w":1.25}, + {"label":"Fn1", "x":3.75, "y":4, "w":1.25}, + {"label":"Space", "x":5, "y":4, "w":2.25}, + + {"label":"Backspace", "x":8.25, "y":4, "w":2.75}, + {"label":"Gui", "x":11, "y":4, "w":1.25}, + {"label":"Left", "x":12.25, "y":4, "w":1.25}, + {"label":"Down", "x":13.5, "y":4, "w":1.25}, + {"label":"Right", "x":14.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/quefrency/keymaps/default/config.h b/keyboards/quefrency/keymaps/default/config.h new file mode 100644 index 0000000000..20e49c4219 --- /dev/null +++ b/keyboards/quefrency/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +#endif diff --git a/keyboards/quefrency/keymaps/default/keymap.c b/keyboards/quefrency/keymaps/default/keymap.c new file mode 100644 index 0000000000..e6aba1a276 --- /dev/null +++ b/keyboards/quefrency/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, \ + RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/quefrency/keymaps/default/rules.mk b/keyboards/quefrency/keymaps/default/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/quefrency/matrix.c b/keyboards/quefrency/matrix.c new file mode 100644 index 0000000000..fdeead7dc7 --- /dev/null +++ b/keyboards/quefrency/matrix.c @@ -0,0 +1,467 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" +#include "backlight.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#define ERROR_DISCONNECT_COUNT 5 + +#define SERIAL_LED_ADDR 0x00 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#endif + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); + +} + +uint8_t _matrix_scan(void) +{ + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); +#if (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix+offset, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix+offset, current_col); +# endif + + } +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + debouncing = false; + } +# endif + + return 1; +} + +#ifdef USE_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + +#ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); +#endif + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } + +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); +#endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) + { + + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_cols(void) +{ + for(uint8_t x = 0; x < MATRIX_COLS; x++) { + uint8_t pin = col_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#endif diff --git a/keyboards/quefrency/quefrency.c b/keyboards/quefrency/quefrency.c new file mode 100644 index 0000000000..d713a0ff3a --- /dev/null +++ b/keyboards/quefrency/quefrency.c @@ -0,0 +1 @@ +#include "quefrency.h" diff --git a/keyboards/quefrency/quefrency.h b/keyboards/quefrency/quefrency.h new file mode 100644 index 0000000000..7a791230df --- /dev/null +++ b/keyboards/quefrency/quefrency.h @@ -0,0 +1,23 @@ +#ifndef QUEFRENCY_H +#define QUEFRENCY_H + +#include "quantum.h" + +#ifdef KEYBOARD_quefrency_rev1 + #include "rev1.h" +#endif + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC3, RC4, RC5, RC6, RC7, \ + LD1, LD2, LD3, LD4, LD5, RD1, RD4, RD5, RD6, RD7 \ + ) \ + LAYOUT( \ + KC_##LA1, KC_##LA2, KC_##LA3, KC_##LA4, KC_##LA5, KC_##LA6, KC_##RA1, KC_##RA2, KC_##RA3, KC_##RA4, KC_##RA5, KC_##RA6, KC_##RA7, \ + KC_##LB1, KC_##LB2, KC_##LB3, KC_##LB4, KC_##LB5, KC_##LB6, KC_##RB1, KC_##RB2, KC_##RB3, KC_##RB4, KC_##RB5, KC_##RB7, \ + KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ + KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ + ) +#endif diff --git a/keyboards/quefrency/readme.md b/keyboards/quefrency/readme.md new file mode 100644 index 0000000000..33681c1a73 --- /dev/null +++ b/keyboards/quefrency/readme.md @@ -0,0 +1,20 @@ +Quefrency +========= + +A split 60% staggered keyboard made and sold by Keebio. [More info at Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io/) + +Make example for this keyboard (after setting up your build environment): + + make quefrency/rev1:default + +Example of flashing this keyboard: + + make quefrency/rev1:default:avrdude + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/quefrency/rev1/config.h b/keyboards/quefrency/rev1/config.h new file mode 100644 index 0000000000..c24cf5ab34 --- /dev/null +++ b/keyboards/quefrency/rev1/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1257 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Quefrency +#define DESCRIPTION Split 60 percent staggered keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +// wiring of each half +#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + + +#endif diff --git a/keyboards/quefrency/rev1/rev1.c b/keyboards/quefrency/rev1/rev1.c new file mode 100644 index 0000000000..06fbfa25e1 --- /dev/null +++ b/keyboards/quefrency/rev1/rev1.c @@ -0,0 +1,7 @@ +#include "quefrency.h" + + +void matrix_init_kb(void) { + matrix_init_user(); +}; + diff --git a/keyboards/quefrency/rev1/rev1.h b/keyboards/quefrency/rev1/rev1.h new file mode 100644 index 0000000000..44476354b9 --- /dev/null +++ b/keyboards/quefrency/rev1/rev1.h @@ -0,0 +1,37 @@ +#ifndef REV1_H +#define REV1_H + +#include "../quefrency.h" + +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT( \ + LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \ + LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \ + LE1, LE2, LE3, LE5, LE7, RE1, RE4, RE5, RE6, RE7, RE8 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ + { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ + { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \ + { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ + { RE1, KC_NO, KC_NO, RE4, RE5, RE6, RE7, RE8 } \ + } + +#endif diff --git a/keyboards/quefrency/rev1/rules.mk b/keyboards/quefrency/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/quefrency/rules.mk b/keyboards/quefrency/rules.mk new file mode 100644 index 0000000000..93ccd2b055 --- /dev/null +++ b/keyboards/quefrency/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + i2c.c \ + split_util.c \ + serial.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SUBPROJECT_rev1 = yes +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = quefrency/rev1 diff --git a/keyboards/quefrency/serial.c b/keyboards/quefrency/serial.c new file mode 100644 index 0000000000..74bcbb6bf6 --- /dev/null +++ b/keyboards/quefrency/serial.c @@ -0,0 +1,228 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifndef USE_I2C + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + serial_delay(); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 1; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/quefrency/serial.h b/keyboards/quefrency/serial.h new file mode 100644 index 0000000000..15fe4db7b4 --- /dev/null +++ b/keyboards/quefrency/serial.h @@ -0,0 +1,26 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/quefrency/split_util.c b/keyboards/quefrency/split_util.c new file mode 100644 index 0000000000..2704e30e04 --- /dev/null +++ b/keyboards/quefrency/split_util.c @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" +#include "pincontrol.h" + +#ifdef USE_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + // Test D2 pin for handedness, if D2 is grounded, it's the right hand + pinMode(D2, PinDirectionInput); + isLeftHand = digitalRead(D2); +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C + i2c_master_init(); +#ifdef SSD1306OLED + matrix_master_OLED_init(); +#endif +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + timer_init(); +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif From 956ba037ef4b9626e4f8a5f05203e056c91180a1 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:28:23 -0700 Subject: [PATCH 04/14] MT40 refactor and Configurator support (#3377) * Removed LAYOUTS ortho_4x12 and planck_grid from rules.mk * Matrix refactor * Keymap refactor * Configurator support --- keyboards/mt40/info.json | 12 ++++++++++++ keyboards/mt40/keymaps/default/keymap.c | 22 +++++++++++----------- keyboards/mt40/mt40.h | 20 +++++++++----------- keyboards/mt40/rules.mk | 2 +- 4 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 keyboards/mt40/info.json diff --git a/keyboards/mt40/info.json b/keyboards/mt40/info.json new file mode 100644 index 0000000000..c082a681a9 --- /dev/null +++ b/keyboards/mt40/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "MT40", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_mit": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + } + } +} diff --git a/keyboards/mt40/keymaps/default/keymap.c b/keyboards/mt40/keymaps/default/keymap.c index 193e548f9e..645f58e8a6 100644 --- a/keyboards/mt40/keymaps/default/keymap.c +++ b/keyboards/mt40/keymaps/default/keymap.c @@ -37,39 +37,39 @@ * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | SPC | BSP |Raise | Left | Down | Up |Right | + * | Brite| Ctrl | Alt | GUI |Lower | SPC |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_ortho_4x12( + [0] = LAYOUT_planck_mit( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, C_ENT, \ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ - C_LCTL, C_LGUI, MOD_LALT, MO(3), MO(1), KC_SPC, KC_SPC, MO(2), MO(4), MOD_RALT, C_RGUI, C_RCTL), + C_LCTL, C_LGUI, MOD_LALT, MO(3), MO(1), KC_SPC, MO(2), MO(4), MOD_RALT, C_RGUI, C_RCTL), - [1] = LAYOUT_ortho_4x12( + [1] = LAYOUT_planck_mit( _______, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, \ _______, KC_F5, KC_F6, KC_F7, KC_F8, RGB_VAD, RGB_VAI, KC_P4, KC_P5, KC_P6, KC_PAST, _______, \ _______, KC_F1, KC_F2, KC_F3, KC_F4, BL_TOGG, BL_INC, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PGUP, \ - _______, _______, _______, _______, OOOOOOO, _______, _______, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, KC_PGDN), + _______, _______, _______, _______, OOOOOOO, _______, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, KC_PGDN), - [2] = LAYOUT_ortho_4x12( + [2] = LAYOUT_planck_mit( _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, \ KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, OOOOOOO, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END), + _______, _______, _______, _______, _______, _______, OOOOOOO, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END), - [3] = LAYOUT_ortho_4x12( + [3] = LAYOUT_planck_mit( _______, _______, _______, _______, _______, _______, KC_COPY, KC_PGUP, _______, _______, KC_PASTE, KC_DEL, \ _______, _______, _______, KC_PGDN, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, \ _______, _______, KC_CUT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, OOOOOOO, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, OOOOOOO, _______, _______, _______, _______, _______, _______, _______), - [4] = LAYOUT_ortho_4x12( + [4] = LAYOUT_planck_mit( _______, _______, _______, _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, \ KC_PSCR, KC_INS, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, \ KC_CAPS, _______, KC_MPLY, KC_MRWD, KC_MFFD, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, OOOOOOO, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, OOOOOOO, _______, _______, _______), }; diff --git a/keyboards/mt40/mt40.h b/keyboards/mt40/mt40.h index 23a3d3c2bd..a539577082 100644 --- a/keyboards/mt40/mt40.h +++ b/keyboards/mt40/mt40.h @@ -23,11 +23,11 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT_planck_mit( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ ) { \ { K31, K32, K33, KC_NO, K34, K35, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K37, KC_NO, KC_NO, KC_NO }, \ { K20, K21, K22, K23, K24, K25, KC_NO, KC_NO, KC_NO, KC_NO, K2A, KC_NO, KC_NO, KC_NO, KC_NO }, \ @@ -35,27 +35,25 @@ { K10, K01, K02, K03, K04, K05, KC_NO, KC_NO, KC_NO, KC_NO, K0A, KC_NO, KC_NO, KC_NO, KC_NO }, \ { K00, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0B }, \ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, K06, K16, K26, K36, K38, K3A, K39, K3B, KC_NO, KC_NO, K07, K17, K27 }, \ + { KC_NO, KC_NO, K06, K16, K26, K35, K38, K3A, K39, K3B, KC_NO, KC_NO, K07, K17, K27 }, \ { KC_NO, KC_NO, K09, K19, K29, KC_NO, K2B, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K08, K18, K28 } \ } -#define KC_KEYMAP( \ +#define LAYOUT_kc( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ ) \ - KEYMAP( \ + LAYOUT_planck_mit( \ KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ ) -#define LAYOUT KEYMAP -#define LAYOUT_ortho_4x12 KEYMAP -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP -#define LAYOUT_kc_ortho_4x12 KC_KEYMAP +#define LAYOUT LAYOUT_planck_mit +#define LAYOUT_kc_planck_mit LAYOUT_kc diff --git a/keyboards/mt40/rules.mk b/keyboards/mt40/rules.mk index e7dc061eca..64e7413f5c 100644 --- a/keyboards/mt40/rules.mk +++ b/keyboards/mt40/rules.mk @@ -40,5 +40,5 @@ SRC = matrix.c i2c.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex -LAYOUTS = ortho_4x12 planck_mit planck_grid +LAYOUTS = planck_mit LAYOUTS_HAS_RGB = no From 82277af884a15a99e3268d02357d33b80406cf3f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:31:05 -0700 Subject: [PATCH 05/14] Ergodash refactor and Configurator update (#3378) * Moved info.json to rev1 directory * rev1 info.json metadata update * Configurator support for ErgoDash rev2 * Moved rev1/ergodash.h to ergodash.h * Integrate rev2 support into ergodash.h; delete rev2/ergodash.h --- keyboards/ergodash/ergodash.h | 46 +++++++++++++++++++++++++ keyboards/ergodash/rev1/ergodash.h | 26 -------------- keyboards/ergodash/{ => rev1}/info.json | 2 +- keyboards/ergodash/rev2/ergodash.h | 26 -------------- keyboards/ergodash/rev2/info.json | 13 +++++++ 5 files changed, 60 insertions(+), 53 deletions(-) create mode 100644 keyboards/ergodash/ergodash.h delete mode 100644 keyboards/ergodash/rev1/ergodash.h rename keyboards/ergodash/{ => rev1}/info.json (98%) delete mode 100644 keyboards/ergodash/rev2/ergodash.h create mode 100644 keyboards/ergodash/rev2/info.json diff --git a/keyboards/ergodash/ergodash.h b/keyboards/ergodash/ergodash.h new file mode 100644 index 0000000000..9900a1def8 --- /dev/null +++ b/keyboards/ergodash/ergodash.h @@ -0,0 +1,46 @@ +#ifndef ERGODASH_H +#define ERGODASH_H + +#include "quantum.h" + +#ifdef KEYBOARD_ergodash_rev1 + #include "rev1.h" + + // Used to create a keymap using only KC_ prefixed keys + #define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##LT0, KC_##LT1, KC_##LT2, KC_##LT3, KC_##LT4, KC_##LT5, KC_##RT0, KC_##RT1, KC_##RT2, KC_##RT3, KC_##RT4, KC_##RT5 \ + ) +#endif // #ifdef KEYBOARD_ergodash_rev1 + +#ifdef KEYBOARD_ergodash_rev2 + #include "rev2.h" + + // Used to create a keymap using only KC_ prefixed keys + #define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ + ) +#endif // #ifdef KEYBOARD_ergodash_rev2 + +#endif diff --git a/keyboards/ergodash/rev1/ergodash.h b/keyboards/ergodash/rev1/ergodash.h deleted file mode 100644 index b9489d5775..0000000000 --- a/keyboards/ergodash/rev1/ergodash.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ERGODASH_H -#define ERGODASH_H - -#include "quantum.h" - -#ifdef KEYBOARD_ergodash_rev1 - #include "rev1.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##LT0, KC_##LT1, KC_##LT2, KC_##LT3, KC_##LT4, KC_##LT5, KC_##RT0, KC_##RT1, KC_##RT2, KC_##RT3, KC_##RT4, KC_##RT5 \ - ) - -#endif diff --git a/keyboards/ergodash/info.json b/keyboards/ergodash/rev1/info.json similarity index 98% rename from keyboards/ergodash/info.json rename to keyboards/ergodash/rev1/info.json index dedef86791..f5ed321de6 100644 --- a/keyboards/ergodash/info.json +++ b/keyboards/ergodash/rev1/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "ErgoDash", + "keyboard_name": "ErgoDash rev1", "url": "", "maintainer": "qmk", "width": 16, diff --git a/keyboards/ergodash/rev2/ergodash.h b/keyboards/ergodash/rev2/ergodash.h deleted file mode 100644 index 0a96d5eb39..0000000000 --- a/keyboards/ergodash/rev2/ergodash.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ERGODASH_H -#define ERGODASH_H - -#include "quantum.h" - -#ifdef KEYBOARD_ergodash_rev2 - #include "rev2.h" -#endif - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - LAYOUT( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ - ) - -#endif diff --git a/keyboards/ergodash/rev2/info.json b/keyboards/ergodash/rev2/info.json new file mode 100644 index 0000000000..bcfbda6d33 --- /dev/null +++ b/keyboards/ergodash/rev2/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "ErgoDash rev2", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 6.25, + "layouts": { + "LAYOUT": { + "key_count": 70, + "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] + } + } +} From 180d39824ba3e58123a45580cd4eb5f77040a624 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:32:15 -0700 Subject: [PATCH 06/14] Helix rev1 refactor: deleted extra commas (#3379) --- keyboards/helix/rev1/rev1.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/helix/rev1/rev1.h b/keyboards/helix/rev1/rev1.h index 48300a4544..d7cd749e4d 100644 --- a/keyboards/helix/rev1/rev1.h +++ b/keyboards/helix/rev1/rev1.h @@ -25,7 +25,7 @@ #define LAYOUT( \ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ ) \ { \ { L00, L01, L02, L03, L04, L05 }, \ @@ -41,7 +41,7 @@ #define LAYOUT( \ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ ) \ { \ { L00, L01, L02, L03, L04, L05 }, \ @@ -147,12 +147,12 @@ #define LAYOUT_kc( \ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ ) \ LAYOUT( \ KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25 \ ) #elif HELIX_ROWS == 4 #define LAYOUT_kc( \ From de7d1d35c8904d20c5d8ae4fc8c2263b4dff5d43 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:33:52 -0700 Subject: [PATCH 07/14] Configurator fix: Removed an extra key (#3380) --- keyboards/lfkeyboards/lfk78/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/lfkeyboards/lfk78/info.json b/keyboards/lfkeyboards/lfk78/info.json index e5723c041d..4af5a37ba1 100644 --- a/keyboards/lfkeyboards/lfk78/info.json +++ b/keyboards/lfkeyboards/lfk78/info.json @@ -6,7 +6,7 @@ "height": 5, "layouts": { "LAYOUT": { - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Backspace", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"Enter", "x":16, "y":1, "w":1.25, "h":2}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"@", "x":14, "y":2}, {"label":"~", "x":15, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":1.25}, {"label":"|", "x":3.5, "y":3}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"Win", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Back Space", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] }, "LAYOUT_split_bs": { "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Back Space", "x":15.25, "y":0}, {"label":"Back Space", "x":16.25, "y":0}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] From 1236eac4f2ca220c21cc73b0bc4e39d0b2d9df63 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Jul 2018 13:35:51 -0400 Subject: [PATCH 08/14] Slow down speed of All Star song by factor of 4 (#3383) --- layouts/community/ortho_4x12/bakingpy/config.h | 4 ++++ layouts/community/ortho_4x12/bakingpy/keymap.c | 2 +- quantum/audio/song_list.h | 16 ++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/layouts/community/ortho_4x12/bakingpy/config.h b/layouts/community/ortho_4x12/bakingpy/config.h index 28444fe479..77fa69ad78 100644 --- a/layouts/community/ortho_4x12/bakingpy/config.h +++ b/layouts/community/ortho_4x12/bakingpy/config.h @@ -23,4 +23,8 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 +#ifdef AUDIO_ENABLE +#define C6_AUDIO +#endif + #endif diff --git a/layouts/community/ortho_4x12/bakingpy/keymap.c b/layouts/community/ortho_4x12/bakingpy/keymap.c index e003513317..b34e57cbeb 100644 --- a/layouts/community/ortho_4x12/bakingpy/keymap.c +++ b/layouts/community/ortho_4x12/bakingpy/keymap.c @@ -203,8 +203,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_ASTR: if (record->event.pressed) { #ifdef AUDIO_ENABLE - SEND_STRING("Hey now, you're an all-star, get your game on, go play. Hey now, you're a rock star, get the show on, get paid. All that glitters is gold. Only shooting stars break the mold."); PLAY_SONG(all_star_song); + SEND_STRING("Hey now, you're an all-star, get your game on, go play. Hey now, you're a rock star, get the show on, get paid. All that glitters is gold. Only shooting stars break the mold."); #endif } return false; diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 01cc6f4ed1..2bee6d6333 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -436,13 +436,13 @@ Q__NOTE(_C6), \ #define ALL_STAR \ - E__NOTE(_AS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), E__NOTE(_FS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), \ - E__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_FS4), QD_NOTE(_AS4), \ - E__NOTE(_AS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), E__NOTE(_FS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), \ - E__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_AS4), E__NOTE(_REST),\ - Q__NOTE(_AS4), Q__NOTE(_CS5), E__NOTE(_B4), E__NOTE(_CS5), E__NOTE(_DS5), Q__NOTE(_FS5), \ - E__NOTE(_GS5), Q__NOTE(_GS5), E__NOTE(_FS4), E__NOTE(_FS4), E__NOTE(_GS4), E__NOTE(_FS4), \ - E__NOTE(_AS4), Q__NOTE(_GS4), Q__NOTE(_GS4), Q__NOTE(_FS4), Q__NOTE(_GS4), \ - E__NOTE(_AS4), HD_NOTE(_DS4) + H__NOTE(_AS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), H__NOTE(_FS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), \ + H__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_FS4), QD_NOTE(_AS4), \ + H__NOTE(_AS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), H__NOTE(_FS4), W__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_DS4), \ + H__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_FS4), W__NOTE(_AS4), H__NOTE(_REST),\ + W__NOTE(_AS4), W__NOTE(_CS5), H__NOTE(_B4), H__NOTE(_CS5), H__NOTE(_DS5), W__NOTE(_FS5), \ + H__NOTE(_GS5), W__NOTE(_GS5), H__NOTE(_FS4), H__NOTE(_FS4), H__NOTE(_GS4), H__NOTE(_FS4), \ + H__NOTE(_AS4), W__NOTE(_GS4), W__NOTE(_GS4), W__NOTE(_FS4), W__NOTE(_GS4), \ + H__NOTE(_AS4), WD_NOTE(_DS4) #endif From 9c35c5979c232749ee05444f9d810536c31c937c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:36:47 -0700 Subject: [PATCH 09/14] Update JC65 Readme (#3384) --- keyboards/jc65/readme.md | 7 ++++--- keyboards/jc65/v32a/readme.md | 14 ++++++++++---- keyboards/jc65/v32u4/readme.md | 10 +++++----- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/keyboards/jc65/readme.md b/keyboards/jc65/readme.md index 3ab10b1815..6fb2e5edcf 100644 --- a/keyboards/jc65/readme.md +++ b/keyboards/jc65/readme.md @@ -1,10 +1,11 @@ -JC65 -=== +# JC65 ![JC65 with 32u4](https://i.imgur.com/I4hCyBI.jpg) ![JC65 with 32a](https://i.imgur.com/9cJ9UbX.jpg) -The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy and are now currently available on [keyclack.com](https://keyclack.com/) +The JC65 is the PCB for the Rama M65-A sold through [keyclack.com](https://keyclack.com/). There are two revisions available, a native QMK powered PCB (v32u4) and a PS2AVRGB PCB (v32a), both are available on keyclack. + +QMK is supported for both variants. Make example native QMK version (after setting up your build environment): diff --git a/keyboards/jc65/v32a/readme.md b/keyboards/jc65/v32a/readme.md index 84a5b962d1..b4d4f7e504 100644 --- a/keyboards/jc65/v32a/readme.md +++ b/keyboards/jc65/v32a/readme.md @@ -5,13 +5,15 @@ JC65 ps2avrGB A 65% keyboard with RGB -Keyboard Maintainer: [Jason Barnachea](https://github.com/nautxx) +Keyboard Maintainer: [Jason Barnachea](https://github.com/nautxx) -Hardware Supported: JC65 rev.ps2avrgb +Hardware Supported: JC65 rev.ps2avrgb -Hardware Availability: [keyclack.com](https://keyclack.com/) +Hardware Availability: [keyclack.com](https://keyclack.com/) -The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. In the near future both PCB versions should be available from keyclack.com when the storefront part opens. +The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. + +Please note that there have been issues with QMK and PS2AVRGB boards. Random shutdowns and overheating have been reported. As of now, the cause has not been discovered. These docs are for the PS2AVRGB version of the PCB. More info on qmk.fm @@ -23,4 +25,8 @@ Flash example for this keyboard: bootloadHID -r jc65_v32a_default.hex +Flashing on Windows can be accomplished by downloading [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash) + +To put the PS2AVRGB board into reset, hold down the left control key while plugging in the keyboard. + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/jc65/v32u4/readme.md b/keyboards/jc65/v32u4/readme.md index c85c166a25..396c19e8db 100644 --- a/keyboards/jc65/v32u4/readme.md +++ b/keyboards/jc65/v32u4/readme.md @@ -3,13 +3,13 @@ JC65 ![JC65](https://i.imgur.com/I4hCyBI.jpg) -The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. In the near future both PCB versions should be available from keyclack.com when the storefront part opens. +The JC65 PCB actually has two revisions: A QMK native version, and a PS2AVRGB version. Jchan offered both PCBs as options during the M65-A Round 1 group buy, and were also available choices for the 65% acrylic case group buy. -These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/planck/) +These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/planck/) -Keyboard Maintainer: [Ethan Madden](https://github.com/jetpacktuxedo) -Hardware Supported: JC65 rev.qmk -Hardware Availability: [keyclack.com](https://keyclack.com/) +Keyboard Maintainer: [Ethan Madden](https://github.com/jetpacktuxedo) +Hardware Supported: JC65 rev.qmk +Hardware Availability: [keyclack.com](https://keyclack.com/) Make example for this keyboard (after setting up your build environment): From ed98250e62d9e37218931d09a4216ffe09d3ce3a Mon Sep 17 00:00:00 2001 From: Maarten Dekkers Date: Thu, 12 Jul 2018 21:42:36 +0200 Subject: [PATCH 10/14] Add kmini (#3386) * Add kmini * Change keyboard USB description --- keyboards/kmini/config.h | 58 +++++ keyboards/kmini/info.json | 6 + keyboards/kmini/keymaps/default/keymap.c | 60 +++++ keyboards/kmini/kmini.c | 53 ++++ keyboards/kmini/kmini.h | 36 +++ keyboards/kmini/matrix.c | 303 +++++++++++++++++++++++ keyboards/kmini/readme.md | 13 + keyboards/kmini/rules.mk | 71 ++++++ 8 files changed, 600 insertions(+) create mode 100755 keyboards/kmini/config.h create mode 100755 keyboards/kmini/info.json create mode 100755 keyboards/kmini/keymaps/default/keymap.c create mode 100755 keyboards/kmini/kmini.c create mode 100755 keyboards/kmini/kmini.h create mode 100755 keyboards/kmini/matrix.c create mode 100755 keyboards/kmini/readme.md create mode 100755 keyboards/kmini/rules.mk diff --git a/keyboards/kmini/config.h b/keyboards/kmini/config.h new file mode 100755 index 0000000000..567a754429 --- /dev/null +++ b/keyboards/kmini/config.h @@ -0,0 +1,58 @@ +/* Copyright 2018 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Revo +#define PRODUCT KMAC Kmini +#define DESCRIPTION QMK keyboard firmware for Revo KMAC Mini + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * The KMAC uses a demultiplexer for some of the cols. + * See matrix.c for more details. +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION CUSTOM_MATRIX + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif diff --git a/keyboards/kmini/info.json b/keyboards/kmini/info.json new file mode 100755 index 0000000000..e5631f9334 --- /dev/null +++ b/keyboards/kmini/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "KMAC Mini", + "url": "http://kbdmodadmin.cafe24.com/product/detail.html?product_no=12&cate_no=4&display_group=1", + "maintainer": "maartenwut" + } +} diff --git a/keyboards/kmini/keymaps/default/keymap.c b/keyboards/kmini/keymaps/default/keymap.c new file mode 100755 index 0000000000..73d9b611e3 --- /dev/null +++ b/keyboards/kmini/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kmini.h" + +// Helpful defines +#define _____ KC_TRNS + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _MA 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MA] = LAYOUT( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT( + _____, _____, _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ + _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ \ + ), +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "kmini.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + led_init_ports(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_init_ports(void) { + DDRB |= (1<<1); // OUT + DDRB |= (1<<2); // OUT + DDRB |= (1<<3); // OUT +} + +/* LED pin configuration + * Caps Lock: Low B1 + * Side1: Low B3 + * Side2: Low B2 + */ +void led_set_kb(uint8_t usb_led) { + led_set_user(usb_led); +} + diff --git a/keyboards/kmini/kmini.h b/keyboards/kmini/kmini.h new file mode 100755 index 0000000000..0576425ead --- /dev/null +++ b/keyboards/kmini/kmini.h @@ -0,0 +1,36 @@ +/* Copyright 2018 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef KMINI_H +#define KMINI_H +#define ___ KC_NO + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3E, K3F, K3G, \ + K40, K41, K42, K43, K44, K47, K4C, K4E, K4F, K4G \ +) { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, ___, K2F, K2G}, \ + {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___, K3E, K3F, K3G}, \ + {K40, K41, K42, K43, K44, ___, ___, K47, ___, ___, ___, ___, K4C, ___, K4E, K4F, K4G}, \ +} + +#endif diff --git a/keyboards/kmini/matrix.c b/keyboards/kmini/matrix.c new file mode 100755 index 0000000000..f0733340ce --- /dev/null +++ b/keyboards/kmini/matrix.c @@ -0,0 +1,303 @@ +/* Copyright 2018 Maarten Dekkers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + + +/* Set 0 if debouncing isn't needed */ +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#define COL_SHIFTER ((uint32_t)1) + +static uint16_t debouncing_time; +static bool debouncing = false; + + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static void init_rows(void); +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); +static void unselect_cols(void); +static void select_col(uint8_t col); + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + unselect_cols(); + init_rows(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1> 4) & _BV(E2 & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (COL_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(COL_SHIFTER << current_col); + } + } + else { + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF))) + { + // Pin HI, set col bit + current_matrix[row_index] |= (COL_SHIFTER << current_col); + } + else + { + // Pin LO, clear col bit + current_matrix[row_index] &= ~(COL_SHIFTER << current_col); + } + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect cols + unselect_cols(); + + return matrix_changed; +} + +/* Row pin configuration + * row: 0 1 2 3 4 + * pin: D0 D1 D2 D3 D5 + * + * Caps lock uses its own pin E2 + */ +static void init_rows(void) { + DDRD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // IN + PORTD &= ~((1<<0)| (1<<1) | (1<<2) | (1<<3) | (1<<5)); // LO + + DDRE &= ~(1<<2); // IN + PORTE |= (1<<2); // HI +} + +/* Columns 0 - 16 + * col 0: B5 + * col 1: B6 + * These columns use a 74HC237D 3 to 8 bit demultiplexer. + * A B C GL1 + * col / pin: PF0 PF1 PC7 PC6 + * 2: 0 0 0 1 + * 3: 1 0 0 1 + * 4: 0 1 0 1 + * 5: 1 1 0 1 + * 6: 0 0 1 1 + * 7: 1 0 1 1 + * 8: 0 1 1 1 + * 9: 1 1 1 1 + * col 10: E6 + * col 11: B0 + * col 12: B7 + * col 13: D4 + * col 14: D6 + * col 15: D7 + * col 16: B4 + */ +static void unselect_cols(void) { + DDRB |= (1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4); // OUT + PORTB &= ~((1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4)); // LO + + DDRD |= (1<<4) | (1<<6) | (1<<7); // OUT + PORTD &= ~((1<<4) | (1<<6) | (1<<7)); // LO + + DDRE |= (1<<6); // OUT + PORTE &= ~((1<<6)); // LO + + DDRF |= (1<<0) | (1<<1); // OUT + PORTF &= ~((1<<0) | (1<<1)); // LO + + DDRC |= (1<<7) | (1<<6); // OUT + PORTC &= ~((1<<7) | (1<<6)); // LO +} + +static void select_col(uint8_t col) +{ + switch (col) { + case 0: + PORTB |= (1<<5); // HI + break; + case 1: + PORTB |= (1<<6); // HI + break; + case 2: + PORTC |= (1<<6); // HI + break; + case 3: + PORTC |= (1<<6); // HI + PORTF |= (1<<0); // HI + break; + case 4: + PORTC |= (1<<6); // HI + PORTF |= (1<<1); // HI + break; + case 5: + PORTC |= (1<<6); // HI + PORTF |= (1<<0); // HI + PORTF |= (1<<1); // HI + break; + case 6: + PORTC |= (1<<6); // HI + PORTC |= (1<<7); // HI + break; + case 7: + PORTC |= (1<<6); // HI + PORTF |= (1<<0); // HI + PORTC |= (1<<7); // HI + break; + case 8: + PORTC |= (1<<6); // HI + PORTF |= (1<<1); // HI + PORTC |= (1<<7); // HI + break; + case 9: + PORTC |= (1<<6); // HI + PORTF |= (1<<0); // HI + PORTF |= (1<<1); // HI + PORTC |= (1<<7); // HI + break; + case 10: + PORTE |= (1<<6); // HI + break; + case 11: + PORTB |= (1<<0); // HI + break; + case 12: + PORTB |= (1<<7); // HI + break; + case 13: + PORTD |= (1<<4); // HI + break; + case 14: + PORTD |= (1<<6); // HI + break; + case 15: + PORTD |= (1<<7); // HI + break; + case 16: + PORTB |= (1<<4); // HI + break; + } +} diff --git a/keyboards/kmini/readme.md b/keyboards/kmini/readme.md new file mode 100755 index 0000000000..2a9e8e7908 --- /dev/null +++ b/keyboards/kmini/readme.md @@ -0,0 +1,13 @@ +Kmini keyboard firmware +====================== + +The Revo Kmini is a 65% keyboard with an additional two columns on the left. It is programmed with the 'KMAC key map', which only works on Windows and according to a [user](https://www.keebtalk.com/t/programming-revo-kmini/2107/7) it cannot map media controls or change the capslock key. + +## Hardware +Columns 0, 1 and 10-16 and rows 0-4 are wired directly to the ATmega32u4, and columns 2-9 are wired to the [74HC237D demultiplexer](https://www.mouser.de/datasheet/2/916/74HC237-1319445.pdf). Capslock is on E2 and also triggers a reset if held when plugging the cable in. There are three possible places for leds, which are the capslock key and the two keys above the right arrow key. All three of them are individually controllable. The ATmega32u4 runs on an external crystal on 8mhz, so you'll have to change the bitclock on the ISP programmer if you're unable to read or write the chip. + +## How to build +Please read the [documentation](https://docs.qmk.fm). + +## How to flash +Hold the capslock key while plugging in the USB and flash the .hex file using QMK Toolbox or Atmel FLIP. \ No newline at end of file diff --git a/keyboards/kmini/rules.mk b/keyboards/kmini/rules.mk new file mode 100755 index 0000000000..a4183870ca --- /dev/null +++ b/keyboards/kmini/rules.mk @@ -0,0 +1,71 @@ +# Project specific files +SRC = matrix.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 8000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +CUSTOM_MATRIX = yes # Custom matrix file +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches From f5ebfdabcdd72241103bf7c40b7668fbaca7281d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 12 Jul 2018 16:30:53 -0700 Subject: [PATCH 11/14] Kmini refactor and Configurator support (#3388) * default keymap refactor: QMK_KEYBOARD_H include; readability * Configurator support * info.json was missing a comma * Added matrix functions to matrix.c per @drashna --- keyboards/kmini/info.json | 8 +++++- keyboards/kmini/keymaps/default/keymap.c | 33 +++++++++++------------- keyboards/kmini/matrix.c | 24 ++++++++++++++--- 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/keyboards/kmini/info.json b/keyboards/kmini/info.json index e5631f9334..13d8176a7d 100755 --- a/keyboards/kmini/info.json +++ b/keyboards/kmini/info.json @@ -1,6 +1,12 @@ { "keyboard_name": "KMAC Mini", "url": "http://kbdmodadmin.cafe24.com/product/detail.html?product_no=12&cate_no=4&display_group=1", - "maintainer": "maartenwut" + "maintainer": "maartenwut", + "width": 18.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Backspace", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.25, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.25, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"PgUp", "x":17.25, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":1.75}, {"label":"\u2191", "x":16.25, "y":3}, {"label":"PgDn", "x":17.25, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.5}, {"label":"GUI", "x":3.75, "y":4}, {"label":"Alt", "x":4.75, "y":4, "w":1.5}, {"x":6.25, "y":4, "w":7}, {"label":"Fn", "x":13.25, "y":4, "w":1.5}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}] + } } } diff --git a/keyboards/kmini/keymaps/default/keymap.c b/keyboards/kmini/keymaps/default/keymap.c index 73d9b611e3..9f93144847 100755 --- a/keyboards/kmini/keymaps/default/keymap.c +++ b/keyboards/kmini/keymaps/default/keymap.c @@ -13,10 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kmini.h" - -// Helpful defines -#define _____ KC_TRNS +#include QMK_KEYBOARD_H // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -26,20 +23,20 @@ #define _FN 1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MA] = LAYOUT( - KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - [_FN] = LAYOUT( - _____, _____, _____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, _____, \ - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, \ - _____, _____, _____, _____, _____, _____, _____, _____, _____, _____ \ - ), + [_MA] = LAYOUT( + KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT( + _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), }; void led_set_user(uint8_t usb_led) { diff --git a/keyboards/kmini/matrix.c b/keyboards/kmini/matrix.c index f0733340ce..5f9bfe3d7f 100755 --- a/keyboards/kmini/matrix.c +++ b/keyboards/kmini/matrix.c @@ -48,6 +48,22 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void unselect_cols(void); static void select_col(uint8_t col); +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + inline uint8_t matrix_rows(void) { return MATRIX_ROWS; @@ -219,16 +235,16 @@ static void init_rows(void) { static void unselect_cols(void) { DDRB |= (1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4); // OUT PORTB &= ~((1<<5) | (1<<6) | (1<<0) | (1<<7) | (1<<4)); // LO - + DDRD |= (1<<4) | (1<<6) | (1<<7); // OUT PORTD &= ~((1<<4) | (1<<6) | (1<<7)); // LO - + DDRE |= (1<<6); // OUT PORTE &= ~((1<<6)); // LO - + DDRF |= (1<<0) | (1<<1); // OUT PORTF &= ~((1<<0) | (1<<1)); // LO - + DDRC |= (1<<7) | (1<<6); // OUT PORTC &= ~((1<<7) | (1<<6)); // LO } From b7cbae8d1f3c370e2127a3757fdd67dbf12a567d Mon Sep 17 00:00:00 2001 From: Luma Date: Fri, 13 Jul 2018 08:01:42 -0700 Subject: [PATCH 12/14] Tada68: Updated links to external sites. (#3389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Friend was having trouble with their tada since their build environment wasn’t setup. Updated so they could access the links that were listed (old links 404’d) --- keyboards/tada68/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index 68717a8665..b0a1175f70 100755 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -11,7 +11,7 @@ Make example for this keyboard (after setting up your build environment): make tada68:default:bin -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. ## Flashing Instructions From d9619be49963deac27c1b99534807b19748eab15 Mon Sep 17 00:00:00 2001 From: Eric <22215921+ericywl@users.noreply.github.com> Date: Fri, 13 Jul 2018 23:03:57 +0800 Subject: [PATCH 13/14] Added E6v2 keymap & some minor changes (#3392) * Changed HHKB ALT to GUI etc. * Swapped DZ60 GUI and ALT key * Added E6v2 keymap * Fixed CAPS to LCTL on E6v2 --- keyboards/dz60/keymaps/eric/keymap.c | 2 +- keyboards/e6v2/le/keymaps/eric/keymap.c | 31 +++++++++++++++++++++++++ keyboards/hhkb/keymaps/eric/keymap.c | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 keyboards/e6v2/le/keymaps/eric/keymap.c diff --git a/keyboards/dz60/keymaps/eric/keymap.c b/keyboards/dz60/keymaps/eric/keymap.c index 73fe52bd20..d2cabebe74 100644 --- a/keyboards/dz60/keymaps/eric/keymap.c +++ b/keyboards/dz60/keymaps/eric/keymap.c @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), - KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL), + KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_RALT, KC_RCTL), diff --git a/keyboards/e6v2/le/keymaps/eric/keymap.c b/keyboards/e6v2/le/keymaps/eric/keymap.c new file mode 100644 index 0000000000..4d3052ef2c --- /dev/null +++ b/keyboards/e6v2/le/keymaps/eric/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /*rBase layer */ + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, KC_SPACE, KC_SPACE, KC_RGUI, KC_RGUI, KC_RALT, KC_RCTL, KC_RCTL + ), + + /* Function layer */ + [1] = LAYOUT( + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, KC_AMPR, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_UP, KC_DEL, KC_BSPC, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_ASTR, KC_TRNS, KC_TRNS, KC_PGUP, KC_HOME, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UNDS, KC_PLUS, KC_LPRN, KC_RPRN, KC_PIPE, KC_TRNS, KC_TRNS, KC_PGDN, KC_END, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), MO(2), KC_TRNS + ), + + /* Reset layer */ + [2] = LAYOUT( + RESET, KC_A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + ), + +}; diff --git a/keyboards/hhkb/keymaps/eric/keymap.c b/keyboards/hhkb/keymaps/eric/keymap.c index 46dcd95c03..0f3b4c7f36 100644 --- a/keyboards/hhkb/keymaps/eric/keymap.c +++ b/keyboards/hhkb/keymaps/eric/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), - KC_LGUI, KC_LALT, /* */ KC_SPC, KC_RALT, KC_RGUI), + KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT), /* Layer HHKB: HHKB mode (HHKB Fn) |------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----| From c7b8e45ba15eb31ddaa3ac49983e3e94bfc86f6e Mon Sep 17 00:00:00 2001 From: KeLorean Date: Fri, 13 Jul 2018 11:52:15 -0400 Subject: [PATCH 14/14] Docs: add resources for git (#3390) * add resources for git * add more resources --- docs/newbs.md | 4 +++- docs/newbs_learn_more_resources.md | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 docs/newbs_learn_more_resources.md diff --git a/docs/newbs.md b/docs/newbs.md index eea8ea0fa2..87933b018c 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -1,4 +1,4 @@ -# The Compelete Newbs Guide To QMK +# The Complete Newbs Guide To QMK QMK is a powerful Open Source firmware for your mechanical keyboard. You can use QMK to customize your keyboard in ways both simple and powerful. People of all skill levels, from complete newbie to master programmer, have successfully used QMK to customize their keyboard. This guide will help you do the same, no matter your skill level. @@ -12,5 +12,7 @@ There are 4 main sections to this guide: * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) +* [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). + diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md new file mode 100644 index 0000000000..69d165c2bb --- /dev/null +++ b/docs/newbs_learn_more_resources.md @@ -0,0 +1,13 @@ +# Learning Resources +These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs. + +Git resources: +* +*[Great General Tutorial](https://www.codecademy.com/learn/learn-git) +*[Git Game To Learn From Examples](https://learngitbranching.js.org/) +*[Git Resources to Learn More About Github](getting_started_github.md) +*[Git Resources Aimed Specificly toward QMK](contributing.md) + + +Command Line resources: +*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) \ No newline at end of file