Use standard timeout checker for LED-Wavepool

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/642/head
Michael Richters 6 years ago
parent 00db95968c
commit 27f1c5fb53

@ -81,14 +81,14 @@ void WavepoolEffect::TransientLEDMode::raindrop(uint8_t x, uint8_t y, int8_t *pa
uint8_t WavepoolEffect::TransientLEDMode::wp_rand() {
static uint16_t offset = 0x400;
offset = ((offset + 1) & 0x4fff) | 0x400;
return (millis() / MS_PER_FRAME) + pgm_read_byte(offset);
return (Kaleidoscope.millisAtCycleStart() / MS_PER_FRAME) + pgm_read_byte(offset);
}
void WavepoolEffect::TransientLEDMode::update(void) {
// limit the frame rate; one frame every 64 ms
static uint8_t prev_time = 0;
uint8_t now = millis() / MS_PER_FRAME;
uint8_t now = Kaleidoscope.millisAtCycleStart() / MS_PER_FRAME;
if (now != prev_time) {
prev_time = now;
} else {

Loading…
Cancel
Save