From 0dc50ff14126001d44d8e7ef4738ca8f7a7259e5 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 8 Nov 2016 16:39:14 -0800 Subject: [PATCH] Add a helper method for setting all LEDs to a non-predefined color --- LEDControl.cpp | 7 +++++++ LEDControl.h | 1 + 2 files changed, 8 insertions(+) diff --git a/LEDControl.cpp b/LEDControl.cpp index d3c24683..482db7d1 100644 --- a/LEDControl.cpp +++ b/LEDControl.cpp @@ -51,6 +51,13 @@ void LEDControl_::initialize_led_mode(uint8_t mode) { } } +void LEDControl_::set_all_leds_to(uint8_t r, uint8_t g, uint8_t b) { + cRGB color; + color.r=r; + color.g=g; + color.b=b; + set_all_leds_to(color); +} void LEDControl_::set_all_leds_to(cRGB color) { for (uint8_t i = 0; i < LED_COUNT; i++) { led_set_crgb_at(i, color); diff --git a/LEDControl.h b/LEDControl.h index dceb6e13..ac408c4c 100644 --- a/LEDControl.h +++ b/LEDControl.h @@ -75,6 +75,7 @@ class LEDControl_ { void effect_heatmap_update(); void effect_numlock_update(); void set_all_leds_to(cRGB color); + void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); void initialize_led_mode(uint8_t mode); };