diff options
| author | dungdung <dungdung@users.noreply.github.com> | 2017-02-06 14:09:29 -0800 |
|---|---|---|
| committer | dungdung <dungdung@users.noreply.github.com> | 2017-02-06 14:18:20 -0800 |
| commit | 5a1b68d562036ff26820069baafe40654eef70a3 (patch) | |
| tree | 921542ce74bb149e07387b14c4b46d3a1b878c1f | |
| parent | 0e548f8b5d6b89de877f098ea919eaea87511b6e (diff) | |
| download | qmk_firmware-5a1b68d562036ff26820069baafe40654eef70a3.tar.gz qmk_firmware-5a1b68d562036ff26820069baafe40654eef70a3.zip | |
Added mode reverse step function
| -rw-r--r-- | quantum/rgblight.c | 8 | ||||
| -rw-r--r-- | quantum/rgblight.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index f91f3caff..7e057b63e 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -219,6 +219,14 @@ void rgblight_step(void) { | |||
| 219 | } | 219 | } |
| 220 | rgblight_mode(mode); | 220 | rgblight_mode(mode); |
| 221 | } | 221 | } |
| 222 | void rgblight_step_reverse(void) { | ||
| 223 | uint8_t mode = 0; | ||
| 224 | mode = rgblight_config.mode - 1; | ||
| 225 | if (mode < 1) { | ||
| 226 | mode = RGBLIGHT_MODES; | ||
| 227 | } | ||
| 228 | rgblight_mode(mode); | ||
| 229 | } | ||
| 222 | 230 | ||
| 223 | void rgblight_mode(uint8_t mode) { | 231 | void rgblight_mode(uint8_t mode) { |
| 224 | if (!rgblight_config.enable) { | 232 | if (!rgblight_config.enable) { |
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 12e858305..a63b24604 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -73,6 +73,7 @@ void rgblight_decrease(void); | |||
| 73 | void rgblight_toggle(void); | 73 | void rgblight_toggle(void); |
| 74 | void rgblight_enable(void); | 74 | void rgblight_enable(void); |
| 75 | void rgblight_step(void); | 75 | void rgblight_step(void); |
| 76 | void rgblight_step_reverse(void); | ||
| 76 | void rgblight_mode(uint8_t mode); | 77 | void rgblight_mode(uint8_t mode); |
| 77 | void rgblight_set(void); | 78 | void rgblight_set(void); |
| 78 | void rgblight_update_dword(uint32_t dword); | 79 | void rgblight_update_dword(uint32_t dword); |
