Skip to content

Commit

Permalink
switch millis() to Kaleidoscope.millisAtCycleStart()
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinr committed Sep 30, 2018
1 parent c817b46 commit 95bc370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Kaleidoscope/LED-Fire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ EventHandlerResult FireEffect::onKeyswitchEvent(Key &mapped_key, byte row, byte
uint8_t FireEffect::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 FireEffect::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 {
Expand Down

0 comments on commit 95bc370

Please sign in to comment.