Skip to content

Instantly share code, notes, and snippets.

@eqhmcow
Created November 2, 2019 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eqhmcow/b54e543d51b49f082f4f14e96ccfe2c4 to your computer and use it in GitHub Desktop.
Save eqhmcow/b54e543d51b49f082f4f14e96ccfe2c4 to your computer and use it in GitHub Desktop.
dsterling@thinkfly:~/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope/plugin$ git diff
diff --git a/src/kaleidoscope/plugin/LED-Wavepool.cpp b/src/kaleidoscope/plugin/LED-Wavepool.cpp
index 1c24fe49..b649e3a5 100644
--- a/src/kaleidoscope/plugin/LED-Wavepool.cpp
+++ b/src/kaleidoscope/plugin/LED-Wavepool.cpp
@@ -179,10 +179,10 @@ void WavepoolEffect::TransientLEDMode::update(void) {
int8_t *p;
for (p = offsets, value = 0; p < offsets + 8; p++)
value += oldpg[offset + (*p)];
- value = (value >> 2) - newpg[offset];
+ value = ((value >> 3) + (value >> 4)) - newpg[offset];
// reduce intensity gradually over time
- newpg[offset] = value - (value >> 3);
+ newpg[offset] = value - ((value >> 2) + (value >> 3));
}
}
#ifdef INTERPOLATE
@@ -202,6 +202,7 @@ void WavepoolEffect::TransientLEDMode::update(void) {
uint8_t intensity = abs(height) * 2;
uint8_t saturation = 0xff - intensity;
uint8_t value = (intensity >= 128) ? 255 : intensity << 1;
+// below is dead code due to use of current_hue -- should rework to let this mode be a compile-time option
int16_t hue = ripple_hue;
if (ripple_hue == WavepoolEffect::rainbow_hue) {
@@ -210,6 +211,8 @@ void WavepoolEffect::TransientLEDMode::update(void) {
hue = (current_hue + height + (height >> 1)) & 0xff;
}
+ hue = current_hue;
+
cRGB color = hsvToRgb(hue, saturation, value);
::LEDControl.setCrgbAt(key_addr, color);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment