From fc86aedb106876c3004ad70b7daf167190745a83 Mon Sep 17 00:00:00 2001 From: Sebastian Spindler Date: Mon, 11 Feb 2019 21:41:37 +0100 Subject: [PATCH 1/3] Fix compile error if not used with VIA --- keyboards/plain60/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/plain60/config.h b/keyboards/plain60/config.h index 763aeff08239..5dd784887cfc 100644 --- a/keyboards/plain60/config.h +++ b/keyboards/plain60/config.h @@ -17,7 +17,7 @@ along with this program. If not, see . #pragma once -#include QMK_KEYBOARD_CONFIG_H +#include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0x4705 From 13e994168a0b8715464cd66e8ac875b7c92fe077 Mon Sep 17 00:00:00 2001 From: Sebastian Spindler Date: Mon, 11 Feb 2019 21:51:38 +0100 Subject: [PATCH 2/3] Add keymap with support for RGB --- keyboards/plain60/keymaps/RGB/config.h | 26 +++++++++ keyboards/plain60/keymaps/RGB/keymap.c | 77 ++++++++++++++++++++++++++ keyboards/plain60/keymaps/RGB/rules.mk | 24 ++++++++ 3 files changed, 127 insertions(+) create mode 100644 keyboards/plain60/keymaps/RGB/config.h create mode 100644 keyboards/plain60/keymaps/RGB/keymap.c create mode 100644 keyboards/plain60/keymaps/RGB/rules.mk diff --git a/keyboards/plain60/keymaps/RGB/config.h b/keyboards/plain60/keymaps/RGB/config.h new file mode 100644 index 000000000000..6c5fa13b7ae5 --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/config.h @@ -0,0 +1,26 @@ +/* +Copyright 2019 Sebastian Spindler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "../../config.h" + +/* RGB Underglow */ +#define RGB_DI_PIN B7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 30 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/plain60/keymaps/RGB/keymap.c b/keyboards/plain60/keymaps/RGB/keymap.c new file mode 100644 index 000000000000..8f4652044084 --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/keymap.c @@ -0,0 +1,77 @@ +/* +Copyright 2019 Sebastian Spindler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H +#include "config.h" +#include "keymap_extras/keymap_german.h" + +//Layer renaming +#define _DL 0 //default +#define _FUN 1 //function layer +#define _LED 2 //LED configurations + +//Keymapping renaming +#define ______ KC_TRNS //renaming KC_TRNS for readability in keymaps +#define RGB_MI RGB_MODE_FORWARD //increase RGB mode +#define RGB_MD RGB_MODE_REVERSE //decrease RGB mode +#define RGB_ST RGB_M_P //rgb static +#define MONKEY LCTL(LALT(KC_DEL)) //ctrl+alt+del == monkey grip +#define SPECIAL LT(_FUN, DE_CIRC) // + +//Macro renaming +#define KVM_SW M(0) //switch desktop macro for KVM + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_DL] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_SS, DE_ACUT, ______, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, ______, \ + SPECIAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, \ + KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, MONKEY, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , ______, KC_ALGR, KVM_SW, KC_RCTL ), + + [_FUN] = LAYOUT( + ______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ______, KC_DEL, \ + ______, KC_PGUP, KC_UP, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_HOME, ______, ______, KC_END, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, TG(_LED), \ + ______, ______, ______, ______ , ______, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_LED] = LAYOUT( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ + ______, RGB_TOG, RGB_MI, RGB_MD, RGB_ST, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, TG(_LED), \ + ______, ______, ______, ______ , ______, ______, ______, ______ ), +}; + +// Macros +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + // MACRODOWN only works in this function + switch(id) { + case 0: + return (record->event.pressed ? + MACRO( T(SLCK), W(100), T(SLCK), W(150), T(ENT), END ) + :MACRO( END )); + break; + default: + break; + } + + return MACRO_NONE; +}; diff --git a/keyboards/plain60/keymaps/RGB/rules.mk b/keyboards/plain60/keymaps/RGB/rules.mk new file mode 100644 index 000000000000..e9e533ca6541 --- /dev/null +++ b/keyboards/plain60/keymaps/RGB/rules.mk @@ -0,0 +1,24 @@ +#Copyright 2019 Sebastian Spindler + +#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 . + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +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) +MIDI_ENABLE = no # MIDI controls +RAW_ENABLE = no +DYNAMIC_KEYMAP_ENABLE = no \ No newline at end of file From db3a0d75299243b13c35479bbca9c58c524079cd Mon Sep 17 00:00:00 2001 From: Sebastian Spindler Date: Tue, 12 Feb 2019 09:58:29 +0100 Subject: [PATCH 3/3] Integrate changes from PR code review --- keyboards/plain60/keymaps/RGB/config.h | 2 +- keyboards/plain60/keymaps/RGB/keymap.c | 36 ++++++-------------------- keyboards/plain60/keymaps/RGB/rules.mk | 3 +-- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/keyboards/plain60/keymaps/RGB/config.h b/keyboards/plain60/keymaps/RGB/config.h index 6c5fa13b7ae5..5fadcf821a4f 100644 --- a/keyboards/plain60/keymaps/RGB/config.h +++ b/keyboards/plain60/keymaps/RGB/config.h @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "../../config.h" +#pragma once /* RGB Underglow */ #define RGB_DI_PIN B7 diff --git a/keyboards/plain60/keymaps/RGB/keymap.c b/keyboards/plain60/keymaps/RGB/keymap.c index 8f4652044084..25370823dfa7 100644 --- a/keyboards/plain60/keymaps/RGB/keymap.c +++ b/keyboards/plain60/keymaps/RGB/keymap.c @@ -16,7 +16,7 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "config.h" + #include "keymap_extras/keymap_german.h" //Layer renaming @@ -32,9 +32,6 @@ along with this program. If not, see . #define MONKEY LCTL(LALT(KC_DEL)) //ctrl+alt+del == monkey grip #define SPECIAL LT(_FUN, DE_CIRC) // -//Macro renaming -#define KVM_SW M(0) //switch desktop macro for KVM - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DL] = LAYOUT( @@ -42,36 +39,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, ______, \ SPECIAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, \ KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, MONKEY, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , ______, KC_ALGR, KVM_SW, KC_RCTL ), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , ______, KC_ALGR, TG(_LED), KC_RCTL ), [_FUN] = LAYOUT( ______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ______, KC_DEL, \ ______, KC_PGUP, KC_UP, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_HOME, ______, ______, KC_END, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, TG(_LED), \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, ______, \ ______, ______, ______, ______ , ______, KC_LEFT, KC_DOWN, KC_RIGHT ), [_LED] = LAYOUT( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ - ______, RGB_TOG, RGB_MI, RGB_MD, RGB_ST, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, TG(_LED), \ - ______, ______, ______, ______ , ______, ______, ______, ______ ), -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) { - case 0: - return (record->event.pressed ? - MACRO( T(SLCK), W(100), T(SLCK), W(150), T(ENT), END ) - :MACRO( END )); - break; - default: - break; - } - - return MACRO_NONE; + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ + ______, RGB_TOG, RGB_MI, RGB_MD, RGB_ST, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______ , ______, ______, TG(_LED), ______ ), }; diff --git a/keyboards/plain60/keymaps/RGB/rules.mk b/keyboards/plain60/keymaps/RGB/rules.mk index e9e533ca6541..793bd869ae97 100644 --- a/keyboards/plain60/keymaps/RGB/rules.mk +++ b/keyboards/plain60/keymaps/RGB/rules.mk @@ -19,6 +19,5 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 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) -MIDI_ENABLE = no # MIDI controls RAW_ENABLE = no -DYNAMIC_KEYMAP_ENABLE = no \ No newline at end of file +DYNAMIC_KEYMAP_ENABLE = no