diff options
author | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 16:59:35 +0200 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 16:59:35 +0200 |
commit | 998ddbb122c9d3e2a77bd4e88c881b225ca0d569 (patch) | |
tree | ca91ff7ad3c4866555d1e623fe9ea05276397e1c /keyboards/viterbi | |
parent | c0095710a7c7e9bd94aa9f4dd814dc28d718c731 (diff) | |
parent | 06487daaddf923d635e8a528d1eb644b875a73f6 (diff) | |
download | qmk_firmware-998ddbb122c9d3e2a77bd4e88c881b225ca0d569.tar.gz qmk_firmware-998ddbb122c9d3e2a77bd4e88c881b225ca0d569.tar.xz |
Merge branch 'master' of github.com:qmk/qmk_firmware into hf/shinydox
Diffstat (limited to 'keyboards/viterbi')
-rw-r--r-- | keyboards/viterbi/keymaps/drashna/keymap.c | 16 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/drashna/rules.mk | 7 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/mike808/config.h | 43 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/mike808/keymap.c | 158 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/mike808/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/viterbi/matrix.c | 1 | ||||
-rw-r--r-- | keyboards/viterbi/serial.c | 2 |
7 files changed, 210 insertions, 18 deletions
diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index 09e8bc599..11ffe6ebd 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -17,7 +17,6 @@ extern keymap_config_t keymap_config; #define DIABLO TG(_DIABLO) #define GAMEPAD TG(_GAMEPAD) #define MEDIA TT(_MEDIA) -#define COVECUBE TG(_COVECUBE) //enum more_custom_keycodes { @@ -28,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = LAYOUT_ortho_5x7( LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, - MEDIA, KC_CALC, COVECUBE,KC_P7, KC_P8, KC_P9, KC_PAST, + MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_COLN, KC_PENT @@ -58,13 +57,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, KC_PENT ), - [_COVECUBE] = LAYOUT_ortho_5x7( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, COVECUBE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ), [_MEDIA] = LAYOUT_ortho_5x7( KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, @@ -77,13 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -} bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk index 4b5596a53..a7b18e071 100644 --- a/keyboards/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/viterbi/keymaps/drashna/rules.mk @@ -8,7 +8,11 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes -CUSTOM_LAYOUT = no +NO_SECRETS = yes +MACROS_ENABLED = yes +INDICATOR_LIGHTS = no +RGBLIGHT_TWINKLE = yes + LAYOUTS = ortho_5x7 # SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC)) @@ -17,3 +21,4 @@ LAYOUTS = ortho_5x7 # SRC := $(filter-out i2c.c,$(SRC)) # SRC := $(filter-out split_util.c,$(SRC)) # SRC += quantum/matrix.c + diff --git a/keyboards/viterbi/keymaps/mike808/config.h b/keyboards/viterbi/keymaps/mike808/config.h new file mode 100644 index 000000000..bfca915f2 --- /dev/null +++ b/keyboards/viterbi/keymaps/mike808/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2018 Danny Nguyen <danny@keeb.io> + +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 <http://www.gnu.org/licenses/>. +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 2 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/viterbi/keymaps/mike808/keymap.c b/keyboards/viterbi/keymaps/mike808/keymap.c new file mode 100644 index 000000000..c7e48b135 --- /dev/null +++ b/keyboards/viterbi/keymaps/mike808/keymap.c @@ -0,0 +1,158 @@ +#include QMK_KEYBOARD_H + +#define _DVORAK 0 +#define _QWERTY 1 +#define _FN1 2 +#define _MOUSE 3 + +enum custom_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_DVOR DVORAK +#define KC_QWER QWERTY +#define KC_FN1 MO(_FN1) + +// Tap-Hold keys (QWERTY) +#define KC_S_C MT(MOD_LCTL, KC_S) +#define KC_D_A MT(MOD_LALT, KC_D) +#define KC_F_G MT(MOD_LGUI, KC_F) +#define KC_J_G MT(MOD_RGUI, KC_J) +#define KC_K_A MT(MOD_RALT, KC_K) +#define KC_L_C MT(MOD_RCTL, KC_L) + +// Tap-Hold keys (Dvorak) +#define KC_O_C MT(MOD_LCTL, KC_O) +#define KC_E_A MT(MOD_LALT, KC_E) +#define KC_U_G MT(MOD_LGUI, KC_U) +#define KC_H_G MT(MOD_RGUI, KC_H) +#define KC_T_A MT(MOD_RALT, KC_T) +#define KC_N_C MT(MOD_RCTL, KC_N) + +#define KC_G_A LGUI(KC_A) +#define KC_G_C LGUI(KC_C) +#define KC_G_V LGUI(KC_V) +#define KC_G_X LGUI(KC_X) +#define KC_G_Z LGUI(KC_Z) +#define KC_G_BL LGUI(KC_BSLS) +#define KC_G_TB LGUI(KC_TAB) +#define KC_G_SP LGUI(KC_SPC) + +#define KC_ENTM LT(_MOUSE, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + DVOR,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,PGUP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_A ,TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS,PGDN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_X ,CAPS, A ,S_C ,D_A ,F_G , G , H ,J_G ,K_A ,L_C ,SCLN,QUOT, UP , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_C ,LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSFT,DOWN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,EQL ,LEFT,RGHT + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_DVORAK] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + QWER,ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,EQL ,PGUP, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_A ,TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,PGDN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_X ,CAPS, A ,O_C ,E_A ,U_G , I , D ,H_G ,T_A ,N_C , S ,MINS, UP , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_C ,LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,RSFT,DOWN, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + G_V ,FN1 ,G_TB,G_SP,BSPC,SPC ,SPC , ENTM,ENTM,G_Z ,GRV ,BSLS,LEFT,RGHT + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN1] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,EXLM, AT ,LCBR,RCBR,PIPE, , P7 , P8 , P9 ,ASTR,F12 , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,HASH,DLR ,LPRN,RPRN,GRV , , P4 , P5 , P6 ,PLUS,MINS, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , ,PERC,CIRC,LBRC,RBRC,TILD, AMPR, P1 , P2 , P3 ,SLSH, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , ,PDOT, P0 ,EQL , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_MOUSE] = LAYOUT_kc( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,MS_U, , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , ,MS_L,MS_D,MS_R, , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , ,BTN1,BTN2, , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ) +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +#endif + +void update_rgblight(uint16_t layer) { + if (layer & (1UL << _DVORAK)) { + rgblight_sethsv_green(); + } else if (layer & (1UL << _QWERTY)) { + rgblight_sethsv_goldenrod(); + } +} + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); + #ifdef RGBLIGHT_ENABLE + update_rgblight(default_layer); + #endif // RGBLIGHT_ENABLE +} + +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 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; + } + return true; +} + + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + uint8_t default_layer = eeconfig_read_default_layer(); + update_rgblight(default_layer); + #endif +} diff --git a/keyboards/viterbi/keymaps/mike808/rules.mk b/keyboards/viterbi/keymaps/mike808/rules.mk new file mode 100644 index 000000000..1e3cebb14 --- /dev/null +++ b/keyboards/viterbi/keymaps/mike808/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/viterbi/matrix.c b/keyboards/viterbi/matrix.c index 5fbae1150..c56b49c5f 100644 --- a/keyboards/viterbi/matrix.c +++ b/keyboards/viterbi/matrix.c @@ -146,7 +146,6 @@ uint8_t _matrix_scan(void) if (matrix_changed) { debouncing = true; debouncing_time = timer_read(); - PORTD ^= (1 << 2); } # else diff --git a/keyboards/viterbi/serial.c b/keyboards/viterbi/serial.c index 6faed09ce..74bcbb6bf 100644 --- a/keyboards/viterbi/serial.c +++ b/keyboards/viterbi/serial.c @@ -12,7 +12,7 @@ #include <stdbool.h> #include "serial.h" -#ifdef USE_SERIAL +#ifndef USE_I2C // Serial pulse period in microseconds. Its probably a bad idea to lower this // value. |