Skip to content

Instantly share code, notes, and snippets.

@arkag
Created September 7, 2018 14:34
Show Gist options
  • Save arkag/fe15bd4aa004f4a3ee36c862df3b4f5a to your computer and use it in GitHub Desktop.
Save arkag/fe15bd4aa004f4a3ee36c862df3b4f5a to your computer and use it in GitHub Desktop.
void matrix_scan_user(void) {
if (flash && !flash_on_started && !flash_off_started) {
flash_start_timer = timer_read();
flash_on_started = true;
set_color(underglow, false);
} else if (flash && flash_on_started && !flash_off_started) {
uint16_t flash_timer = timer_read();
uint16_t elapsed = flash_timer - flash_start_timer;
if (elapsed >= LED_FLASH_DELAY) {
flash_on_started = false;
flash_off_started = true;
rgblight_sethsv_eeprom_helper(0, 255, 0, false);
flash_start_timer = timer_read();
}
} else if (flash && flash_off_started && !flash_on_started) {
uint16_t flash_timer = timer_read();
uint16_t elapsed = flash_timer - flash_start_timer;
if (elapsed >= LED_FLASH_DELAY) {
flash_off_started = false;
flash = false;
set_color(underglow, true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment