diff options
| author | XScorpion2 <rcalt2vt@gmail.com> | 2019-07-25 13:56:29 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-07-25 11:56:29 -0700 |
| commit | 20c0533c4c66b9d222b6ced2fad3ec6be6cad76e (patch) | |
| tree | 2cceb641e573cafeb6ee68f5083fb532ab80cd93 /users/xulkal/custom_rgb.c | |
| parent | a747953dfae85d3bdfdfe205fc3d4ae6f8d1fe05 (diff) | |
| download | qmk_firmware-20c0533c4c66b9d222b6ced2fad3ec6be6cad76e.tar.gz qmk_firmware-20c0533c4c66b9d222b6ced2fad3ec6be6cad76e.zip | |
[User] Xulkal Keymaps Update (#6392)
* Xulkal changes
Refactor rgb & encoder menu
Hadron Keymap
Refactor oled menu
* Fixing horizontal OLED data display
* Reverting changes to take to separate prs
Diffstat (limited to 'users/xulkal/custom_rgb.c')
| -rw-r--r-- | users/xulkal/custom_rgb.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/users/xulkal/custom_rgb.c b/users/xulkal/custom_rgb.c new file mode 100644 index 000000000..11bfad1d7 --- /dev/null +++ b/users/xulkal/custom_rgb.c | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #include "custom_rgb.h" | ||
| 2 | |||
| 3 | #ifdef RGB_MATRIX_ENABLE | ||
| 4 | void rgb_matrix_increase_flags(void) | ||
| 5 | { | ||
| 6 | switch (rgb_matrix_get_flags()) { | ||
| 7 | case LED_FLAG_ALL: { | ||
| 8 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); | ||
| 9 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 10 | } | ||
| 11 | break; | ||
| 12 | case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { | ||
| 13 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 14 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 15 | } | ||
| 16 | break; | ||
| 17 | case LED_FLAG_UNDERGLOW: { | ||
| 18 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 19 | rgb_matrix_disable_noeeprom(); | ||
| 20 | } | ||
| 21 | break; | ||
| 22 | default: { | ||
| 23 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 24 | rgb_matrix_enable_noeeprom(); | ||
| 25 | } | ||
| 26 | break; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | void rgb_matrix_decrease_flags(void) | ||
| 31 | { | ||
| 32 | switch (rgb_matrix_get_flags()) { | ||
| 33 | case LED_FLAG_ALL: { | ||
| 34 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 35 | rgb_matrix_disable_noeeprom(); | ||
| 36 | } | ||
| 37 | break; | ||
| 38 | case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { | ||
| 39 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 40 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 41 | } | ||
| 42 | break; | ||
| 43 | case LED_FLAG_UNDERGLOW: { | ||
| 44 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); | ||
| 45 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 46 | } | ||
| 47 | break; | ||
| 48 | default: { | ||
| 49 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 50 | rgb_matrix_enable_noeeprom(); | ||
| 51 | } | ||
| 52 | break; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | #endif | ||
| 56 | |||
| 57 | void rgb_reset(void) { | ||
| 58 | #if defined(RGB_MATRIX_ENABLE) | ||
| 59 | eeconfig_update_rgb_matrix_default(); | ||
| 60 | #elif defined(RGBLIGHT_ENABLE) | ||
| 61 | eeconfig_update_rgblight_default(); | ||
| 62 | rgblight_enable(); | ||
| 63 | #endif | ||
| 64 | } | ||
