feat: support for RadioMaster GX12 (#5703)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
raphaelcoeffic
philmoz
Peter Feerick
parent
0f86cd9a95
commit
36cdd93a1a
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "hal/rgbleds.h"
|
||||
|
||||
bool usbChargerLed() { return true; }
|
||||
void ledRed() {}
|
||||
@@ -28,6 +29,33 @@ void ledBlue() {}
|
||||
void ledOff() {}
|
||||
void fsLedOn(uint8_t) {}
|
||||
void fsLedOff(uint8_t) {}
|
||||
bool getFSLedState(uint8_t) { return false;}
|
||||
void fsLedRGB(uint8_t, uint32_t) {}
|
||||
bool fsLedState(uint8_t) { return false;}
|
||||
void rgbSetLedColor(unsigned char, unsigned char, unsigned char, unsigned char) {}
|
||||
void rgbLedColorApply() {}
|
||||
|
||||
uint8_t getRGBColorIndex(uint32_t color)
|
||||
{
|
||||
for (uint8_t i = 0; i < (sizeof(colorTable) / sizeof(colorTable[0])); i++) {
|
||||
if (color == colorTable[i])
|
||||
return(i);
|
||||
}
|
||||
return 5; // Custom value set with Companion
|
||||
}
|
||||
|
||||
// RGB
|
||||
#define WS2812_BYTES_PER_LED 3
|
||||
|
||||
// Maximum number of supported LEDs
|
||||
#if !defined(WS2812_MAX_LEDS)
|
||||
# define WS2812_MAX_LEDS 48
|
||||
#endif
|
||||
|
||||
// Pixel values
|
||||
static uint8_t _led_colors[WS2812_BYTES_PER_LED * WS2812_MAX_LEDS];
|
||||
|
||||
uint32_t rgbGetLedColor(uint8_t led)
|
||||
{
|
||||
uint8_t* pixel = &_led_colors[led * WS2812_BYTES_PER_LED];
|
||||
return (pixel[1] << 16) + (pixel[0] << 8) + pixel[2];
|
||||
}
|
||||
Reference in New Issue
Block a user