diff options
author | Jonas Avellana <[email protected]> | 2020-02-03 18:50:50 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-04 12:50:50 +1100 |
commit | 50554ca270ae4c58dfa156ae4960e06a7ec6ef31 (patch) | |
tree | 0fded0ea9435f3cb05ae8ad5a753a1a22cd76bdb /users/ninjonas/ninjonas.c | |
parent | c6f389b527e04e11e62a11e329f8f52b67a47d63 (diff) | |
download | qmk_firmware-50554ca270ae4c58dfa156ae4960e06a7ec6ef31.tar.gz qmk_firmware-50554ca270ae4c58dfa156ae4960e06a7ec6ef31.zip |
Ninjonas userspace (#8070)
* [keymap(kyria)] moved OLED & encoder implementation to separate classes
* [feat] created logic to cycle through hue wheel when starting keyboard
* [feat] created logic to cycle through hue wheel and return to user's default color
* [refactor] updating OLED layout for crkbd & lily58
* [refactor] updating OLED layout for crkbd & lily58
* [fix(8070)] updating encoder.c logic based off drashna's code review
* [refactor(8070)] added key to send + Shift + M
Diffstat (limited to 'users/ninjonas/ninjonas.c')
-rw-r--r-- | users/ninjonas/ninjonas.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/users/ninjonas/ninjonas.c b/users/ninjonas/ninjonas.c index 49e12e4824..7e5afcec87 100644 --- a/users/ninjonas/ninjonas.c +++ b/users/ninjonas/ninjonas.c @@ -17,4 +17,23 @@ layer_state_t layer_state_set_user (layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#endif +void keyboard_post_init_user() { + #ifdef RGBLIGHT_ENABLE + // Cycles through the entire hue wheel and resetting to default color + uint16_t default_hue = rgblight_config.hue; + rgblight_enable_noeeprom(); + layer_state_set_user(layer_state); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom((i + default_hue) % 255, rgblight_config.sat, rgblight_config.val); + matrix_scan(); + wait_ms(10); + } + #endif + layer_state_set_user(layer_state); }
\ No newline at end of file |