2020-09-06 22:04:29 +00:00
|
|
|
#include "stanrc85.h"
|
|
|
|
|
|
|
|
static uint8_t top = 0;
|
|
|
|
static uint8_t middle = 0;
|
|
|
|
static uint8_t bottom = 0;
|
|
|
|
|
|
|
|
static bool is_enabled = true;
|
|
|
|
static bool is_rgblight_startup = true;
|
|
|
|
static uint16_t rgblight_startup_loop_timer;
|
|
|
|
|
|
|
|
void matrix_scan_user(void) {
|
|
|
|
// Boot up "fanfare"
|
|
|
|
if (is_rgblight_startup && is_keyboard_master()) {
|
|
|
|
if (timer_elapsed(rgblight_startup_loop_timer) > 10) {
|
|
|
|
static uint8_t counter;
|
|
|
|
counter++;
|
|
|
|
if (counter == 1) {
|
|
|
|
top = 1;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_0, top);
|
|
|
|
wait_ms(300);
|
2020-09-06 22:04:29 +00:00
|
|
|
top = 0;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_0, top);
|
2020-09-06 22:04:29 +00:00
|
|
|
}
|
|
|
|
if (counter == 2) {
|
|
|
|
middle = 1;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_1, middle);
|
|
|
|
wait_ms(300);
|
2020-09-06 22:04:29 +00:00
|
|
|
middle = 0;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_1, middle);
|
2020-09-06 22:04:29 +00:00
|
|
|
}
|
|
|
|
if (counter == 3) {
|
|
|
|
bottom = 1;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_2, bottom);
|
|
|
|
wait_ms(300);
|
2020-09-06 22:04:29 +00:00
|
|
|
bottom = 0;
|
2021-01-11 07:03:12 +00:00
|
|
|
writePin(INDICATOR_PIN_2, bottom);
|
2020-09-06 22:04:29 +00:00
|
|
|
}
|
|
|
|
if (counter == 4) {
|
|
|
|
is_enabled = is_rgblight_startup = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|