diff options
| -rw-r--r-- | keyboards/ergodox_ez/config.h | 9 | ||||
| -rw-r--r-- | keyboards/ergodox_ez/keymaps/default/config.h | 30 | ||||
| -rw-r--r-- | keyboards/ergodox_ez/keymaps/default/keymap.c | 94 |
3 files changed, 67 insertions, 66 deletions
diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index b258a5b2e..4ffc1b434 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h | |||
| @@ -87,6 +87,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 87 | 87 | ||
| 88 | #define USB_MAX_POWER_CONSUMPTION 500 | 88 | #define USB_MAX_POWER_CONSUMPTION 500 |
| 89 | 89 | ||
| 90 | // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF | ||
| 91 | #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF | ||
| 92 | #define RGBLIGHT_COLOR_LAYER_2 0xFF, 0x00, 0x00 | ||
| 93 | #define RGBLIGHT_COLOR_LAYER_3 0x00, 0xFF, 0x00 | ||
| 94 | #define RGBLIGHT_COLOR_LAYER_4 0xFF, 0xFF, 0x00 | ||
| 95 | #define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF | ||
| 96 | #define RGBLIGHT_COLOR_LAYER_6 0xFF, 0x00, 0xFF | ||
| 97 | #define RGBLIGHT_COLOR_LAYER_7 0xFF, 0xFF, 0xFF | ||
| 98 | |||
| 90 | /* | 99 | /* |
| 91 | * Feature disable options | 100 | * Feature disable options |
| 92 | * These options are also useful to firmware size reduction. | 101 | * These options are also useful to firmware size reduction. |
diff --git a/keyboards/ergodox_ez/keymaps/default/config.h b/keyboards/ergodox_ez/keymaps/default/config.h deleted file mode 100644 index e2e2c6bdc..000000000 --- a/keyboards/ergodox_ez/keymaps/default/config.h +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 Jack Humbert <jack.humbgmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef ERGODOX_EZ_USER_CONFIG_H | ||
| 19 | #define ERGODOX_EZ_USRE_CONFIG_H | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF | ||
| 24 | #define RGBLIGHT_COLOR_LAYER_1 0xFF, 0x00, 0x00 | ||
| 25 | #define RGBLIGHT_COLOR_LAYER_2 0x00, 0xFF, 0x00 | ||
| 26 | #define RGBLIGHT_COLOR_LAYER_3 0xFF, 0xFF, 0x00 | ||
| 27 | #define RGBLIGHT_COLOR_LAYER_4 0x00, 0xFF, 0xFF | ||
| 28 | #define RGBLIGHT_COLOR_LAYER_5 0xFF, 0x00, 0xFF | ||
| 29 | |||
| 30 | #endif \ No newline at end of file | ||
diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index e0f6e21b2..d2976812f 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c | |||
| @@ -211,41 +211,63 @@ uint32_t layer_state_set_user(uint32_t state) { | |||
| 211 | 211 | ||
| 212 | uint8_t layer = biton32(state); | 212 | uint8_t layer = biton32(state); |
| 213 | switch (layer) { | 213 | switch (layer) { |
| 214 | case 0: | 214 | case 0: |
| 215 | #ifdef RGBLIGHT_COLOR_LAYER_0 | 215 | #ifdef RGBLIGHT_COLOR_LAYER_0 |
| 216 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); | 216 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); |
| 217 | #else | 217 | #else |
| 218 | rgblight_init(); | 218 | rgblight_init(); |
| 219 | #endif | 219 | #endif |
| 220 | break; | 220 | break; |
| 221 | case 1: | 221 | case 1: |
| 222 | ergodox_right_led_1_on(); | 222 | ergodox_right_led_1_on(); |
| 223 | #ifdef RGBLIGHT_COLOR_LAYER_1 | 223 | #ifdef RGBLIGHT_COLOR_LAYER_1 |
| 224 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); | 224 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); |
| 225 | #endif | 225 | #endif |
| 226 | break; | 226 | break; |
| 227 | case 2: | 227 | case 2: |
| 228 | ergodox_right_led_2_on(); | 228 | ergodox_right_led_2_on(); |
| 229 | #ifdef RGBLIGHT_COLOR_LAYER_2 | 229 | #ifdef RGBLIGHT_COLOR_LAYER_2 |
| 230 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); | 230 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); |
| 231 | #endif | 231 | #endif |
| 232 | break; | 232 | break; |
| 233 | case 3: | 233 | case 3: |
| 234 | #ifdef RGBLIGHT_COLOR_LAYER_3 | 234 | ergodox_right_led_3_on(); |
| 235 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); | 235 | #ifdef RGBLIGHT_COLOR_LAYER_3 |
| 236 | #endif | 236 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); |
| 237 | break; | 237 | #endif |
| 238 | case 4: | 238 | break; |
| 239 | #ifdef RGBLIGHT_COLOR_LAYER_4 | 239 | case 4: |
| 240 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); | 240 | ergodox_right_led_1_on(); |
| 241 | #endif | 241 | ergodox_right_led_2_on(); |
| 242 | break; | 242 | #ifdef RGBLIGHT_COLOR_LAYER_4 |
| 243 | case 5: | 243 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); |
| 244 | #ifdef RGBLIGHT_COLOR_LAYER_5 | 244 | #endif |
| 245 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); | 245 | break; |
| 246 | #endif | 246 | case 5: |
| 247 | break; | 247 | ergodox_right_led_1_on(); |
| 248 | } | 248 | ergodox_right_led_3_on(); |
| 249 | #ifdef RGBLIGHT_COLOR_LAYER_5 | ||
| 250 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); | ||
| 251 | #endif | ||
| 252 | break; | ||
| 253 | case 6: | ||
| 254 | ergodox_right_led_2_on(); | ||
| 255 | ergodox_right_led_3_on(); | ||
| 256 | #ifdef RGBLIGHT_COLOR_LAYER_6 | ||
| 257 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); | ||
| 258 | #endif | ||
| 259 | break; | ||
| 260 | case 7: | ||
| 261 | ergodox_right_led_1_on(); | ||
| 262 | ergodox_right_led_2_on(); | ||
| 263 | ergodox_right_led_3_on(); | ||
| 264 | #ifdef RGBLIGHT_COLOR_LAYER_7 | ||
| 265 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); | ||
| 266 | #endif | ||
| 267 | break; | ||
| 268 | default: | ||
| 269 | break; | ||
| 270 | } | ||
| 249 | 271 | ||
| 250 | return state; | 272 | return state; |
| 251 | }; \ No newline at end of file | 273 | }; |
