summaryrefslogtreecommitdiffstats
path: root/users/ninjonas/ninjonas.c
diff options
context:
space:
mode:
authorJonas Avellana <14019120+ninjonas@users.noreply.github.com>2020-02-03 18:50:50 -0700
committerGitHub <noreply@github.com>2020-02-04 12:50:50 +1100
commit50554ca270ae4c58dfa156ae4960e06a7ec6ef31 (patch)
tree0fded0ea9435f3cb05ae8ad5a753a1a22cd76bdb /users/ninjonas/ninjonas.c
parentc6f389b527e04e11e62a11e329f8f52b67a47d63 (diff)
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.c19
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