From 013175e333911ca9e282e72ff585692f46bc8871 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 31 Jan 2016 21:08:57 -0800 Subject: [PATCH] Remove our internal SetHSV implementation --- LEDControl.cpp | 56 -------------------------------------------------- LEDControl.h | 1 - 2 files changed, 57 deletions(-) diff --git a/LEDControl.cpp b/LEDControl.cpp index 20aaa247..683ff7da 100644 --- a/LEDControl.cpp +++ b/LEDControl.cpp @@ -215,61 +215,5 @@ void LEDControl_::type_letter(uint8_t letter) { } -/* SetHSV from light_ws2812. Their source was: - * getRGB() function based on - * dim_curve idea by Jims - * */ -void LEDControl_::SetHSV(cRGB *crgb, int hue, byte sat, byte val) { - /* convert hue, saturation and brightness ( HSB/HSV ) to RGB - */ - - int base; - - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - crgb->r = val; - crgb->g = val; - crgb->b = val; - } else { - base = ((255 - sat) * val) >> 8; - - switch (hue / 60) { - case 0: - crgb->r = val; - crgb->g = (((val - base)*hue) / 60) + base; - crgb->b = base; - break; - - case 1: - crgb->r = (((val - base)*(60 - (hue % 60))) / 60) + base; - crgb->g = val; - crgb->b = base; - break; - - case 2: - crgb->r = base; - crgb->g = val; - crgb->b = (((val - base)*(hue % 60)) / 60) + base; - break; - - case 3: - crgb->r = base; - crgb->g = (((val - base)*(60 - (hue % 60))) / 60) + base; - crgb->b = val; - break; - - case 4: - crgb->r = (((val - base)*(hue % 60)) / 60) + base; - crgb->g = base; - crgb->b = val; - break; - - case 5: - crgb->r = val; - crgb->g = base; - crgb->b = (((val - base)*(60 - (hue % 60))) / 60) + base; - break; - } - } -} LEDControl_ LEDControl; diff --git a/LEDControl.h b/LEDControl.h index e7967d03..54cedcfe 100644 --- a/LEDControl.h +++ b/LEDControl.h @@ -78,7 +78,6 @@ class LEDControl_ { void effect_heatmap_update(); void effect_numlock_update(); void set_all_leds_to(cRGB color); - void SetHSV(cRGB *crgb, int hue, byte sat, byte val); void initialize_led_mode(uint8_t mode); };