diff options
author | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:43:45 +1100 |
---|---|---|
committer | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:43:45 +1100 |
commit | 2bb2977c133646c4e056960e72029270d77cc1eb (patch) | |
tree | 235d491f992121ac1716c5bf2fafb80983748576 /users/xtonhasvim | |
parent | a55c838961c89097ab849ed6cb1f261791e6b9b4 (diff) | |
parent | 47c91fc7f75ae0a477e55b687aa0fc30da0a283c (diff) |
Merge branch 'master' into debounce_refactor
# Conflicts:
# tmk_core/common/keyboard.c
Diffstat (limited to 'users/xtonhasvim')
-rw-r--r-- | users/xtonhasvim/fancylighting.c | 11 | ||||
-rw-r--r-- | users/xtonhasvim/fancylighting.h | 9 | ||||
-rw-r--r-- | users/xtonhasvim/xtonhasvim.h | 6 |
3 files changed, 15 insertions, 11 deletions
diff --git a/users/xtonhasvim/fancylighting.c b/users/xtonhasvim/fancylighting.c index f4af5ec55d..a88ca4beb3 100644 --- a/users/xtonhasvim/fancylighting.c +++ b/users/xtonhasvim/fancylighting.c @@ -34,13 +34,18 @@ void matrix_scan_keymap(void) { #define FADE_BACK_TIME 500 #define BREATH_FIRE_TIME 1000 #define ANIMATION_STEP_INTERVAL 20 + +#if RGBLED_NUM >= 2 #define POWER_KEY_OFFSET (RGBLED_NUM / 2) #define SPACE_OFFSET_MAX (RGBLED_NUM / 2) - +#else +#define POWER_KEY_OFFSET 1 +#define SPACE_OFFSET_MAX 1 +#endif uint16_t effect_start_timer = 0; uint8_t user_rgb_mode = 0; -LED_TYPE shadowed_led[RGBLED_NUM] = {0}; +LED_TYPE shadowed_led[RGBLED_NUM] = {{0}}; void start_firey_return(void) { user_rgb_mode = BREATH_FIRE; @@ -74,7 +79,7 @@ void set_color_for_offsets(uint16_t time_offset, uint16_t space_offset, uint8_t float alpha = (time_progress + 0.1) * 7.0 - space_progress; alpha = fmin(1.0, alpha*alpha); - LED_TYPE px[1] = {0}; + LED_TYPE px[1] = {{0}}; sethsv((uint16_t)(fmod(time_progress * 1.5 + space_progress,1.0)*360), 255, (uint8_t)(progress*255),&px[0]); led[idx].r = alpha * px[0].r + ( 1.0 - alpha) * shadowed_led[idx].r; led[idx].g = alpha * px[0].g + ( 1.0 - alpha) * shadowed_led[idx].g; diff --git a/users/xtonhasvim/fancylighting.h b/users/xtonhasvim/fancylighting.h index 982010d3d5..02fb58b84a 100644 --- a/users/xtonhasvim/fancylighting.h +++ b/users/xtonhasvim/fancylighting.h @@ -1,4 +1,4 @@ -p /* Copyright 2015-2017 Christon DeWan +/* Copyright 2015-2017 Christon DeWan * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,16 +20,17 @@ p /* Copyright 2015-2017 Christon DeWan #include "xtonhasvim.h" + extern uint8_t user_rgb_mode; extern LED_TYPE shadowed_led[]; -void start_firey_return(void); -#endif //_fancy_lighting_h +#endif //RGBLIGHT_ENABLE +void start_firey_return(void); enum xtonhasvim_rgbmodes { BREATH_FIRE = 1, FADE_BACK }; -#endif //RGBLIGHT_ENABLE +#endif //_fancy_lighting_h diff --git a/users/xtonhasvim/xtonhasvim.h b/users/xtonhasvim/xtonhasvim.h index 5ff4932a48..2d6670a5e6 100644 --- a/users/xtonhasvim/xtonhasvim.h +++ b/users/xtonhasvim/xtonhasvim.h @@ -22,11 +22,9 @@ #define X_____X KC_NO -bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record); - enum xtonhasvim_keycodes { - DUMMY = SAFE_RANGE, - FIREY_RETURN, // kick off special effects + // 20: give keyboard-specific codes some room + FIREY_RETURN = SAFE_RANGE + 20, // kick off special effects VIM_START, // bookend for vim states VIM_A, VIM_B, |