diff options
| author | krusli <rusli.kenneth@gmail.com> | 2017-09-16 12:02:06 +1000 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-09-16 09:34:29 -0400 |
| commit | 0b7df9f2ef27b2bc26203e1d3ea027b80172b763 (patch) | |
| tree | c83f9abeaecc87fabf8bc12169c5398109fbb68c | |
| parent | d281cd5c40fc2ecf4d3b3d568cc4b793eaf31907 (diff) | |
| download | qmk_firmware-0b7df9f2ef27b2bc26203e1d3ea027b80172b763.tar.gz qmk_firmware-0b7df9f2ef27b2bc26203e1d3ea027b80172b763.zip | |
Update on/off toggle behaviour for RGB LEDs
| -rw-r--r-- | keyboards/mechmini/keymaps/default/keymap.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/keyboards/mechmini/keymaps/default/keymap.c b/keyboards/mechmini/keymaps/default/keymap.c index b3d2345e9..d9753d011 100644 --- a/keyboards/mechmini/keymaps/default/keymap.c +++ b/keyboards/mechmini/keymaps/default/keymap.c | |||
| @@ -65,7 +65,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 65 | */ | 65 | */ |
| 66 | 66 | ||
| 67 | uint8_t current_level = 2; | 67 | uint8_t current_level = 2; |
| 68 | uint8_t prev_current_level = 2; | ||
| 69 | int is_on = 0; | 68 | int is_on = 0; |
| 70 | 69 | ||
| 71 | enum macro_id { | 70 | enum macro_id { |
| @@ -89,13 +88,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { | |||
| 89 | case RGB_LEVEL_DOWN: | 88 | case RGB_LEVEL_DOWN: |
| 90 | if (event.pressed && current_level > 0) { | 89 | if (event.pressed && current_level > 0) { |
| 91 | current_level--; | 90 | current_level--; |
| 92 | prev_current_level--; | ||
| 93 | } | 91 | } |
| 94 | break; | 92 | break; |
| 95 | case RGB_LEVEL_UP: | 93 | case RGB_LEVEL_UP: |
| 96 | if (event.pressed && current_level < MAX_BRIGHTNESS_IOS) { | 94 | if (event.pressed && current_level < MAX_BRIGHTNESS_IOS) { |
| 97 | current_level++; | 95 | current_level++; |
| 98 | prev_current_level++; | ||
| 99 | } | 96 | } |
| 100 | break; | 97 | break; |
| 101 | } | 98 | } |
| @@ -121,8 +118,8 @@ void user_setrgb(uint8_t r, uint8_t g, uint8_t b) { | |||
| 121 | } | 118 | } |
| 122 | 119 | ||
| 123 | void matrix_scan_user(void) { | 120 | void matrix_scan_user(void) { |
| 124 | if (is_on) { | 121 | if (!is_on) { |
| 125 | current_level = prev_current_level; | 122 | current_level = 2; |
| 126 | user_setrgb(0xFF, 0xFF, 0xFF); | 123 | user_setrgb(0xFF, 0xFF, 0xFF); |
| 127 | } else { | 124 | } else { |
| 128 | current_level = 0; | 125 | current_level = 0; |
