From ac5326595c88503cc183e7b93af45b7d13e2a557 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 9 Mar 2018 13:32:50 -0500 Subject: [PATCH] Add Viterbi fido keymap (#2454) * Add fido Viterbi keymap * Cleanup rules files * Remove unused WIP code --- keyboards/viterbi/keymaps/default/rules.mk | 4 -- keyboards/viterbi/keymaps/dwallace/rules.mk | 4 -- keyboards/viterbi/keymaps/fido/config.h | 45 +++++++++++++ keyboards/viterbi/keymaps/fido/keymap.c | 74 +++++++++++++++++++++ keyboards/viterbi/keymaps/fido/rules.mk | 1 + keyboards/viterbi/keymaps/hexwire/rules.mk | 4 -- keyboards/viterbi/split_rgb.c | 41 ------------ keyboards/viterbi/split_rgb.h | 6 -- 8 files changed, 120 insertions(+), 59 deletions(-) create mode 100644 keyboards/viterbi/keymaps/fido/config.h create mode 100644 keyboards/viterbi/keymaps/fido/keymap.c create mode 100644 keyboards/viterbi/keymaps/fido/rules.mk delete mode 100644 keyboards/viterbi/split_rgb.c delete mode 100644 keyboards/viterbi/split_rgb.h diff --git a/keyboards/viterbi/keymaps/default/rules.mk b/keyboards/viterbi/keymaps/default/rules.mk index 1e5761278..1e3cebb14 100644 --- a/keyboards/viterbi/keymaps/default/rules.mk +++ b/keyboards/viterbi/keymaps/default/rules.mk @@ -1,5 +1 @@ RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/viterbi/keymaps/dwallace/rules.mk b/keyboards/viterbi/keymaps/dwallace/rules.mk index 1e5761278..1e3cebb14 100644 --- a/keyboards/viterbi/keymaps/dwallace/rules.mk +++ b/keyboards/viterbi/keymaps/dwallace/rules.mk @@ -1,5 +1 @@ RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/viterbi/keymaps/fido/config.h b/keyboards/viterbi/keymaps/fido/config.h new file mode 100644 index 000000000..5cb108365 --- /dev/null +++ b/keyboards/viterbi/keymaps/fido/config.h @@ -0,0 +1,45 @@ +/* +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +#ifndef MASTER_LEFT + #define MASTER_RIGHT +#endif +// #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/fido/keymap.c b/keyboards/viterbi/keymaps/fido/keymap.c new file mode 100644 index 000000000..cffc236e1 --- /dev/null +++ b/keyboards/viterbi/keymaps/fido/keymap.c @@ -0,0 +1,74 @@ +#include "viterbi.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _FN 1 + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_FN1 MO(_FN) +#define KC_WD_L LCTL(KC_LEFT) +#define KC_WD_R LCTL(KC_RGHT) +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD +#define KC_RST RESET +#define KC_CTLZ LCTL(KC_Z) +#define KC_CTLX LCTL(KC_X) +#define KC_CTLC LCTL(KC_C) +#define KC_CTLV LCTL(KC_V) +#define KC_ATAB LALT(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = KC_KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + 1 , 2 , 3 , 4 , 5 , 6 ,ESC , DEL , 7 , 8 , 9 , 0 ,MINS,EQL , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + RBRC, Q , W , E , R , T ,TAB , BSPC, Y , U , I , O , P ,LBRC, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + GRV , A , S , D , F , G ,LALT, CAPS, H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + BSLS, Z , X , C , V , B ,LSFT, RSFT, N , M ,COMM,DOT ,SLSH,ENT , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + INS ,PSCR,MENU,LGUI,LCTL,SPC ,FN1 , FN1 ,SPC ,RCTL,RALT, , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + + [_FN] = KC_KEYMAP( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , , , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,PGUP,WD_L, UP ,WD_R, ,ATAB, ,RMOD,RHUI,RSAI,RVAI, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,HOME,LEFT,DOWN,RGHT, , , , ,RHUD,RSAD,RVAD, , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + ,CTLZ,CTLX,CTLC,CTLV, , , ,MUTE,VOLD,VOLU, , , , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + , , , , , , , , , , , , , + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ) + +}; + +void led_set_user(uint8_t usb_led) { + #ifdef RGBLIGHT_ENABLE + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + rgblight_enable(); + } else { + rgblight_disable(); + } + #endif //RGBLIGHT_ENABLE +} diff --git a/keyboards/viterbi/keymaps/fido/rules.mk b/keyboards/viterbi/keymaps/fido/rules.mk new file mode 100644 index 000000000..1e3cebb14 --- /dev/null +++ b/keyboards/viterbi/keymaps/fido/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/viterbi/keymaps/hexwire/rules.mk b/keyboards/viterbi/keymaps/hexwire/rules.mk index 1e5761278..1e3cebb14 100644 --- a/keyboards/viterbi/keymaps/hexwire/rules.mk +++ b/keyboards/viterbi/keymaps/hexwire/rules.mk @@ -1,5 +1 @@ RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/viterbi/split_rgb.c b/keyboards/viterbi/split_rgb.c deleted file mode 100644 index 6d7cb44cf..000000000 --- a/keyboards/viterbi/split_rgb.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include "split_util.h" -#include "progmem.h" -#include "print.h" -#include "rgblight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - - -rgblight_config_t rgblight_config; - -void rgblight_slave_update(void) { - //rgblight_effect_christmas(); -} - - -void rgblight_set(void) { - if (rgblight_config.enable) { - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } else { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - #ifdef RGBW - ws2812_setleds_rgbw(led, RGBLED_NUM); - #else - ws2812_setleds(led, RGBLED_NUM); - #endif - } -} diff --git a/keyboards/viterbi/split_rgb.h b/keyboards/viterbi/split_rgb.h deleted file mode 100644 index 5f552890a..000000000 --- a/keyboards/viterbi/split_rgb.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SPLIT_RGB_H -#define SPLIT_RGB_H - -void rgblight_slave_update(void); - -#endif