|
|
@ -81,14 +81,14 @@ void WavepoolEffect::TransientLEDMode::raindrop(uint8_t x, uint8_t y, int8_t *pa
|
|
|
|
uint8_t WavepoolEffect::TransientLEDMode::wp_rand() {
|
|
|
|
uint8_t WavepoolEffect::TransientLEDMode::wp_rand() {
|
|
|
|
static uint16_t offset = 0x400;
|
|
|
|
static uint16_t offset = 0x400;
|
|
|
|
offset = ((offset + 1) & 0x4fff) | 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) {
|
|
|
|
void WavepoolEffect::TransientLEDMode::update(void) {
|
|
|
|
|
|
|
|
|
|
|
|
// limit the frame rate; one frame every 64 ms
|
|
|
|
// limit the frame rate; one frame every 64 ms
|
|
|
|
static uint8_t prev_time = 0;
|
|
|
|
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) {
|
|
|
|
if (now != prev_time) {
|
|
|
|
prev_time = now;
|
|
|
|
prev_time = now;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|