cleanup
This commit is contained in:
@ -42,12 +42,6 @@ static int16_t beatsin16(uint8_t bpm, int16_t min_val, int16_t max_val)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Beat calculation helper (beatsin8 variant)
|
||||
static uint8_t beatsin8(uint8_t bpm, uint8_t min_val, uint8_t max_val)
|
||||
{
|
||||
return (uint8_t)beatsin16(bpm, min_val, max_val);
|
||||
}
|
||||
|
||||
// Random helper
|
||||
static uint8_t random8(void)
|
||||
{
|
||||
@ -187,37 +181,6 @@ static void anim_sinelon(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void anim_bpm(void)
|
||||
{
|
||||
// Colored stripes pulsing at 33 BPM
|
||||
uint8_t bpm = 33;
|
||||
uint8_t beat = beatsin8(bpm, 64, 255);
|
||||
|
||||
uint16_t num_leds_a = led_get_num_leds_a();
|
||||
uint16_t num_leds_b = led_get_num_leds_b();
|
||||
|
||||
// PartyColors palette simulation
|
||||
const uint8_t palette_colors[] = {
|
||||
170, 240, 90, 150, 210, 30, 180, 0,
|
||||
210, 255, 150, 240, 255, 60, 255, 120};
|
||||
|
||||
for (uint16_t i = 0; i < num_leds_a; i++)
|
||||
{
|
||||
uint8_t color_index = (global_hue + (i * 2)) & 0x0F;
|
||||
uint8_t brightness = beat - global_hue + (i * 10);
|
||||
hsv_t hsv = {palette_colors[color_index], 255, brightness};
|
||||
led_set_pixel_a(i, led_hsv_to_rgb(hsv));
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < num_leds_b; i++)
|
||||
{
|
||||
uint8_t color_index = (global_hue + ((i + num_leds_a) * 2)) & 0x0F;
|
||||
uint8_t brightness = beat - global_hue + ((i + num_leds_a) * 10);
|
||||
hsv_t hsv = {palette_colors[color_index], 255, brightness};
|
||||
led_set_pixel_b(i, led_hsv_to_rgb(hsv));
|
||||
}
|
||||
}
|
||||
|
||||
static void anim_navigation(void)
|
||||
{
|
||||
// Navigation lights: left red, right green
|
||||
@ -442,9 +405,6 @@ void animation_update(void)
|
||||
case ANIM_SINELON:
|
||||
anim_sinelon();
|
||||
break;
|
||||
case ANIM_BPM:
|
||||
// anim_bpm();
|
||||
break;
|
||||
case ANIM_NAVIGATION:
|
||||
anim_navigation();
|
||||
break;
|
||||
@ -477,7 +437,6 @@ const char *animation_get_mode_name(animation_mode_t mode)
|
||||
"Rainbow with Glitter",
|
||||
"Confetti",
|
||||
"Sinelon",
|
||||
"33BPM",
|
||||
"Navigation",
|
||||
"Chase",
|
||||
"Chase RGB",
|
||||
|
||||
@ -23,11 +23,10 @@ typedef enum {
|
||||
ANIM_RAINBOW_GLITTER = 6, // Rainbow with glitter
|
||||
ANIM_CONFETTI = 7, // Random colored speckles
|
||||
ANIM_SINELON = 8, // Colored dot sweeping (RGB cycling)
|
||||
ANIM_BPM = 9, // Colored stripes @ 33 BPM
|
||||
ANIM_NAVIGATION = 10, // Navigation lights (red left, green right)
|
||||
ANIM_CHASE = 11, // Red dot sweeping
|
||||
ANIM_CHASE_RGB = 12, // RGB cycling dot sweeping
|
||||
ANIM_RANDOM = 13, // Random mode
|
||||
ANIM_NAVIGATION = 9, // Navigation lights (red left, green right)
|
||||
ANIM_CHASE = 10, // Red dot sweeping
|
||||
ANIM_CHASE_RGB = 11, // RGB cycling dot sweeping
|
||||
ANIM_RANDOM = 12, // Random mode
|
||||
ANIM_MODE_COUNT
|
||||
} animation_mode_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user