From 50554ca270ae4c58dfa156ae4960e06a7ec6ef31 Mon Sep 17 00:00:00 2001 From: Jonas Avellana <14019120+ninjonas@users.noreply.github.com> Date: Mon, 3 Feb 2020 18:50:50 -0700 Subject: Ninjonas userspace (#8070) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 --- users/ninjonas/ninjonas.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'users/ninjonas/ninjonas.c') diff --git a/users/ninjonas/ninjonas.c b/users/ninjonas/ninjonas.c index 49e12e482..7e5afcec8 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 -- cgit v1.2.3