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 /keyboards/mechmini/keymaps/default | |
parent | d281cd5c40fc2ecf4d3b3d568cc4b793eaf31907 (diff) | |
download | firmware-0b7df9f2ef27b2bc26203e1d3ea027b80172b763.tar.gz firmware-0b7df9f2ef27b2bc26203e1d3ea027b80172b763.tar.bz2 firmware-0b7df9f2ef27b2bc26203e1d3ea027b80172b763.zip |
Update on/off toggle behaviour for RGB LEDs
Diffstat (limited to 'keyboards/mechmini/keymaps/default')
-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] = { */ uint8_t current_level = 2; -uint8_t prev_current_level = 2; int is_on = 0; enum macro_id { @@ -89,13 +88,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case RGB_LEVEL_DOWN: if (event.pressed && current_level > 0) { current_level--; - prev_current_level--; } break; case RGB_LEVEL_UP: if (event.pressed && current_level < MAX_BRIGHTNESS_IOS) { current_level++; - prev_current_level++; } break; } @@ -121,8 +118,8 @@ void user_setrgb(uint8_t r, uint8_t g, uint8_t b) { } void matrix_scan_user(void) { - if (is_on) { - current_level = prev_current_level; + if (!is_on) { + current_level = 2; user_setrgb(0xFF, 0xFF, 0xFF); } else { current_level = 0; |