Better feedback (lights and sounds) for reentry.

This commit is contained in:
Joe Kearney 2025-06-14 14:21:14 -05:00
parent 9431dc4534
commit 7c20b061ac
2 changed files with 93 additions and 5 deletions

View file

@ -23,7 +23,10 @@
static color_t All_On_Color = COLOR_WHITE;
static DisplayStyle_T All_On_Style = DISPLAY_STYLE_DEFAULT;
static uint32_t Time_in_Animation_in_ms = 0;
static uint8_t Heartbeat_Phase = 0;
static const uint8_t MIN_HEARTBEAT_BRIGHTNESS = 50;
static uint16_t Time_in_Animation_in_ms = 0;
static void Reset(void *Data)
{
@ -93,6 +96,29 @@ static AnimationStepResult_T NextStep(void)
#endif // CONFIG_KTAG_N_NEOPIXEL_CHANNELS
}
}
else if (All_On_Style == DISPLAY_STYLE_BLINK)
{
if ((Time_in_Animation_in_ms % 200) < 100)
{
NeoPixels_Set_Color_Range_On_All_Channels(0, CONFIG_KTAG_MAX_NEOPIXELS_PER_CHANNEL - 1, All_On_Color);
}
else
{
NeoPixels_Set_Color_Range_On_All_Channels(0, CONFIG_KTAG_MAX_NEOPIXELS_PER_CHANNEL - 1, COLOR_BLACK);
}
}
else if (All_On_Style == DISPLAY_STYLE_HEARTBEAT)
{
uint8_t Brightness = Sine8[Heartbeat_Phase];
Heartbeat_Phase += 2;
if (Brightness < MIN_HEARTBEAT_BRIGHTNESS)
{
Brightness = MIN_HEARTBEAT_BRIGHTNESS;
}
NeoPixels_Set_Color_Range_On_All_Channels(0, CONFIG_KTAG_MAX_NEOPIXELS_PER_CHANNEL - 1, ApplyMask(All_On_Color, Brightness));
}
else
{
NeoPixels_Set_Color_Range_On_All_Channels(0, CONFIG_KTAG_MAX_NEOPIXELS_PER_CHANNEL - 1, All_On_Color);