chore(radio): save some ram in radios with RGB LEDs (#5973)

Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: Risto <rotorman@users.noreply.github.com>
This commit is contained in:
3djc
2025-03-11 12:04:12 +10:00
committed by GitHub
co-authored by 3djc Risto
parent 538c5fcf40
commit 5bb7612040
8 changed files with 50 additions and 60 deletions
+5 -18
View File
@@ -57,19 +57,6 @@
#include "csd203_sensor.h"
#endif
#if defined(LED_STRIP_GPIO)
// Common LED driver
extern const stm32_pulse_timer_t _led_timer;
void ledStripOff()
{
for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) {
ws2812_set_color(i, 0, 0, 0);
}
ws2812_update(&_led_timer);
}
#endif
HardwareOptions hardwareOptions;
bool boardBacklightOn = false;
@@ -144,12 +131,13 @@ uint16_t getSixPosAnalogValue(uint16_t adcValue)
}
if (dirty) {
for (uint8_t i = 0; i < 6; i++) {
if (i == sixPosState)
if (i == sixPosState) {
ws2812_set_color(i, SIXPOS_LED_RED, SIXPOS_LED_GREEN, SIXPOS_LED_BLUE);
else
} else {
ws2812_set_color(i, 0, 0, 0);
}
}
ws2812_update(&_led_timer);
rgbLedColorApply();
}
return (4096/5)*(sixPosState);
}
@@ -232,8 +220,7 @@ void boardInit()
hapticInit();
#if defined(LED_STRIP_GPIO)
ws2812_init(&_led_timer, LED_STRIP_LENGTH, WS2812_GRB);
ledStripOff();
rgbLedInit();
#endif
#if defined(BLUETOOTH)