feat(bw128): add customisable switches edit page, allow editing custom colors (#5799)

This commit is contained in:
philmoz
2025-01-20 10:13:40 +10:00
committed by GitHub
parent a83b5cdb7b
commit a3c0e0a007
4 changed files with 171 additions and 154 deletions
+3 -7
View File
@@ -28,9 +28,9 @@
#include "boards/generic_stm32/rgb_leds.h"
#endif
#define GET_RED(color) (((color) & 0xF80000) >>16)
#define GET_GREEN(color) (((color) & 0x000F800) >> 8)
#define GET_BLUE(color) (((color) & 0xF8))
#define GET_RED(color) (((color) & 0xFF0000) >>16)
#define GET_GREEN(color) (((color) & 0x000FF00) >> 8)
#define GET_BLUE(color) (((color) & 0xFF))
#if defined(FUNCTION_SWITCHES) && !defined(FUNCTION_SWITCHES_RGB_LEDS)
static const uint32_t fsLeds[] = {FSLED_GPIO_PIN_1, FSLED_GPIO_PIN_2,
@@ -75,10 +75,6 @@ uint8_t getRGBColorIndex(uint32_t color)
if (color == colorTable[i])
return(i + 1);
}
for (uint8_t i = 0; i < DIM(colorTabl2); i++) {
if (color == colorTabl2[i])
return(i + 1);
}
return 0; // Custom value set with Companion
}
#elif defined(FUNCTION_SWITCHES)