'Pixels' has backwards compatible arguments fixing #22755 (#22791)

* 'Pixels' has backwards compatible arguments fixing #22755

* Fix fallback height
This commit is contained in:
s-hadinger 2025-01-09 19:16:49 +01:00 committed by GitHub
parent e57b3e8b05
commit f42cb555c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
### Changed
- GPIOViewer from v1.5.8 to v1.5.9 (No functional change)
- `Pixels` has backwards compatible arguments fixing #22755
### Fixed
- Shutter discovery message regression from v14.4.1 (#22730)

View File

@ -791,15 +791,15 @@ void CmndLed(void)
void CmndPixels(void)
{
uint32_t parm[4] = { Settings->light_pixels, Settings->light_pixels_reverse,
(uint32_t) Settings->light_pixels_height_1 + 1, Settings->light_pixels_alternate };
uint32_t parm[4] = { Settings->light_pixels, 0 /* reverse = 0 */,
0 /* height = 1 (minus 1) */, 0 /* alternate = 0 */ };
if (ParseParameters(4, parm) > 0) {
if ((parm[0] > 0) && (parm[0] <= WS2812_MAX_LEDS)) {
Ws2812Clear(); // Clear all known pixels
Ws2812CanShowWait();
Settings->light_pixels = parm[0];
Settings->light_pixels_reverse = parm[1];
Settings->light_pixels_height_1 = (parm[2] > 0) ? parm[2] - 1 : 1;
Settings->light_pixels_height_1 = (parm[2] > 0) ? parm[2] - 1 : 0;
Settings->light_pixels_alternate = parm[3];
Ws2812ChangePixelCount();
Light.update = true;