diff options
author | stein3 <stein3@gmail.com> | 2020-10-06 07:15:41 -0700 |
---|---|---|
committer | stein3 <stein3@gmail.com> | 2020-10-06 07:15:41 -0700 |
commit | 2e402741a89c5eec8cf30c966ce6f36d6ec9249b (patch) | |
tree | 3592e8c5e6bd19943ae55db7fc02a5f755afbb51 /users/stanrc85/startup_fanfare.c | |
parent | 3e5e4f74272c610bb9fa737f674f8e65ed6100ca (diff) | |
parent | 2013f6313430b977e557e482d30daa279a46e75d (diff) |
Merge branch 'master' into meteor
Diffstat (limited to 'users/stanrc85/startup_fanfare.c')
-rw-r--r-- | users/stanrc85/startup_fanfare.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/users/stanrc85/startup_fanfare.c b/users/stanrc85/startup_fanfare.c new file mode 100644 index 0000000000..507d9e389c --- /dev/null +++ b/users/stanrc85/startup_fanfare.c @@ -0,0 +1,43 @@ +#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; + writePin(INDICATOR_PIN_0, !top); + wait_ms(200); + top = 0; + writePin(INDICATOR_PIN_0, !top); + } + if (counter == 2) { + middle = 1; + writePin(INDICATOR_PIN_1, !middle); + wait_ms(200); + middle = 0; + writePin(INDICATOR_PIN_1, !middle); + } + if (counter == 3) { + bottom = 1; + writePin(INDICATOR_PIN_2, !bottom); + wait_ms(200); + bottom = 0; + writePin(INDICATOR_PIN_2, !bottom); + } + if (counter == 4) { + is_enabled = is_rgblight_startup = false; + } + } + } +} |