summaryrefslogtreecommitdiffstats
path: root/users/xtonhasvim/fancylighting.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/xtonhasvim/fancylighting.c')
-rw-r--r--users/xtonhasvim/fancylighting.c11
1 files changed, 8 insertions, 3 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;