summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorYouCanFly <YCF@users.noreply.github.com>2018-01-03 10:54:56 +0800
committerJack Humbert <jack.humb@gmail.com>2018-01-02 21:54:56 -0500
commit6c24e28b8db255b77b4945cd843a617ee5141678 (patch)
tree5ee39631515136281c0da8130b427893ada6b55f /quantum
parentd19805f9de89a6200bc5d85f429cc3f18731b587 (diff)
ADD RGBLIGHT_LIMIT_VAL (#2214)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index ab218b8c50..cc49cdf636 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -46,6 +46,12 @@ bool rgblight_timer_enabled = false;
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
uint8_t r = 0, g = 0, b = 0, base, color;
+ #ifdef RGBLIGHT_LIMIT_VAL
+ if (val > RGBLIGHT_LIMIT_VAL) {
+ val=RGBLIGHT_LIMIT_VAL; // limit the val
+ }
+ #endif
+
if (sat == 0) { // Acromatic color (gray). Hue doesn't mind.
r = val;
g = val;