mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Add ledstrip_grb_rgb setting (GRB or RGB) to handle WS2811 or WS2812 … (#5255)
* Add ledstrip_grb_rgb setting (GRB or RGB) to handle WS2811 or WS2812 LED drivers * Rename setting lookup table to lookupLedStripPackingOrder * Fix call to ws2811UpdateStrip * Fix unit test * Use ledStripFormatRGB_e enumeration for RGB packing format * Fix unit test * Whoops. Make ledStripFormatRGB_e match lookupLedStripFormatRGB * Applied review feedback * Add documentation of ledstrip_grb_rgb
This commit is contained in:
parent
94f06e1e05
commit
0430fcb67d
8 changed files with 77 additions and 13 deletions
|
@ -293,6 +293,12 @@ static const char * const lookupOverclock[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef USE_LED_STRIP
|
||||
static const char * const lookupLedStripFormatRGB[] = {
|
||||
"GRB", "RGB"
|
||||
};
|
||||
#endif
|
||||
|
||||
const lookupTableEntry_t lookupTables[] = {
|
||||
{ lookupTableOffOn, sizeof(lookupTableOffOn) / sizeof(char *) },
|
||||
{ lookupTableUnit, sizeof(lookupTableUnit) / sizeof(char *) },
|
||||
|
@ -348,6 +354,9 @@ const lookupTableEntry_t lookupTables[] = {
|
|||
#ifdef USE_OVERCLOCK
|
||||
{ lookupOverclock, sizeof(lookupOverclock) / sizeof(char *) },
|
||||
#endif
|
||||
#ifdef USE_LED_STRIP
|
||||
{ lookupLedStripFormatRGB, sizeof(lookupLedStripFormatRGB) / sizeof(char *) },
|
||||
#endif
|
||||
#ifdef USE_DUAL_GYRO
|
||||
{ lookupTableGyro, sizeof(lookupTableGyro) / sizeof(char *) },
|
||||
#endif
|
||||
|
@ -730,6 +739,7 @@ const clivalue_t valueTable[] = {
|
|||
// PG_LED_STRIP_CONFIG
|
||||
#ifdef USE_LED_STRIP
|
||||
{ "ledstrip_visual_beeper", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_visual_beeper) },
|
||||
{ "ledstrip_grb_rgb", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_RGB_GRB }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_grb_rgb) },
|
||||
#endif
|
||||
|
||||
// PG_SDCARD_CONFIG
|
||||
|
|
|
@ -77,6 +77,9 @@ typedef enum {
|
|||
#ifdef USE_OVERCLOCK
|
||||
TABLE_OVERCLOCK,
|
||||
#endif
|
||||
#ifdef USE_LED_STRIP
|
||||
TABLE_RGB_GRB,
|
||||
#endif
|
||||
#ifdef USE_DUAL_GYRO
|
||||
TABLE_GYRO,
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue