diff options
author | stanrc85 <47038504+stanrc85@users.noreply.github.com> | 2020-09-06 18:04:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 15:04:29 -0700 |
commit | 6c3e404839bec5f04e8f0d9eef4f0ac98b16e987 (patch) | |
tree | 05d19ae0db38079c61807710c0b8b48bf8b71525 /users/stanrc85/stanrc85.c | |
parent | f7ccbfcea88e127319a4665a6c8ca67883854030 (diff) | |
download | firmware-6c3e404839bec5f04e8f0d9eef4f0ac98b16e987.tar.gz firmware-6c3e404839bec5f04e8f0d9eef4f0ac98b16e987.tar.bz2 firmware-6c3e404839bec5f04e8f0d9eef4f0ac98b16e987.zip |
[Keymap] Add indicator light bootup fanfare (#10158)
* Add indicator light bootup fanfare
* move fanfare code to new file
* fanfare code in new file and remove unused boards
* new startup fanfare code
* add lock/unlock indicator animation
* input key presses before changing lights
* remove old code
Diffstat (limited to 'users/stanrc85/stanrc85.c')
-rw-r--r-- | users/stanrc85/stanrc85.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c index c1aaad1a1..2dbd41974 100644 --- a/users/stanrc85/stanrc85.c +++ b/users/stanrc85/stanrc85.c @@ -44,8 +44,42 @@ void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) { } } +#if defined(HAS_INDICATORS) + static uint8_t led_user = 0; +#endif + +void lock_unlock (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: // Ctl + Alt + Del to unlock workstation + tap_code16(KC_CAD); + #if defined(HAS_INDICATORS) + led_user = 0; + writePin(INDICATOR_PIN_0, !led_user); + wait_ms(200); + writePin(INDICATOR_PIN_1, !led_user); + wait_ms(200); + writePin(INDICATOR_PIN_2, !led_user); + #endif + break; + case SINGLE_HOLD: + break; + case DOUBLE_TAP: //Lock workstation + tap_code16(KC_LOCK); + #if defined(HAS_INDICATORS) + led_user = 1; + writePin(INDICATOR_PIN_2, !led_user); + wait_ms(200); + writePin(INDICATOR_PIN_1, !led_user); + wait_ms(200); + writePin(INDICATOR_PIN_0, !led_user); + #endif + break; + } +} + qk_tap_dance_action_t tap_dance_actions[] = { - [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), + [TD_WIN] = ACTION_TAP_DANCE_FN(lock_unlock), [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV), [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset) }; |