diff --git a/library.properties b/library.properties index ff66292e..55e9a724 100644 --- a/library.properties +++ b/library.properties @@ -7,4 +7,3 @@ paragraph=... category=Communication url=https://github.com/keyboardio/Keyboardio-LEDControl architectures=avr -dot_a_linkage=true diff --git a/src/LED-BreatheEffect.cpp b/src/LED-BreatheEffect.cpp deleted file mode 100644 index 3f249bda..00000000 --- a/src/LED-BreatheEffect.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "LED-BreatheEffect.h" - -LEDBreatheEffect_::LEDBreatheEffect_ (void) { -} - -void -LEDBreatheEffect_::update (void) { - cRGB color = breath_compute(); - LEDControl.set_all_leds_to (color); -} - -LEDBreatheEffect_ LEDBreatheEffect; diff --git a/src/LED-BreatheEffect.h b/src/LED-BreatheEffect.h deleted file mode 100644 index 781cf59f..00000000 --- a/src/LED-BreatheEffect.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "Keyboardio-LEDControl.h" -#include "LEDUtils.h" - -class LEDBreatheEffect_ : LEDMode { - public: - LEDBreatheEffect_ (void); - - virtual void update (void) final; - - private: -}; - -extern LEDBreatheEffect_ LEDBreatheEffect; diff --git a/src/LED-ChaseEffect.cpp b/src/LED-ChaseEffect.cpp deleted file mode 100644 index 7c32b568..00000000 --- a/src/LED-ChaseEffect.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "LED-ChaseEffect.h" - -LEDChaseEffect_::LEDChaseEffect_ (void) { -} - -void -LEDChaseEffect_::update (void) { - if (current_chase_counter++ < chase_threshold) { - return; - } - current_chase_counter = 0; - LEDControl.led_set_crgb_at(pos - (chase_sign* chase_pixels), {0, 0, 0}); - LEDControl.led_set_crgb_at(pos, {0, 0, 0}); - - pos += chase_sign; - if (pos >= LED_COUNT || pos <= 0) { - chase_sign = -chase_sign; - } - LEDControl.led_set_crgb_at(pos, {0, 0, 255}); - LEDControl.led_set_crgb_at(pos - (chase_sign * chase_pixels), {255, 0, 0}); -} - -LEDChaseEffect_ LEDChaseEffect; diff --git a/src/LED-ChaseEffect.h b/src/LED-ChaseEffect.h deleted file mode 100644 index 2576df9d..00000000 --- a/src/LED-ChaseEffect.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "Keyboardio-LEDControl.h" -#include "LEDUtils.h" - -class LEDChaseEffect_ : LEDMode { - public: - LEDChaseEffect_ (void); - - virtual void update (void) final; - - private: - uint8_t pos = 0; - int8_t chase_sign = 1; //negative values when it's going backwar - uint8_t chase_pixels = 5; - uint8_t current_chase_counter = 0; - static const uint8_t chase_threshold = 20; -}; - -extern LEDChaseEffect_ LEDChaseEffect; diff --git a/src/LED-Numlock.cpp b/src/LED-Numlock.cpp deleted file mode 100644 index 4a17f99e..00000000 --- a/src/LED-Numlock.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "LED-Numlock.h" -#include "LEDUtils.h" -#include "layers.h" - -static uint8_t numpadIndex; -static uint8_t storedLEDMode; -static uint8_t us; - -LEDNumlock::LEDNumlock (uint8_t numpadIdx) { - numpadIndex = numpadIdx; -} - -void -LEDNumlock::begin (void) { - us = LEDControl.mode_add (this); - loop_hook_add (this->loopHook); -} - -void -LEDNumlock::setup (void) { - if (!Layer.isOn (numpadIndex)) { - LEDControl.next_mode (); - } -} - -void -LEDNumlock::update (void) { - for (uint8_t i = 0; i < 44; i++) { - LEDControl.led_set_crgb_at(i, {0, 0, 0}); - } - for (uint8_t i = 44; i < LED_COUNT; i++) { - LEDControl.led_set_crgb_at(i, {255, 0, 0}); - } - - cRGB color = breath_compute (); - LEDControl.led_set_crgb_at (60, color); -} - -void -LEDNumlock::loopHook (bool postClear) { - if (!postClear) - return; - - if (Layer.isOn (numpadIndex)) { - if (storedLEDMode != us) { - storedLEDMode = LEDControl.get_mode (); - } - LEDControl.set_mode (us); - } - - if (!Layer.isOn (numpadIndex) && - LEDControl.get_mode () == us) { - LEDControl.set_mode (storedLEDMode); - } -} diff --git a/src/LED-Numlock.h b/src/LED-Numlock.h deleted file mode 100644 index 14521096..00000000 --- a/src/LED-Numlock.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "Keyboardio-LEDControl.h" -#include "LEDUtils.h" - -class LEDNumlock : LEDMode { - public: - LEDNumlock (uint8_t numpadIndex); - - virtual void begin (void) final; - - virtual void update (void) final; - virtual void setup (void) final; - - private: - static void loopHook (bool postClear); -}; diff --git a/src/LED-RainbowEffect.cpp b/src/LED-RainbowEffect.cpp deleted file mode 100644 index e258f06d..00000000 --- a/src/LED-RainbowEffect.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "LED-RainbowEffect.h" - -LEDRainbowEffect_::LEDRainbowEffect_ (void) { -} - -void -LEDRainbowEffect_::update (void) { - if (rainbow_current_ticks++ < rainbow_ticks) { - return; - } else { - rainbow_current_ticks = 0; - } - - cRGB rainbow = hsv_to_rgb(rainbow_hue, rainbow_saturation, rainbow_value); - - rainbow_hue += rainbow_steps; - if (rainbow_hue >= 255) { - rainbow_hue -= 255; - } - LEDControl.set_all_leds_to(rainbow); -} - -LEDRainbowEffect_ LEDRainbowEffect; - -// --------- - -LEDRainbowWaveEffect_::LEDRainbowWaveEffect_ (void) { -} - -void -LEDRainbowWaveEffect_::update (void) { - if (rainbow_current_ticks++ < rainbow_wave_ticks) { - return; - } else { - rainbow_current_ticks = 0; - } - - for (uint8_t i = 0; i < LED_COUNT; i++) { - uint16_t key_hue = rainbow_hue +16*(i/4); - if (key_hue >= 255) { - key_hue -= 255; - } - cRGB rainbow = hsv_to_rgb(key_hue, rainbow_saturation, rainbow_value); - LEDControl.led_set_crgb_at (i, rainbow); - } - rainbow_hue += rainbow_wave_steps; - if (rainbow_hue >= 255) { - rainbow_hue -= 255; - } -} - -LEDRainbowWaveEffect_ LEDRainbowWaveEffect; diff --git a/src/LED-RainbowEffect.h b/src/LED-RainbowEffect.h deleted file mode 100644 index 5589e18c..00000000 --- a/src/LED-RainbowEffect.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "Keyboardio-LEDControl.h" -#include "LEDUtils.h" - -class LEDRainbowEffect_ : LEDMode { - public: - LEDRainbowEffect_ (void); - - virtual void update (void) final; - - private: - uint16_t rainbow_hue = 0; //stores 0 to 614 - - static const uint8_t rainbow_steps = 1; //number of hues we skip in a 360 range per update - long rainbow_current_ticks = 0; - static const long rainbow_ticks = 10; //delays between update - - static const byte rainbow_saturation = 255; - static const byte rainbow_value = 50; - -}; - -extern LEDRainbowEffect_ LEDRainbowEffect; - -class LEDRainbowWaveEffect_ : LEDMode { - public: - LEDRainbowWaveEffect_ (void); - - virtual void update (void) final; - - private: - uint16_t rainbow_hue = 0; //stores 0 to 614 - - static const uint8_t rainbow_wave_steps = 1; //number of hues we skip in a 360 range per update - long rainbow_current_ticks = 0; - static const long rainbow_wave_ticks = 10; //delays between update - - static const byte rainbow_saturation = 255; - static const byte rainbow_value = 50; -}; - -extern LEDRainbowWaveEffect_ LEDRainbowWaveEffect; diff --git a/src/LED-SolidColor.cpp b/src/LED-SolidColor.cpp deleted file mode 100644 index 84a57126..00000000 --- a/src/LED-SolidColor.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "LED-SolidColor.h" - -LEDSolidColor::LEDSolidColor (uint8_t r, uint8_t g, uint8_t b) { - this->r = r; - this->g = g; - this->b = b; - LEDControl.mode_add (this); -} - -void -LEDSolidColor::init (void) { - LEDControl.set_all_leds_to (r, g, b); -} diff --git a/src/LED-SolidColor.h b/src/LED-SolidColor.h deleted file mode 100644 index 01965678..00000000 --- a/src/LED-SolidColor.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "Keyboardio-LEDControl.h" - -class LEDSolidColor : LEDMode { - public: - LEDSolidColor (uint8_t r, uint8_t g, uint8_t b); - - virtual void init (void) final; - - private: - uint8_t r, g, b; -};