]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Added mode reverse step function
authordungdung <dungdung@users.noreply.github.com>
Mon, 6 Feb 2017 22:09:29 +0000 (14:09 -0800)
committerdungdung <dungdung@users.noreply.github.com>
Mon, 6 Feb 2017 22:18:20 +0000 (14:18 -0800)
quantum/rgblight.c
quantum/rgblight.h

index f91f3caff5984e926f8049a5b9d1f5c47330186c..7e057b63e8eb5596393ad57f94431f606d2aefd5 100644 (file)
@@ -219,6 +219,14 @@ void rgblight_step(void) {
   }
   rgblight_mode(mode);
 }
+void rgblight_step_reverse(void) {
+  uint8_t mode = 0;
+  mode = rgblight_config.mode - 1;
+  if (mode < 1) {
+    mode = RGBLIGHT_MODES;
+  }
+  rgblight_mode(mode);
+}
 
 void rgblight_mode(uint8_t mode) {
   if (!rgblight_config.enable) {
index 12e8583057b4a98e65da27d9856189964a7e6cf5..a63b2460474341615eb4910a3d15012a7eb2a027 100644 (file)
@@ -73,6 +73,7 @@ void rgblight_decrease(void);
 void rgblight_toggle(void);
 void rgblight_enable(void);
 void rgblight_step(void);
+void rgblight_step_reverse(void);
 void rgblight_mode(uint8_t mode);
 void rgblight_set(void);
 void rgblight_update_dword(uint32_t dword);