LED: double steps in init animation
This commit is contained in:
parent
9b9040430e
commit
e908f86835
@ -3,7 +3,7 @@
|
||||
|
||||
// This is to keep state between callbacks, when it is 0 the
|
||||
// initial RGB flash is finished
|
||||
uint8_t _hue_countdown = 25;
|
||||
uint8_t _hue_countdown = 50;
|
||||
|
||||
// These are to keep track of user selected color, so we
|
||||
// can restore it after RGB flash
|
||||
@ -16,14 +16,14 @@ uint8_t _value;
|
||||
// stop us from using the keyboard.
|
||||
// https://docs.qmk.fm/#/custom_quantum_functions?id=deferred-executor-registration
|
||||
uint32_t flash_led(uint32_t next_trigger_time, void *cb_arg) {
|
||||
rgblight_sethsv(_hue_countdown * 10, 230, 70);
|
||||
rgblight_sethsv(_hue_countdown * 5, 230, 70);
|
||||
_hue_countdown--;
|
||||
if (_hue_countdown == 0) {
|
||||
// Finished, reset to user chosen led color
|
||||
rgblight_sethsv(_hue, _saturation, _value);
|
||||
return 0;
|
||||
} else {
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ void keyboard_post_init_user(void) {
|
||||
_value = rgblight_get_val();
|
||||
|
||||
// Flash a little on start
|
||||
defer_exec(100, flash_led, NULL);
|
||||
defer_exec(50, flash_led, NULL);
|
||||
}
|
||||
|
||||
// Make the builtin RGB led show different colors per layer:
|
||||
|
Loading…
x
Reference in New Issue
Block a user