mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
Add WS2812 scheme define (#1463)
* Add define for additional number of WS2812 schemes (#1463)
This commit is contained in:
parent
5639b6d966
commit
85d75ffc95
@ -1,6 +1,7 @@
|
|||||||
/* 5.10.0f
|
/* 5.10.0f
|
||||||
* Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449)
|
* Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449)
|
||||||
* Fix display of build date and time in non-english locale (#1465)
|
* Fix display of build date and time in non-english locale (#1465)
|
||||||
|
* Add define for additional number of WS2812 schemes (#1463)
|
||||||
*
|
*
|
||||||
* 5.10.0e
|
* 5.10.0e
|
||||||
* Add Italian language file (#1449)
|
* Add Italian language file (#1449)
|
||||||
|
@ -51,6 +51,8 @@
|
|||||||
*
|
*
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
|
#define WS2812_SCHEMES 7 // Number of additional WS2812 schemes supported by xdrv_ws2812.ino
|
||||||
|
|
||||||
enum LightCommands {
|
enum LightCommands {
|
||||||
CMND_COLOR, CMND_COLORTEMPERATURE, CMND_DIMMER, CMND_LED, CMND_LEDTABLE, CMND_FADE,
|
CMND_COLOR, CMND_COLORTEMPERATURE, CMND_DIMMER, CMND_LED, CMND_LEDTABLE, CMND_FADE,
|
||||||
CMND_PIXELS, CMND_SCHEME, CMND_SPEED, CMND_WAKEUP, CMND_WAKEUPDURATION, CMND_WIDTH, CMND_UNDOCA };
|
CMND_PIXELS, CMND_SCHEME, CMND_SPEED, CMND_WAKEUP, CMND_WAKEUPDURATION, CMND_WIDTH, CMND_UNDOCA };
|
||||||
@ -377,7 +379,7 @@ void LightInit(void)
|
|||||||
light_subtype++; // from RGB to RGBW
|
light_subtype++; // from RGB to RGBW
|
||||||
#endif
|
#endif
|
||||||
Ws2812Init();
|
Ws2812Init();
|
||||||
max_scheme = LS_MAX +7;
|
max_scheme = LS_MAX + WS2812_SCHEMES;
|
||||||
}
|
}
|
||||||
#endif // USE_WS2812 ************************************************************************
|
#endif // USE_WS2812 ************************************************************************
|
||||||
else {
|
else {
|
||||||
@ -1069,7 +1071,7 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
}
|
}
|
||||||
#endif // USE_WS2812 ************************************************************************
|
#endif // USE_WS2812 ************************************************************************
|
||||||
else if ((CMND_SCHEME == command_code) && (light_subtype >= LST_RGB)) {
|
else if ((CMND_SCHEME == command_code) && (light_subtype >= LST_RGB)) {
|
||||||
uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX +7 : LS_MAX -1;
|
uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX + WS2812_SCHEMES : LS_MAX -1;
|
||||||
if (('+' == option) && (Settings.light_scheme < max_scheme)) {
|
if (('+' == option) && (Settings.light_scheme < max_scheme)) {
|
||||||
payload = Settings.light_scheme + ((0 == Settings.light_scheme) ? 2 : 1); // Skip wakeup
|
payload = Settings.light_scheme + ((0 == Settings.light_scheme) ? 2 : 1); // Skip wakeup
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ WsColor kHanukkah[2] = { 0,0,255, 255,255,255 };
|
|||||||
WsColor kwanzaa[3] = { 255,0,0, 0,0,0, 0,255,0 };
|
WsColor kwanzaa[3] = { 255,0,0, 0,0,0, 0,255,0 };
|
||||||
WsColor kRainbow[7] = { 255,0,0, 255,128,0, 255,255,0, 0,255,0, 0,0,255, 128,0,255, 255,0,255 };
|
WsColor kRainbow[7] = { 255,0,0, 255,128,0, 255,255,0, 0,255,0, 0,0,255, 128,0,255, 255,0,255 };
|
||||||
WsColor kFire[3] = { 255,0,0, 255,102,0, 255,192,0 };
|
WsColor kFire[3] = { 255,0,0, 255,102,0, 255,192,0 };
|
||||||
ColorScheme kSchemes[7] = {
|
ColorScheme kSchemes[WS2812_SCHEMES] = {
|
||||||
kIncandescent, 2,
|
kIncandescent, 2,
|
||||||
kRgb, 3,
|
kRgb, 3,
|
||||||
kChristmas, 2,
|
kChristmas, 2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user