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 /quantum | |
parent | 0e548f8b5d6b89de877f098ea919eaea87511b6e (diff) |
Added mode reverse step function
Diffstat (limited to 'quantum')
-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 f91f3caff5..7e057b63e8 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -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) { diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 12e8583057..a63b246047 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -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); |