From 454684a8bbf41860dc9331bfc671ab80d53bf51f Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 30 Sep 2020 04:32:30 -0700 Subject: [PATCH] [Keyboard] Update to ZSA Boards (qmk#10119) --- keyboards/ergodox_ez/config.h | 12 +-- keyboards/ergodox_ez/ergodox_ez.c | 20 ++++ keyboards/ergodox_ez/ergodox_ez.h | 31 +++++- keyboards/ergodox_ez/glow/config.h | 24 +++++ keyboards/ergodox_ez/glow/glow.h | 20 ++++ .../{ => glow}/keymaps/glow/keymap.c | 0 .../ergodox_ez/glow/keymaps/glow/rules.mk | 6 ++ .../{ => glow}/keymaps/reactive/config.h | 0 .../{ => glow}/keymaps/reactive/keymap.c | 0 .../ergodox_ez/glow/keymaps/reactive/rules.mk | 7 ++ keyboards/ergodox_ez/glow/rules.mk | 1 + keyboards/ergodox_ez/keymaps/default/keymap.c | 4 +- keyboards/ergodox_ez/keymaps/glow/rules.mk | 6 -- keyboards/ergodox_ez/keymaps/oryx/keymap.c | 2 + .../ergodox_ez/keymaps/reactive/rules.mk | 7 -- keyboards/ergodox_ez/keymaps/webusb/keymap.c | 2 + keyboards/ergodox_ez/led_i2c.c | 42 ++++---- keyboards/ergodox_ez/matrix.c | 3 + keyboards/ergodox_ez/post_config.h | 20 ++++ keyboards/ergodox_ez/readme.md | 54 ++++++----- keyboards/ergodox_ez/rules.mk | 1 - keyboards/ergodox_ez/shine/config.h | 23 +++++ keyboards/ergodox_ez/shine/rules.mk | 1 + keyboards/ergodox_ez/shine/shine.h | 20 ++++ keyboards/moonlander/config.h | 2 - keyboards/moonlander/keymaps/default/keymap.c | 96 +++++++++---------- keyboards/moonlander/moonlander.c | 30 +++++- keyboards/moonlander/moonlander.h | 3 + keyboards/planck/ez/config.h | 6 +- keyboards/planck/ez/ez.c | 1 - keyboards/planck/ez/ez.h | 4 + keyboards/planck/ez/glow/config.h | 24 +++++ keyboards/planck/ez/glow/glow.h | 3 + .../{ => ez/glow}/keymaps/glow/config.h | 0 .../{ => ez/glow}/keymaps/glow/keymap.c | 0 .../{ => ez/glow}/keymaps/glow/readme.md | 0 .../{ => ez/glow}/keymaps/glow/rules.mk | 0 keyboards/planck/ez/glow/rules.mk | 1 + keyboards/planck/ez/readme.md | 47 +++++++++ keyboards/planck/ez/rules.mk | 2 - keyboards/planck/keymaps/oryx/keymap.c | 2 + 41 files changed, 397 insertions(+), 130 deletions(-) create mode 100644 keyboards/ergodox_ez/glow/config.h create mode 100644 keyboards/ergodox_ez/glow/glow.h rename keyboards/ergodox_ez/{ => glow}/keymaps/glow/keymap.c (100%) create mode 100644 keyboards/ergodox_ez/glow/keymaps/glow/rules.mk rename keyboards/ergodox_ez/{ => glow}/keymaps/reactive/config.h (100%) rename keyboards/ergodox_ez/{ => glow}/keymaps/reactive/keymap.c (100%) create mode 100644 keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk create mode 100644 keyboards/ergodox_ez/glow/rules.mk delete mode 100644 keyboards/ergodox_ez/keymaps/glow/rules.mk delete mode 100644 keyboards/ergodox_ez/keymaps/reactive/rules.mk create mode 100644 keyboards/ergodox_ez/shine/config.h create mode 100644 keyboards/ergodox_ez/shine/rules.mk create mode 100644 keyboards/ergodox_ez/shine/shine.h create mode 100644 keyboards/planck/ez/glow/config.h create mode 100644 keyboards/planck/ez/glow/glow.h rename keyboards/planck/{ => ez/glow}/keymaps/glow/config.h (100%) rename keyboards/planck/{ => ez/glow}/keymaps/glow/keymap.c (100%) rename keyboards/planck/{ => ez/glow}/keymaps/glow/readme.md (100%) rename keyboards/planck/{ => ez/glow}/keymaps/glow/rules.mk (100%) create mode 100644 keyboards/planck/ez/glow/rules.mk diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index fceb1197ffd0..64289666de12 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -1,6 +1,8 @@ /* Copyright 2012 Jun Wako Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) 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 @@ -21,8 +23,8 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1307 +#define VENDOR_ID 0x3297 +#define PRODUCT_ID 0x4974 #define DEVICE_VER 0x0001 #define MANUFACTURER ZSA Technology Labs Inc #define PRODUCT ErgoDox EZ @@ -152,8 +154,6 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION //#define DEBUG_MATRIX_SCAN_RATE - -#endif diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index ed0de24cc4bc..a2bbbfe09d0f 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -1,3 +1,23 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) + +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 "ergodox_ez.h" extern inline void ergodox_board_led_on(void); diff --git a/keyboards/ergodox_ez/ergodox_ez.h b/keyboards/ergodox_ez/ergodox_ez.h index 5754dc8ae1da..a10e0fee63f7 100644 --- a/keyboards/ergodox_ez/ergodox_ez.h +++ b/keyboards/ergodox_ez/ergodox_ez.h @@ -1,11 +1,36 @@ -#ifndef ERGODOX_EZ_H -#define ERGODOX_EZ_H +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once #include "quantum.h" #include #include #include "i2c_master.h" +#if defined(KEYBOARD_ergodox_ez_glow) +# include "glow.h" +#elif defined(KEYBOARD_ergodox_ez_shine) +# include "shine.h" +#endif + // I2C aliases and register addresses (see "mcp23018.md") #define I2C_ADDR 0b0100000 #define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) @@ -265,5 +290,3 @@ extern keyboard_config_t keyboard_config; { R05, R15, R25, R35, R45, R55 }, \ { R06, R16, R26, R36, R46, KC_NO } \ } - -#endif diff --git a/keyboards/ergodox_ez/glow/config.h b/keyboards/ergodox_ez/glow/config.h new file mode 100644 index 000000000000..e4cdb2625d3a --- /dev/null +++ b/keyboards/ergodox_ez/glow/config.h @@ -0,0 +1,24 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#undef PRODUCT_ID +#define PRODUCT_ID 0x4976 +#undef PRODUCT +#define PRODUCT ErgoDox EZ Glow diff --git a/keyboards/ergodox_ez/glow/glow.h b/keyboards/ergodox_ez/glow/glow.h new file mode 100644 index 000000000000..a504e4fdfb3b --- /dev/null +++ b/keyboards/ergodox_ez/glow/glow.h @@ -0,0 +1,20 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "ergodox_ez.h" diff --git a/keyboards/ergodox_ez/keymaps/glow/keymap.c b/keyboards/ergodox_ez/glow/keymaps/glow/keymap.c similarity index 100% rename from keyboards/ergodox_ez/keymaps/glow/keymap.c rename to keyboards/ergodox_ez/glow/keymaps/glow/keymap.c diff --git a/keyboards/ergodox_ez/glow/keymaps/glow/rules.mk b/keyboards/ergodox_ez/glow/keymaps/glow/rules.mk new file mode 100644 index 000000000000..894a6a5e1339 --- /dev/null +++ b/keyboards/ergodox_ez/glow/keymaps/glow/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = IS31FL3731 # enable later + +SRC += keymaps/default/keymap.c + +LTO_ENABLE = yes diff --git a/keyboards/ergodox_ez/keymaps/reactive/config.h b/keyboards/ergodox_ez/glow/keymaps/reactive/config.h similarity index 100% rename from keyboards/ergodox_ez/keymaps/reactive/config.h rename to keyboards/ergodox_ez/glow/keymaps/reactive/config.h diff --git a/keyboards/ergodox_ez/keymaps/reactive/keymap.c b/keyboards/ergodox_ez/glow/keymaps/reactive/keymap.c similarity index 100% rename from keyboards/ergodox_ez/keymaps/reactive/keymap.c rename to keyboards/ergodox_ez/glow/keymaps/reactive/keymap.c diff --git a/keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk b/keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk new file mode 100644 index 000000000000..21a5fb45ce84 --- /dev/null +++ b/keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk @@ -0,0 +1,7 @@ +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = IS31FL3731 # enable later + +SRC += keymaps/default/keymap.c + +LTO_ENABLE = yes +COMMAND_ENABLE = no diff --git a/keyboards/ergodox_ez/glow/rules.mk b/keyboards/ergodox_ez/glow/rules.mk new file mode 100644 index 000000000000..23e7548e35b2 --- /dev/null +++ b/keyboards/ergodox_ez/glow/rules.mk @@ -0,0 +1 @@ +RGB_MATRIX_ENABLE = IS31FL3731 diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 6f438d0d5048..9550d6465ce4 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -146,11 +146,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case VRSN: SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); return false; - #ifdef RGBLIGHT_ENABLE +#ifdef RGBLIGHT_ENABLE case RGB_SLD: rgblight_mode(1); return false; - #endif +#endif } } return true; diff --git a/keyboards/ergodox_ez/keymaps/glow/rules.mk b/keyboards/ergodox_ez/keymaps/glow/rules.mk deleted file mode 100644 index 3c1b98456221..000000000000 --- a/keyboards/ergodox_ez/keymaps/glow/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = no -RGB_MATRIX_ENABLE = yes # enable later - -SRC += ../default/keymap.c - -LINK_TIME_OPTIMIZATION_ENABLE = yes \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/oryx/keymap.c b/keyboards/ergodox_ez/keymaps/oryx/keymap.c index 81c8b1b9128e..f3190852cd05 100644 --- a/keyboards/ergodox_ez/keymaps/oryx/keymap.c +++ b/keyboards/ergodox_ez/keymaps/oryx/keymap.c @@ -68,6 +68,7 @@ bool suspended = false; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { +#ifdef RGBLIGHT_ENABLE case RGB_SLD: if (record->event.pressed) { rgblight_mode(1); @@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif } return false; +#endif } return true; } diff --git a/keyboards/ergodox_ez/keymaps/reactive/rules.mk b/keyboards/ergodox_ez/keymaps/reactive/rules.mk deleted file mode 100644 index b1be2c921bc7..000000000000 --- a/keyboards/ergodox_ez/keymaps/reactive/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -RGBLIGHT_ENABLE = no -RGB_MATRIX_ENABLE = yes # enable later - -SRC += ../default/keymap.c - -LINK_TIME_OPTIMIZATION_ENABLE = yes -COMMAND_ENABLE = no diff --git a/keyboards/ergodox_ez/keymaps/webusb/keymap.c b/keyboards/ergodox_ez/keymaps/webusb/keymap.c index 15eb76c15e20..d37cc49fc360 100644 --- a/keyboards/ergodox_ez/keymaps/webusb/keymap.c +++ b/keyboards/ergodox_ez/keymaps/webusb/keymap.c @@ -68,6 +68,7 @@ bool suspended = false; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { +#ifdef RGBLIGHT_ENABLE case RGB_SLD: if (record->event.pressed) { rgblight_mode(1); @@ -100,6 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif } return false; +#endif } return true; } diff --git a/keyboards/ergodox_ez/led_i2c.c b/keyboards/ergodox_ez/led_i2c.c index f5553a8b619c..fe40ab797e71 100644 --- a/keyboards/ergodox_ez/led_i2c.c +++ b/keyboards/ergodox_ez/led_i2c.c @@ -1,31 +1,27 @@ /* - * light weight WS2812 lib V2.0b - * - * Controls WS2811/WS2812/WS2812B RGB-LEDs - * Author: Tim (cpldcpu@gmail.com) - * - * Jan 18th, 2014 v2.0b Initial Version - * Nov 29th, 2015 v2.3 Added SK6812RGBW support - * - * 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 . - */ +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) + +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 . +*/ + #ifdef RGBLIGHT_ENABLE # include "ergodox_ez.h" -extern rgblight_config_t rgblight_config; - void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) { i2c_init(); i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT); diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index fd68a5dea7bd..d18800f19b5d 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -5,7 +5,10 @@ This is not a file you want to be messing with. All of the interesting stuff for you is under keymaps/ :) Love, Erez +Copyright 2012 Jun Wako Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) 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 diff --git a/keyboards/ergodox_ez/post_config.h b/keyboards/ergodox_ez/post_config.h index 526cc8c41784..0d4fe5c6832b 100644 --- a/keyboards/ergodox_ez/post_config.h +++ b/keyboards/ergodox_ez/post_config.h @@ -1,3 +1,23 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + #pragma once #if !defined(ERGODOX_LED_15) && !defined(ERGODOX_LED_30) diff --git a/keyboards/ergodox_ez/readme.md b/keyboards/ergodox_ez/readme.md index bce8ff3c6ffe..59a2840fd049 100644 --- a/keyboards/ergodox_ez/readme.md +++ b/keyboards/ergodox_ez/readme.md @@ -1,41 +1,49 @@ # ErgoDox EZ -The Ez uses the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). +![ErgoDox EZ](http://www.coolthings.com/wp-content/uploads/2017/05/ergodox-ez-2.jpg) -Linux users need to modify udev rules as described on the [Teensy -Linux page]. Some distributions provide a binary, maybe called -`teensy-loader-cli`. +The ErgoDox EZ is a mass produced version of the original ErgoDox keyboard, with optional support for RGB Light (Shine) or RGB Matrix (Glow). -[Teensy Linux page]: https://www.pjrc.com/teensy/loader_linux.html +* Keyboard Maintainer: [ZSA Technology Labs Inc](https://github.com/zsa), Firmware maintained by [drashna](https://github.com/drashna) +* Hardware Supported: Original ErgoDox, ErgoDox EZ +* Hardware Availability: [ErgoDox EZ](https://ergodox-ez.com/), [ErgoDox.io](https://ergodox.io) -To flash the firmware: +Make example for this keyboard (after setting up your build environment): - - Build the firmware with `make :`, for example `make ergodox_ez:default` + make ergodox_ez:default:flash + +For the ErgoDox EZ Shine, and Glow, use one of the following: - - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g. - `ergodox_ez_default.hex` + make ergodox_ez/shine:default:flash + make ergodox_ez/glow:default:flash - - Start the teensy loader. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). - - Load the .hex file into it. +## Oryx Configuation - - Press the Reset button by inserting a paperclip gently into the reset hole - in the top right corner. +If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, this enables a number of the built in options from the Oryx Configurator. - - Click the button in the Teensy app to download the firmware. +### Indicator LEDs -See also [video demonstration](https://www.youtube.com/watch?v=9PyiGUO9_KQ) using Teensy in auto mode. +You can use the `LED_LEVEL` keycode to cycle through the brightness levels for the LEDs on the top right of the keyboard. These settings are saved in eeprom (persistant memory). -To flash with ´teensy-loader-cli´: +Alternatively, you can set the brightness by calling the following functions: - - Build the firmware with `make keymapname`, for example `make default` +```c +void ergodox_led_all_set(uint8_t level); +void ergodox_right_led_1_set(uint8_t level); +void ergodox_right_led_2_set(uint8_t level); +void ergodox_right_led_3_set(uint8_t level); +``` - - Run ´teensy_loader_cli -mmcu=atmega32u4 -w ergodox_ez_.hex´ +These settings are not persistent, so you'd need to reset it every time the board starts. - - Press the Reset button by inserting a paperclip gently into the reset hole - in the top right corder. +These are on a 0-255 scale -## Settings +### RGB Matrix Features -You may want to enable QMK_KEYS_PER_SCAN because the Ergodox has a relatively -slow scan rate. +If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`. + +This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off. + +Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already. diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk index 9ad4eaa186e9..b6311aca3e66 100644 --- a/keyboards/ergodox_ez/rules.mk +++ b/keyboards/ergodox_ez/rules.mk @@ -30,7 +30,6 @@ UNICODE_ENABLE = yes # Unicode SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard SLEEP_LED_ENABLE = no API_SYSEX_ENABLE = no -RGBLIGHT_ENABLE = yes RGB_MATRIX_ENABLE = no # enable later DEBOUNCE_TYPE = eager_pr diff --git a/keyboards/ergodox_ez/shine/config.h b/keyboards/ergodox_ez/shine/config.h new file mode 100644 index 000000000000..c2bc6b5342ae --- /dev/null +++ b/keyboards/ergodox_ez/shine/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#undef PRODUCT_ID +#define PRODUCT_ID 0x4975 +#undef PRODUCT +#define PRODUCT ErgoDox EZ Shine diff --git a/keyboards/ergodox_ez/shine/rules.mk b/keyboards/ergodox_ez/shine/rules.mk new file mode 100644 index 000000000000..1e3cebb14515 --- /dev/null +++ b/keyboards/ergodox_ez/shine/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/ergodox_ez/shine/shine.h b/keyboards/ergodox_ez/shine/shine.h new file mode 100644 index 000000000000..a504e4fdfb3b --- /dev/null +++ b/keyboards/ergodox_ez/shine/shine.h @@ -0,0 +1,20 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk +Copyright 2015 ZSA Technology Labs Inc (@zsa) +Copyright 2020 Christopher Courtney (@drashna) +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "ergodox_ez.h" diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index 632ede2ee907..459630a0060d 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -78,10 +78,8 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -#ifndef LINK_TIME_OPTIMIZATION_ENABLE # define NO_ACTION_MACRO # define NO_ACTION_FUNCTION -#endif #define I2C1_CLOCK_SPEED 400000 diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c index 92fcd80a6d3c..6d98a8607e4c 100644 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ b/keyboards/moonlander/keymaps/default/keymap.c @@ -1,79 +1,73 @@ -/* -Copyright 2018 Jack Humbert +/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> + * Copyright 2020 Jack Humbert + * Copyright 2020 Christopher Courtney (@drashna) + * + * 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 . + */ -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 "version.h" enum layers { - BASE, // default layer - SYMB, // symbols - MDIA, // media keys + BASE, // default layer + SYMB, // symbols + MDIA, // media keys }; enum custom_keycodes { - EPRM = ML_SAFE_RANGE, - VRSN, + VRSN = ML_SAFE_RANGE, }; // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_moonlander( KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT), - KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LCTL_T(KC_SLSH), KC_LSFT, - LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), - KC_SPC, KC_BSPC, KC_LGUI, KC_RALT, KC_TAB, KC_ENT + KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), LGUI_T(KC_QUOT), + KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), KC_RSFT, + LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MO(SYMB), + KC_SPC, KC_BSPC, KC_LGUI, KC_LALT, KC_TAB, KC_ENT ), [SYMB] = LAYOUT_moonlander( - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - EPRM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_TOG, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, - RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,KC_TRNS, KC_TRNS + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, _______, _______, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______, + EEP_RST, _______, _______, _______, _______, RGB_VAI, RGB_TOG, _______, KC_DOT, KC_0, KC_EQL, _______, + RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,_______, _______ ), [MDIA] = LAYOUT_moonlander( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, + _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, + _______, _______, _______, _______, _______, _______ ), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case EPRM: - eeconfig_init(); - return false; - case VRSN: - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - return false; - #ifdef RGBLIGHT_ENABLE - case RGB_SLD: - rgblight_mode(1); - return false; - #endif + if (record->event.pressed) { + switch (keycode) { + case VRSN: + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + return false; + } } - } - return true; + return true; } diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c index ee7a31b1249b..52cccc972755 100644 --- a/keyboards/moonlander/moonlander.c +++ b/keyboards/moonlander/moonlander.c @@ -161,9 +161,10 @@ void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); } +#if !defined(MOONLANDER_USER_LEDS) layer_state_t layer_state_set_kb(layer_state_t state) { state = layer_state_set_user(state); - if (is_launching) return state; + if (is_launching || !keyboard_config.led_level) return state; ML_LED_1(false); ML_LED_2(false); @@ -201,6 +202,7 @@ layer_state_t layer_state_set_kb(layer_state_t state) { return state; } +#endif #ifdef RGB_MATRIX_ENABLE // clang-format off @@ -417,6 +419,24 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { layer_state_set_kb(layer_state); break; #endif +#if !defined(MOONLANDER_USER_LEDS) + case LED_LEVEL: + if (record->event.pressed) { + keyboard_config.led_level ^= 1; + eeconfig_update_kb(keyboard_config.raw); + if (keyboard_config.led_level) { + layer_state_set_kb(layer_state); + } else { + ML_LED_1(false); + ML_LED_2(false); + ML_LED_3(false); + ML_LED_4(false); + ML_LED_5(false); + ML_LED_6(false); + } + } + break; +#endif #ifdef RGB_MATRIX_ENABLE case TOGGLE_LAYER_COLOR: if (record->event.pressed) { @@ -452,6 +472,12 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { void matrix_init_kb(void) { keyboard_config.raw = eeconfig_read_kb(); + if (!keyboard_config.led_level && !keyboard_config.led_level_res) { + keyboard_config.led_level = true; + keyboard_config.led_level_res = 0b11; + eeconfig_update_kb(keyboard_config.raw); + } + #ifdef RGB_MATRIX_ENABLE if (keyboard_config.rgb_matrix_enable) { rgb_matrix_set_flags(LED_FLAG_ALL); @@ -464,6 +490,8 @@ void matrix_init_kb(void) { void eeconfig_init_kb(void) { // EEPROM is getting reset! keyboard_config.raw = 0; keyboard_config.rgb_matrix_enable = true; + keyboard_config.led_level = true; + keyboard_config.led_level_res = 0b11; eeconfig_update_kb(keyboard_config.raw); eeconfig_init_user(); } diff --git a/keyboards/moonlander/moonlander.h b/keyboards/moonlander/moonlander.h index 399a6a6ec367..1fd1db8ad59c 100644 --- a/keyboards/moonlander/moonlander.h +++ b/keyboards/moonlander/moonlander.h @@ -57,6 +57,7 @@ along with this program. If not, see . enum planck_ez_keycodes { TOGGLE_LAYER_COLOR = SAFE_RANGE, + LED_LEVEL, ML_SAFE_RANGE, }; @@ -65,6 +66,8 @@ typedef union { struct { bool disable_layer_led :1; bool rgb_matrix_enable :1; + bool led_level :1; + uint8_t led_level_res :2; // DO NOT REMOVE }; } keyboard_config_t; diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h index bfddeb37ff9b..1ead27754280 100644 --- a/keyboards/planck/ez/config.h +++ b/keyboards/planck/ez/config.h @@ -18,8 +18,12 @@ #pragma once /* USB Device descriptor parameter */ +#undef VENDOR_ID +#define VENDOR_ID 0x3297 +#undef PRODUCT_ID +#define PRODUCT_ID 0xC6CE #undef MANUFACTURER -#define MANUFACTURER ZSA +#define MANUFACTURER ZSA Technology Labs #undef PRODUCT #define PRODUCT Planck EZ #define DEVICE_VER 0x0000 diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 385562248151..34f13235fea8 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -19,7 +19,6 @@ keyboard_config_t keyboard_config; - #ifdef RGB_MATRIX_ENABLE void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h index 770d59acd42e..07182417fc97 100644 --- a/keyboards/planck/ez/ez.h +++ b/keyboards/planck/ez/ez.h @@ -17,6 +17,10 @@ #include "planck.h" +#ifdef KEYBOARD_planck_ez_glow +# include "glow.h" +#endif + #define LAYOUT_planck_1x2uC( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ diff --git a/keyboards/planck/ez/glow/config.h b/keyboards/planck/ez/glow/config.h new file mode 100644 index 000000000000..21a339da2893 --- /dev/null +++ b/keyboards/planck/ez/glow/config.h @@ -0,0 +1,24 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#undef PRODUCT_ID +#define PRODUCT_ID 0xC6CF + +#undef PRODUCT +#define PRODUCT Planck EZ Glow diff --git a/keyboards/planck/ez/glow/glow.h b/keyboards/planck/ez/glow/glow.h new file mode 100644 index 000000000000..d8a01f43592f --- /dev/null +++ b/keyboards/planck/ez/glow/glow.h @@ -0,0 +1,3 @@ +#pragma once + +#include "ez.h" diff --git a/keyboards/planck/keymaps/glow/config.h b/keyboards/planck/ez/glow/keymaps/glow/config.h similarity index 100% rename from keyboards/planck/keymaps/glow/config.h rename to keyboards/planck/ez/glow/keymaps/glow/config.h diff --git a/keyboards/planck/keymaps/glow/keymap.c b/keyboards/planck/ez/glow/keymaps/glow/keymap.c similarity index 100% rename from keyboards/planck/keymaps/glow/keymap.c rename to keyboards/planck/ez/glow/keymaps/glow/keymap.c diff --git a/keyboards/planck/keymaps/glow/readme.md b/keyboards/planck/ez/glow/keymaps/glow/readme.md similarity index 100% rename from keyboards/planck/keymaps/glow/readme.md rename to keyboards/planck/ez/glow/keymaps/glow/readme.md diff --git a/keyboards/planck/keymaps/glow/rules.mk b/keyboards/planck/ez/glow/keymaps/glow/rules.mk similarity index 100% rename from keyboards/planck/keymaps/glow/rules.mk rename to keyboards/planck/ez/glow/keymaps/glow/rules.mk diff --git a/keyboards/planck/ez/glow/rules.mk b/keyboards/planck/ez/glow/rules.mk new file mode 100644 index 000000000000..575a9c8fa411 --- /dev/null +++ b/keyboards/planck/ez/glow/rules.mk @@ -0,0 +1 @@ +RGB_MATRIX_ENABLE = IS31FL3737 diff --git a/keyboards/planck/ez/readme.md b/keyboards/planck/ez/readme.md index 9bd161abdfeb..247bf7448afa 100644 --- a/keyboards/planck/ez/readme.md +++ b/keyboards/planck/ez/readme.md @@ -13,3 +13,50 @@ Make example for this keyboard (after setting up your build environment): make planck/ez:default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +# Planck EZ Glow + +For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example: + + make planck/ez/glow:default + +## Planck EZ Configuration (from Oryx) + +### Indicator LEDs + +The two front "teeth" LED indicators are PWM controlled. If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, you can use the `LED_LEVEL` to cycle through preset vales (0, 25%, 50%, 75%, 100%), and will be saved to EEPROM (persistent storage) + +Alternatively, you can set the brightness by calling the following functions: + +```c +void planck_ez_right_led_level(uint8_t level); +void planck_ez_left_led_level(uint8_t level); +``` + +These settings are not persistent, so you'd need to reset it every time the board starts. + +These are on a 0-255 scale + +#### Layer indication + +By default, the indicator lights are used for layer indication, expecting the specific layers used in the default keymap. However, this may not work for you. And if that is the case, you can add `#define PLANCK_EZ_USER_LEDS` to your `config.h` file. + +This will remove the default behavior for changing the LEDs based on layer, and allow you to control them manually. + +Alternatively, you can use the following defines in your keymap's `config.h` to control which layers are used, as long as you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h` file, as well. + +```c +#define PLANCK_EZ_LED_LOWER 3 +#define PLANCK_EZ_LED_RAISE 4 +#define PLANCK_EZ_LED_ADJUST 6 +``` + +This will allow you to change the layers that are used, without having to add anything code to your `keymap.c` + +### RGB Matrix Features + +If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`. + +This changes the `RGB_TOG` keycode so that it will toggle the lights on and off, in a way that will allow the Smart LEDs to continue to work, even with the rest of the LEDs turned off. + +Additionally, a new keycode has been added to toggle the Smart LEDs. Use `TOGGLE_LAYER_COLOR`, if you aren't already. diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk index f09072672e3a..fb4089afeeab 100644 --- a/keyboards/planck/ez/rules.mk +++ b/keyboards/planck/ez/rules.mk @@ -13,11 +13,9 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover -CUSTOM_MATRIX = no # Custom matrix file AUDIO_ENABLE = yes RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = IS31FL3737 LAYOUTS += ortho_4x12 diff --git a/keyboards/planck/keymaps/oryx/keymap.c b/keyboards/planck/keymaps/oryx/keymap.c index 83b7b42767ae..55a9168dca45 100644 --- a/keyboards/planck/keymaps/oryx/keymap.c +++ b/keyboards/planck/keymaps/oryx/keymap.c @@ -53,11 +53,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { eeconfig_init(); } return false; +#ifdef RGBLIGHT_ENABLE case RGB_SLD: if (record->event.pressed) { rgblight_mode(1); } return false; +#endif } return true; }