From 4c71b329a228738f5c39eb07ed806ce14fbe97af Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Mon, 26 Jun 2017 22:33:14 +0200 Subject: [PATCH 01/15] clone smt layout --- keyboards/lets_split/keymaps/fabian/config.h | 34 +++ keyboards/lets_split/keymaps/fabian/keymap.c | 219 ++++++++++++++++++ keyboards/lets_split/keymaps/fabian/readme.md | 88 +++++++ 3 files changed, 341 insertions(+) create mode 100644 keyboards/lets_split/keymaps/fabian/config.h create mode 100644 keyboards/lets_split/keymaps/fabian/keymap.c create mode 100644 keyboards/lets_split/keymaps/fabian/readme.md diff --git a/keyboards/lets_split/keymaps/fabian/config.h b/keyboards/lets_split/keymaps/fabian/config.h new file mode 100644 index 000000000..ba271d1ac --- /dev/null +++ b/keyboards/lets_split/keymaps/fabian/config.h @@ -0,0 +1,34 @@ +/* +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 . +*/ + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + + +#ifdef SUBPROJECT_rev1 + #include "../../rev1/config.h" +#endif +#ifdef SUBPROJECT_rev2 + #include "../../rev2/config.h" +#endif +#ifdef SUBPROJECT_rev2fliphalf + #include "../../rev2fliphalf/config.h" +#endif diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c new file mode 100644 index 000000000..18d409f08 --- /dev/null +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -0,0 +1,219 @@ +#include "lets_split.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 _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) + +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 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `-----------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + 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, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ + MEH_GRV, 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 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `-----------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + 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, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ + MEH_GRV, 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 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `-----------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + 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_MINS, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ +[_LOWER] = KEYMAP( \ + ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + CTL_T(KC_DLR), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | _ | ? | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | - | / | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Home |PageDn|PageUp| End | + * `-----------------------------------------' `-----------------------------------------' + */ +[_RAISE] = KEYMAP( \ + ALL_T(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_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset| | | | | | | | | | | Reset| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +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_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistent_default_layer_set(1UL<<_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 ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split/keymaps/fabian/readme.md b/keyboards/lets_split/keymaps/fabian/readme.md new file mode 100644 index 000000000..20bc662f0 --- /dev/null +++ b/keyboards/lets_split/keymaps/fabian/readme.md @@ -0,0 +1,88 @@ +# smt's Let's Split keymap + +This keymap is ported from my Planck keymap. + + +## 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 | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------' `-----------------------------------------' +``` + +## 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 | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------' `-----------------------------------------' +``` + +## 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 | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------' `-----------------------------------------' +``` + +## Lower + +``` +,-----------------------------------------. ,-----------------------------------------. +| 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------' `-----------------------------------------' +``` + +## Raise + +``` +,-----------------------------------------. ,-----------------------------------------. +| ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | _ | ? | + | { | } | | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | - | / | = | [ | ] | \ | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | | | Home |PageDn|PageUp| End | +`-----------------------------------------' `-----------------------------------------' +``` + +## Adjust (Lower + Raise) + +``` +,-----------------------------------------. ,-----------------------------------------. +| | Reset| | | | | | | | | | | Reset| +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | | | | | | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | | | | | | | | | +`-----------------------------------------' `-----------------------------------------' +``` From 786eb4e73d92cbca81e7893095f9c689f4577d91 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Tue, 27 Jun 2017 09:14:04 +0200 Subject: [PATCH 02/15] my layout --- keyboards/lets_split/keymaps/fabian/keymap.c | 45 ++++++++++---------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index 18d409f08..1793bcc05 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -31,6 +31,7 @@ enum custom_keycodes { // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) @@ -44,14 +45,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | * `-----------------------------------------' `-----------------------------------------' */ [_QWERTY] = KEYMAP( \ 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, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ ), /* Colemak @@ -62,14 +63,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | * `-----------------------------------------' `-----------------------------------------' */ [_COLEMAK] = KEYMAP( \ 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, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ ), /* Dvorak @@ -80,50 +81,50 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | + * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | * `-----------------------------------------' `-----------------------------------------' */ [_DVORAK] = KEYMAP( \ 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_MINS, \ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ ), /* Lower * ,-----------------------------------------. ,-----------------------------------------. - * | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | + * | | F7 | F8 | F9 | F10 | F11 | | F12 | Left | Down | Up |Right | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * | | | | | | | | | | Home |PageDn|PageUp| End | * `-----------------------------------------' `-----------------------------------------' */ [_LOWER] = KEYMAP( \ - ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - CTL_T(KC_DLR), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ALL_T(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_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), /* Raise * ,-----------------------------------------. ,-----------------------------------------. - * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | _ | ? | + | { | } | | | + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | - | / | = | [ | ] | \ | + * | | F7 | F8 | F9 | F10 | F11 | | F12 | Left | Down | Up | Right| | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | Home |PageDn|PageUp| End | + * | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------' `-----------------------------------------' */ [_RAISE] = KEYMAP( \ - ALL_T(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_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + ALL_T(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_LCBR, KC_RCBR, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) From 7d0a471051551c3ef9d8a60dbf4bc5b1b2d70cea Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Tue, 27 Jun 2017 09:18:05 +0200 Subject: [PATCH 03/15] removed wrong readme --- keyboards/lets_split/keymaps/fabian/readme.md | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 keyboards/lets_split/keymaps/fabian/readme.md diff --git a/keyboards/lets_split/keymaps/fabian/readme.md b/keyboards/lets_split/keymaps/fabian/readme.md deleted file mode 100644 index 20bc662f0..000000000 --- a/keyboards/lets_split/keymaps/fabian/readme.md +++ /dev/null @@ -1,88 +0,0 @@ -# smt's Let's Split keymap - -This keymap is ported from my Planck keymap. - - -## 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 | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | -`-----------------------------------------' `-----------------------------------------' -``` - -## 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 | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | -`-----------------------------------------' `-----------------------------------------' -``` - -## 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 | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | -`-----------------------------------------' `-----------------------------------------' -``` - -## Lower - -``` -,-----------------------------------------. ,-----------------------------------------. -| 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | | | Next | Vol- | Vol+ | Play | -`-----------------------------------------' `-----------------------------------------' -``` - -## Raise - -``` -,-----------------------------------------. ,-----------------------------------------. -| ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | _ | ? | + | { | } | | | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | - | / | = | [ | ] | \ | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | | | Home |PageDn|PageUp| End | -`-----------------------------------------' `-----------------------------------------' -``` - -## Adjust (Lower + Raise) - -``` -,-----------------------------------------. ,-----------------------------------------. -| | Reset| | | | | | | | | | | Reset| -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | | | | | | | -|------+------+------+------+------+------| |------+------+------+------+------+------| -| | | | | | | | | | | | | | -`-----------------------------------------' `-----------------------------------------' -``` From 9aa748df2a65517b7216ea5bd10aa64bfbf62c2a Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Tue, 27 Jun 2017 10:36:00 +0200 Subject: [PATCH 04/15] my layout --- keyboards/lets_split/keymaps/fabian/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index 1793bcc05..d448bb04b 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -45,14 +45,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | + * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | * `-----------------------------------------' `-----------------------------------------' */ [_QWERTY] = KEYMAP( \ 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, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ + KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI ), /* Colemak @@ -63,14 +63,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | + * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | * `-----------------------------------------' `-----------------------------------------' */ [_COLEMAK] = KEYMAP( \ 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, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ + KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI ), /* Dvorak @@ -81,14 +81,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | | + * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | * `-----------------------------------------' `-----------------------------------------' */ [_DVORAK] = KEYMAP( \ 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_MINS, \ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ - MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, _______ + KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI ), /* Lower From 99b6e918eab31d4f53cabc04a995da945335ac7f Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Tue, 27 Jun 2017 16:20:17 +0200 Subject: [PATCH 05/15] fixed brackets --- keyboards/lets_split/keymaps/fabian/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index d448bb04b..b3e19aaea 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -122,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = KEYMAP( \ ALL_T(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_LCBR, KC_RCBR, KC_BSLS, \ + 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_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), From c7ea65c6d3c0fe50e7c77831c68b435d440be73d Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 11:09:29 +0200 Subject: [PATCH 06/15] default based customizations --- keyboards/lets_split/keymaps/fabian/keymap.c | 159 ++++++++++--------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index b3e19aaea..c15c9724e 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -28,123 +28,124 @@ enum custom_keycodes { #define _______ KC_TRNS #define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) -#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) +// Custom +#define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +// #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) 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 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ 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, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, 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 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = KEYMAP( \ 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, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, 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 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | GUI | Ctrl | Alt | GUI |Lower |Space | | Bksp |Raise | GUI |AltGr | Ctrl | GUI | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' */ [_DVORAK] = KEYMAP( \ 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_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ - KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KC_RGUI + CTL_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, SFT_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower - * ,-----------------------------------------. ,-----------------------------------------. - * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | F12 | Left | Down | Up |Right | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | Home |PageDn|PageUp| End | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | MS L | MS D |MS U | MS R |MS Btn| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' */ [_LOWER] = KEYMAP( \ - ALL_T(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_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + 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 | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | F12 | Left | Down | Up | Right| | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | Left | Down | Up | Rght |MS_BN2| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' */ [_RAISE] = KEYMAP( \ - ALL_T(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_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + 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 \ ), /* Adjust (Lower + Raise) - * ,-----------------------------------------. ,-----------------------------------------. - * | | Reset| | | | | | | | | | | Reset| - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | - * `-----------------------------------------' `-----------------------------------------' + * ,-----------------------------------------------------------------------------------. + * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Reset | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = KEYMAP( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, RESET, KC_DEL, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) + }; #ifdef AUDIO_ENABLE From 75677655ad1546e5c75cdeafc136d59b99f26480 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 11:11:13 +0200 Subject: [PATCH 07/15] left shift is backspace on tap --- keyboards/lets_split/keymaps/fabian/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index c15c9724e..b253dbfc1 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = KEYMAP( \ 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, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), @@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_COLEMAK] = KEYMAP( \ 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, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ + SFT_BSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , \ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), @@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = KEYMAP( \ 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, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , \ + SFT_BSP, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , \ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), From 3b05183deb37dd39a7dcc9d989da1e7ee61c19a5 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 12:18:40 +0200 Subject: [PATCH 08/15] symmetric modifiers in bottom row --- keyboards/lets_split/keymaps/fabian/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/lets_split/keymaps/fabian/keymap.c b/keyboards/lets_split/keymaps/fabian/keymap.c index b253dbfc1..0af505b47 100644 --- a/keyboards/lets_split/keymaps/fabian/keymap.c +++ b/keyboards/lets_split/keymaps/fabian/keymap.c @@ -45,14 +45,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ 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 , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST \ ), /* Colemak @@ -63,14 +63,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = KEYMAP( \ 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 , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST \ ), /* Dvorak @@ -81,14 +81,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * |Adjust| Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| * `-----------------------------------------------------------------------------------' */ [_DVORAK] = KEYMAP( \ 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 , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST \ ), /* Lower From de9331c50cb8ec769f7f4fb2eb7a73a435fc4db2 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 12:19:13 +0200 Subject: [PATCH 09/15] custom makefile --- keyboards/lets_split/keymaps/fabian/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 keyboards/lets_split/keymaps/fabian/Makefile diff --git a/keyboards/lets_split/keymaps/fabian/Makefile b/keyboards/lets_split/keymaps/fabian/Makefile new file mode 100644 index 000000000..b8c82cb99 --- /dev/null +++ b/keyboards/lets_split/keymaps/fabian/Makefile @@ -0,0 +1,9 @@ +# 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 +# +# UNICODE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 4a1f701d9f3569061d0613599fced54be32b5a54 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 12:46:04 +0200 Subject: [PATCH 10/15] included amj40 implementation of nhou7 from https://github.com/nhou7/qmk_firmware_amj40 --- keyboards/amj40/Makefile | 3 + keyboards/amj40/amj40.c | 30 +++ keyboards/amj40/amj40.h | 38 ++++ keyboards/amj40/config.h | 94 ++++++++++ keyboards/amj40/keymaps/default/Makefile | 27 +++ keyboards/amj40/keymaps/default/build.sh | 42 +++++ keyboards/amj40/keymaps/default/keymap.c | 173 ++++++++++++++++++ keyboards/amj40/keymaps/default/readme.md | 11 ++ .../amj40/keymaps/default/updatemerge.sh | 4 + keyboards/amj40/readme.md | 35 ++++ keyboards/amj40/rules.mk | 66 +++++++ 11 files changed, 523 insertions(+) create mode 100755 keyboards/amj40/Makefile create mode 100755 keyboards/amj40/amj40.c create mode 100755 keyboards/amj40/amj40.h create mode 100755 keyboards/amj40/config.h create mode 100755 keyboards/amj40/keymaps/default/Makefile create mode 100755 keyboards/amj40/keymaps/default/build.sh create mode 100755 keyboards/amj40/keymaps/default/keymap.c create mode 100755 keyboards/amj40/keymaps/default/readme.md create mode 100755 keyboards/amj40/keymaps/default/updatemerge.sh create mode 100755 keyboards/amj40/readme.md create mode 100755 keyboards/amj40/rules.mk diff --git a/keyboards/amj40/Makefile b/keyboards/amj40/Makefile new file mode 100755 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/amj40/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/amj40/amj40.c b/keyboards/amj40/amj40.c new file mode 100755 index 000000000..5a2376999 --- /dev/null +++ b/keyboards/amj40/amj40.c @@ -0,0 +1,30 @@ +#include "amj40.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(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB |= (1<<2); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6072 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Han Chen +#define PRODUCT AMJ40 +#define DESCRIPTION qmk port of AMJ40 v2 PCB + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { F4, F5, F6, F7} +#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +/* Underlight configuration + */ + +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 4 // 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. + */ + +/* 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/amj40/keymaps/default/Makefile b/keyboards/amj40/keymaps/default/Makefile new file mode 100755 index 000000000..034e697bc --- /dev/null +++ b/keyboards/amj40/keymaps/default/Makefile @@ -0,0 +1,27 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = 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 = 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 + +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/amj40/keymaps/default/build.sh b/keyboards/amj40/keymaps/default/build.sh new file mode 100755 index 000000000..6b4b4568f --- /dev/null +++ b/keyboards/amj40/keymaps/default/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# adjust for cpu +# -j 16 gave best result on a hyperthreaded quad core core i7 + +LIMIT=10 +THREADS="-j 16" +KMAP=iso_split_rshift + +echo "We need sudo later" +sudo ls 2>&1 /dev/null + +function wait_bootloader { + echo "Waiting for Bootloader..." + local STARTTIME=$(date +"%s") + local REMIND=0 + local EXEC=dfu-programmer + local TARGET=atmega32u4 + while true + do + sudo $EXEC $TARGET get > /dev/null 2>&1 + [ $? -eq 0 ] && break + ENDTIME=$(date +"%s") + DURATION=$(($ENDTIME-$STARTTIME)) + if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ] + then + echo "Did you forget to press the reset button?" + REMIND=1 + fi + sleep 1 + done +} +make clean +make KEYMAP=${KMAP} ${THREADS} +if [[ $? -eq 0 ]] +then + echo "please trigger flashing!" + wait_bootloader + sudo make KEYMAP=${KMAP} dfu ${THREADS} +else + echo "make failed" + exit 77 +fi diff --git a/keyboards/amj40/keymaps/default/keymap.c b/keyboards/amj40/keymaps/default/keymap.c new file mode 100755 index 000000000..13b48c2ad --- /dev/null +++ b/keyboards/amj40/keymaps/default/keymap.c @@ -0,0 +1,173 @@ + + +// 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. + +#include "amj40.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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + + + + + +// increase readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Default Layer + * ,-----------------------------------------------------------. + * | Esc| Q | W | E | R | T | Y | U | I | O | P | BS | + * |-----------------------------------------------------------| + * | Tab | A | S | D | F | G | H | J | K | L | Ent | + * |-----------------------------------------------------------| + * | LSft | Z | X | C | V | B | N | M | , | . | /? | + * |-----------------------------------------------------------| + * | LCtl | LGui| LAlt| spc fn0 | spc fn1 |fn2|RAlt|RCtl | + * `-----------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + 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_ENT,\ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,\ + KC_LCTL, KC_LGUI, KC_LALT, F(0), F(1), F(2), KC_RALT, KC_RCTL \ + ), + + /* Function Layer 1 HHKB style + * ,-----------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bkspc| + * |-----------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | [ | ] | Pipe | + * |-----------------------------------------------------------| + * | F7 | F8 | F9 | F10 | F11 | F12 | End|PgDn| ↓ | | | + * |-----------------------------------------------------------| + * | | | | | | Stop| App| | + * `-----------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + 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_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),BL_TOGG, BL_INC, BL_DEC, \ + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Function Layer 1 HHKB style + * ,-----------------------------------------------------------. + * |Caps| |MSel| ⏮ | ⏯ | ⏭ |PSCR|SkLk|Paus| ↑ | Ins| Del| + * |-----------------------------------------------------------| + * | | 🔇 | ⏏ | | * | / |Hone|PgUp| ← | → | | + * |-----------------------------------------------------------| + * | | 🔉 | 🔊 | | + | - | End|PgDn| ↓ | | | + * |-----------------------------------------------------------| + * | | | | | | Stop| App| | + * `-----------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + 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_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_DEL, \ + _______, KC_TRNS, _______, KC_TRNS, KC_TRNS, _______, _______, RGB_TOG \ + ), + + /* Function Layer 1 HHKB style + * ,-----------------------------------------------------------. + * |Caps| |MSel| ⏮ | ⏯ | ⏭ |PSCR|SkLk|Paus| ↑ | Ins| Del| + * |-----------------------------------------------------------| + * | | 🔇 | ⏏ | | * | / |Hone|PgUp| ← | → | | + * |-----------------------------------------------------------| + * | | 🔉 | 🔊 | | + | - | End|PgDn| ↓ | | | + * |-----------------------------------------------------------| + * | | | | | | Stop| App| | + * `-----------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, \ + _______, _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, \ + KC_SYSTEM_SLEEP, _______, _______, _______, _______, _______, _______, _______ \ + ), + + + +}; + + + + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [2] = ACTION_LAYER_TAP_KEY(_ADJUST, KC_LGUI), + +}; + + + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + + return MACRO_NONE; +}; + + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + 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/amj40/keymaps/default/readme.md b/keyboards/amj40/keymaps/default/readme.md new file mode 100755 index 000000000..2659292ae --- /dev/null +++ b/keyboards/amj40/keymaps/default/readme.md @@ -0,0 +1,11 @@ +AMJ40 Default Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +# Features +* Based on a combination of the original AMJ40 keymap from the TMK firmware as well as the Planck Ortholinear keyboard's "Lower," "Raise," and "Adjust" layers. +* View the keymap.c file to understand they layout of the keymap. +* Has keys to toggle both the switch LEDs and underglow LEDs. + diff --git a/keyboards/amj40/keymaps/default/updatemerge.sh b/keyboards/amj40/keymaps/default/updatemerge.sh new file mode 100755 index 000000000..da5457e19 --- /dev/null +++ b/keyboards/amj40/keymaps/default/updatemerge.sh @@ -0,0 +1,4 @@ +#!/bin/bash +git checkout amj60 # gets you on branch amj60 +git fetch origin # gets you up to date with origin +git merge origin/master diff --git a/keyboards/amj40/readme.md b/keyboards/amj40/readme.md new file mode 100755 index 000000000..e705f20fe --- /dev/null +++ b/keyboards/amj40/readme.md @@ -0,0 +1,35 @@ +AMJ40 keyboard firmware +====================== +DIY/Assembled compact 40% keyboard. + +Ported by N.Hou from the original TMK firmware. + +*Supports both backlight LEDs as well as RGB underglow. + +*For reference, the AMJ40 uses pin D3 for underglow lighting. + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/amj40 +folder. Once your dev env is setup, you'll be able to type `make` to generate +your .hex - you can then use `make dfu` to program your PCB once you hit the +reset button. + +Depending on which keymap you would like to use, you will have to compile +slightly differently. + +### Default +To build with the default keymap, simply run `sudo make all`. +The .hex file will appear in the root of the qmk firmware folder. + + + + +### Original tmk firmware +The original firmware that was used to port to qmk can be found [here](https://github.com/AMJKeyboard/AMJ40). + + diff --git a/keyboards/amj40/rules.mk b/keyboards/amj40/rules.mk new file mode 100755 index 000000000..18403ac32 --- /dev/null +++ b/keyboards/amj40/rules.mk @@ -0,0 +1,66 @@ + +# 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) + +# 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 ?= no # 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 # 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 keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID From 619081559ba464f2b03f8bbbcf4d109249979aba Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 12:47:40 +0200 Subject: [PATCH 11/15] added my amj40 custom layout --- keyboards/amj40/keymaps/fabian/Makefile | 27 ++++++ keyboards/amj40/keymaps/fabian/keymap.c | 116 ++++++++++++++++++++++++ keyboards/amj40/keymaps/fabian/t | 38 ++++++++ 3 files changed, 181 insertions(+) create mode 100755 keyboards/amj40/keymaps/fabian/Makefile create mode 100755 keyboards/amj40/keymaps/fabian/keymap.c create mode 100755 keyboards/amj40/keymaps/fabian/t diff --git a/keyboards/amj40/keymaps/fabian/Makefile b/keyboards/amj40/keymaps/fabian/Makefile new file mode 100755 index 000000000..034e697bc --- /dev/null +++ b/keyboards/amj40/keymaps/fabian/Makefile @@ -0,0 +1,27 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = 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 = 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 + +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/amj40/keymaps/fabian/keymap.c b/keyboards/amj40/keymaps/fabian/keymap.c new file mode 100755 index 000000000..aa62d0406 --- /dev/null +++ b/keyboards/amj40/keymaps/fabian/keymap.c @@ -0,0 +1,116 @@ +#include "amj40.h" + +#undef KEYMAP +#define KEYMAP( \ + 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, 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, XXX, XXX, XXX, k39, k3a, k3b} \ +} + +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define TCTLESC CTL_T(KC_ESC) +#define TSFTBSP SFT_T(KC_BSPC) +#define TSFTENT SFT_T(KC_ENT) + + +#define _BASE 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 3 + + +enum custom_keycodes { + BASE = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + TCTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + TSFTBSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TSFTENT, \ + F(2), KC_LCTL, KC_LALT, KC_LGUI, F(0), F(1), KC_RGUI, KC_RALT, KC_RCTL \ + ), + [_LOWER] = KEYMAP( \ + 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_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + [_RAISE] = KEYMAP( \ + 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, _______, \ + BL_STEP, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + [_ADJUST] = KEYMAP( \ + RESET , _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_COMM \ + ), +}; + + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [2] = ACTION_LAYER_TAP_KEY(_ADJUST, KC_LGUI), +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + 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/amj40/keymaps/fabian/t b/keyboards/amj40/keymaps/fabian/t new file mode 100755 index 000000000..7f6469a95 --- /dev/null +++ b/keyboards/amj40/keymaps/fabian/t @@ -0,0 +1,38 @@ +#ifndef AMJ40_H +#define AMJ40_H + +#include "quantum.h" + +// readability +#define XXX KC_NO + +/* AMJ40 ver2.0 layout1 配列一 + * ,-----------------------------------------------------------. + * | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | + * |-----------------------------------------------------------| + * | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1B | + * |-----------------------------------------------------------| + * | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | + * |-----------------------------------------------------------| + * | 30 | 31 | 32 | 34 | 35 | 39 | 3A | 3B | + * `-----------------------------------------------------------' + */ +#define KEYMAP( \ + 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, 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, XXX, XXX, XXX, k39, k3a, k3b} \ +} + + + + +void matrix_init_user(void); +void matrix_scan_user(void); + +#endif From 20b3ac49b73e1f1a4395dd4d2d24a2607975885c Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Wed, 26 Jul 2017 12:48:13 +0200 Subject: [PATCH 12/15] deleted file --- keyboards/amj40/keymaps/fabian/t | 38 -------------------------------- 1 file changed, 38 deletions(-) delete mode 100755 keyboards/amj40/keymaps/fabian/t diff --git a/keyboards/amj40/keymaps/fabian/t b/keyboards/amj40/keymaps/fabian/t deleted file mode 100755 index 7f6469a95..000000000 --- a/keyboards/amj40/keymaps/fabian/t +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef AMJ40_H -#define AMJ40_H - -#include "quantum.h" - -// readability -#define XXX KC_NO - -/* AMJ40 ver2.0 layout1 配列一 - * ,-----------------------------------------------------------. - * | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | - * |-----------------------------------------------------------| - * | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1B | - * |-----------------------------------------------------------| - * | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | - * |-----------------------------------------------------------| - * | 30 | 31 | 32 | 34 | 35 | 39 | 3A | 3B | - * `-----------------------------------------------------------' - */ -#define KEYMAP( \ - 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, 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, XXX, XXX, XXX, k39, k3a, k3b} \ -} - - - - -void matrix_init_user(void); -void matrix_scan_user(void); - -#endif From 661106bac466f99341edea9d2e38e2f8c75746d9 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Mon, 31 Jul 2017 21:16:55 +0200 Subject: [PATCH 13/15] layout updates and cleanups --- keyboards/amj40/keymaps/fabian/keymap.c | 204 +++++++++++++++++++----- 1 file changed, 162 insertions(+), 42 deletions(-) diff --git a/keyboards/amj40/keymaps/fabian/keymap.c b/keyboards/amj40/keymaps/fabian/keymap.c index aa62d0406..57b4d957b 100755 --- a/keyboards/amj40/keymaps/fabian/keymap.c +++ b/keyboards/amj40/keymaps/fabian/keymap.c @@ -1,5 +1,6 @@ #include "amj40.h" +// Set the custom keymap #undef KEYMAP #define KEYMAP( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ @@ -13,76 +14,195 @@ {k30, k31, k32, k33, k34, k35, XXX, XXX, XXX, k39, k3a, k3b} \ } +// Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO -#define TCTLESC CTL_T(KC_ESC) -#define TSFTBSP SFT_T(KC_BSPC) -#define TSFTENT SFT_T(KC_ENT) +// Custom +#define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +// #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) -#define _BASE 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 3 - +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 enum custom_keycodes { - BASE = SAFE_RANGE, + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, LOWER, RAISE, ADJUST, }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = KEYMAP( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - TCTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - TSFTBSP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TSFTENT, \ - F(2), KC_LCTL, KC_LALT, KC_LGUI, F(0), F(1), KC_RGUI, KC_RALT, KC_RCTL \ - ), - [_LOWER] = KEYMAP( \ - 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_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - [_RAISE] = KEYMAP( \ - 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, _______, \ - BL_STEP, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - [_ADJUST] = KEYMAP( \ - RESET , _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, \ - _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_COMM \ - ), -}; +/* 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | Lower and Space | Raise and Bksp | GUI |AltGr | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + 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 , \ + F(2), KC_LCTL, KC_LALT, KC_LGUI, F(0), F(1), KC_RGUI, KC_RALT, KC_RCTL \ +), + +/* 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | Lower and Space | Raise and Bksp | GUI |AltGr | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + 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 , \ + F(2), KC_LCTL, KC_LALT, KC_LGUI, F(0), F(1), KC_RGUI, KC_RALT, KC_RCTL \ +), + +/* 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | Lower and Space | Raise and Bksp | GUI |AltGr | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + 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 , \ + F(2), KC_LCTL, KC_LALT, KC_LGUI, F(0), F(1), KC_RGUI, KC_RALT, KC_RCTL \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | MS L | MS D |MS U | MS R |MS Btn| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + 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_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 | Left | Down | Up | Rght |MS_BN2| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + 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_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Reset | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, RESET, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) - -enum function_id { - LAUNCH, - RGBLED_TOGGLE, }; +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), - [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_BSPC), [2] = ACTION_LAYER_TAP_KEY(_ADJUST, KC_LGUI), }; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); From 015bf30d9b827692f387a09e1c24549e2a25c863 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Mon, 31 Jul 2017 22:01:35 +0200 Subject: [PATCH 14/15] changed adjust layer to emulate mouse on rignt hand --- keyboards/amj40/keymaps/fabian/Makefile | 2 +- keyboards/amj40/keymaps/fabian/keymap.c | 14 +- keyboards/deltasplit75/i2c.c | 324 ++++----- keyboards/deltasplit75/i2c.h | 62 +- .../deltasplit75/keymaps/default/config.h | 62 +- keyboards/deltasplit75/matrix.c | 636 +++++++++--------- keyboards/deltasplit75/serial.c | 456 ++++++------- keyboards/deltasplit75/serial.h | 52 +- keyboards/deltasplit75/split_util.c | 162 ++--- keyboards/deltasplit75/split_util.h | 44 +- 10 files changed, 907 insertions(+), 907 deletions(-) diff --git a/keyboards/amj40/keymaps/fabian/Makefile b/keyboards/amj40/keymaps/fabian/Makefile index 034e697bc..a914e4c0c 100755 --- a/keyboards/amj40/keymaps/fabian/Makefile +++ b/keyboards/amj40/keymaps/fabian/Makefile @@ -3,7 +3,7 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +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 diff --git a/keyboards/amj40/keymaps/fabian/keymap.c b/keyboards/amj40/keymaps/fabian/keymap.c index 57b4d957b..aef514153 100755 --- a/keyboards/amj40/keymaps/fabian/keymap.c +++ b/keyboards/amj40/keymaps/fabian/keymap.c @@ -134,19 +134,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. - * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Reset | Del | + * |Reset |Colemk|Qwerty|Dvorak| | | | | MU | | |Reset | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | |AGNorm|AGSwap| | | | | ML | MD | MR | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | |AudOn |AudOff| | | | |MBtn1 |MBtn2 |MBtn3 | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = KEYMAP( \ - _______, RESET, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, RESET, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ +[_ADJUST] = KEYMAP( \ + RESET, COLEMAK, QWERTY, DVORAK, _______, _______, _______, _______, KC_MS_U, _______, _______, RESET, \ + _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, AU_ON, AU_OFF, _______, _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) diff --git a/keyboards/deltasplit75/i2c.c b/keyboards/deltasplit75/i2c.c index af806c75b..084c890c4 100644 --- a/keyboards/deltasplit75/i2c.c +++ b/keyboards/deltasplit75/i2c.c @@ -1,162 +1,162 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< +#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); - -#endif +#ifndef I2C_H +#define I2C_H + +#include + +#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); + +#endif diff --git a/keyboards/deltasplit75/keymaps/default/config.h b/keyboards/deltasplit75/keymaps/default/config.h index c72c00e68..4fb2554e0 100644 --- a/keyboards/deltasplit75/keymaps/default/config.h +++ b/keyboards/deltasplit75/keymaps/default/config.h @@ -1,31 +1,31 @@ -/* -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 . -*/ - - -#define USE_SERIAL - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS - - -#ifdef SUBPROJECT_v2 - #include "../../v2/config.h" -#endif -#ifdef SUBPROJECT_protosplit - #include "../../protosplit/config.h" -#endif +/* +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 . +*/ + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + + +#ifdef SUBPROJECT_v2 + #include "../../v2/config.h" +#endif +#ifdef SUBPROJECT_protosplit + #include "../../protosplit/config.h" +#endif diff --git a/keyboards/deltasplit75/matrix.c b/keyboards/deltasplit75/matrix.c index c3bb0b058..138969004 100644 --- a/keyboards/deltasplit75/matrix.c +++ b/keyboards/deltasplit75/matrix.c @@ -1,318 +1,318 @@ -/* -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" -#include "config.h" - -#ifdef USE_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; - -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); - -__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) -{ - 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) -{ - // 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_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) -{ - int 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 : (MATRIX_ROWS / 2); - -#ifdef USE_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); -} +/* +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" +#include "config.h" + +#ifdef USE_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; + +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); + +__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) +{ + 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) +{ + // 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_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) +{ + int 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 : (MATRIX_ROWS / 2); + +#ifdef USE_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/deltasplit75/serial.c b/keyboards/deltasplit75/serial.c index 898ef7d42..6faed09ce 100644 --- a/keyboards/deltasplit75/serial.c +++ b/keyboards/deltasplit75/serial.c @@ -1,228 +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" - -#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 +/* + * 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/deltasplit75/serial.h b/keyboards/deltasplit75/serial.h index ab2ea0a09..6ef52019a 100644 --- a/keyboards/deltasplit75/serial.h +++ b/keyboards/deltasplit75/serial.h @@ -1,26 +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_COLS+7)/8 *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 +#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_COLS+7)/8 *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/deltasplit75/split_util.c b/keyboards/deltasplit75/split_util.c index a636f60db..226dc1881 100644 --- a/keyboards/deltasplit75/split_util.c +++ b/keyboards/deltasplit75/split_util.c @@ -1,81 +1,81 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.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(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { -#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 +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.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(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { +#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< - -#ifdef EE_HANDS - #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 - #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END -#endif - -#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); - -#endif +#ifndef SPLIT_KEYBOARD_UTIL_H +#define SPLIT_KEYBOARD_UTIL_H + +#include + +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif + +#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); + +#endif From 088dfb7db5b62831570c20f7e438ba0f0a612b74 Mon Sep 17 00:00:00 2001 From: Fabian Topfstedt Date: Thu, 3 Aug 2017 21:05:09 +0200 Subject: [PATCH 15/15] added a clone of my lets split grid layout on a re75 --- keyboards/xd75/keymaps/fabian/Makefile | 37 ++++ keyboards/xd75/keymaps/fabian/config.h | 24 +++ keyboards/xd75/keymaps/fabian/keymap.c | 237 +++++++++++++++++++++++++ 3 files changed, 298 insertions(+) create mode 100644 keyboards/xd75/keymaps/fabian/Makefile create mode 100644 keyboards/xd75/keymaps/fabian/config.h create mode 100644 keyboards/xd75/keymaps/fabian/keymap.c diff --git a/keyboards/xd75/keymaps/fabian/Makefile b/keyboards/xd75/keymaps/fabian/Makefile new file mode 100644 index 000000000..6e8941fdf --- /dev/null +++ b/keyboards/xd75/keymaps/fabian/Makefile @@ -0,0 +1,37 @@ +# 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 = 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 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/xd75/keymaps/fabian/config.h b/keyboards/xd75/keymaps/fabian/config.h new file mode 100644 index 000000000..f52a97bbc --- /dev/null +++ b/keyboards/xd75/keymaps/fabian/config.h @@ -0,0 +1,24 @@ +/* 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 + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/xd75/keymaps/fabian/keymap.c b/keyboards/xd75/keymaps/fabian/keymap.c new file mode 100644 index 000000000..f6cc95ba2 --- /dev/null +++ b/keyboards/xd75/keymaps/fabian/keymap.c @@ -0,0 +1,237 @@ +#include "xd75.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 _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom +#define CTL_ESC CTL_T(KC_ESC) // Tap for Escape, hold for Control +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_BSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +// #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) + +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 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | | | | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| + * `--------------------------------------------------------------------------------------------------------' + */ +[_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 }, + { ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, _______, _______, _______, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST }, +}, + +/* 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | | | | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| + * `--------------------------------------------------------------------------------------------------------' + */ +[_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 }, + { ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, _______, _______, _______, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST }, +}, + +/* 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 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space | | | | Bksp |Raise | GUI |AltGr | Ctrl |Adjust| + * `--------------------------------------------------------------------------------------------------------' + */ +[_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 }, + { ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, _______, _______, _______, SFT_BSP, RAISE, KC_RGUI, KC_RALT, KC_RCTL, ADJUST }, +}, + +/* Lower + * ,--------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | 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 }, +}, + +/* 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 | 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 }, +}, + +/* Adjust (Lower + Raise) + * ,--------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Reset | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk|Dvorak|Reset | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, RESET, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, DVORAK, RESET, KC_DEL }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, +}, +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +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_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistent_default_layer_set(1UL<<_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 ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +}