Added function for clearing LED strips.

This commit is contained in:
Terje Io
2025-08-25 22:17:58 +02:00
parent 43fa98d93b
commit f081b9f37e
4 changed files with 43 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
## grblHAL ##
Latest build date is 20250808, see the [changelog](changelog.md) for details.
Latest build date is 20250825, see the [changelog](changelog.md) for details.
> [!NOTE]
> A settings reset will be performed on an update of builds prior to 20241208. Backup and restore of settings is recommended.

View File

@@ -1,5 +1,28 @@
## grblHAL changelog
<a name="20250825">Build 20250825
Core:
* Added function for clearing LED strips.
Drivers:
* ESP32: fix for incorrect handling of claimed analog output ports. Ref. issue [#175](https://github.com/grblHAL/ESP32/issues/175).
* LPC176x: fix for NXP framework "bug" causing compiler error insted of warning, possibly due to stricter compiler in newer versions of the IDE.
Ref. discussion [#57](https://github.com/grblHAL/LPC176x/discussions/57).
* STM32F4xx: updated to allow mixing of LED strip drivers.
Plugins:
* Keypad, macros: fixed typo.
* Plasma: added arc ok, probe and up/down input states to real time report when idle.
--
<a name="20250806">Build 20250806
Core:

2
grbl.h
View File

@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20250808
#define GRBL_BUILD 2020825
#define GRBL_URL "https://github.com/grblHAL"

19
rgb.h
View File

@@ -3,7 +3,7 @@
Part of grblHAL
Copyright (c) 2024 Terje Io
Copyright (c) 2024-2025 Terje Io
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -100,6 +100,23 @@ static inline bool rgb_is_onoff (rgb_ptr_t *device)
return device->out != NULL && device->cap.R == 1 && device->cap.G == 1 && device->cap.B == 1;
}
static inline void rgb_clear (rgb_ptr_t *device)
{
if(device->set_intensity)
device->set_intensity(255);
if(rgb_is_neopixels(device) && device->num_devices) {
uint32_t idx;
for(idx = 0; idx <= device->num_devices; idx++)
device->out(idx, (rgb_color_t){0});
if(device->num_devices > 1 && device->write)
device->write();
}
}
// Intensity conversions
static inline rgb_color_t rgb_set_intensity (rgb_color_t color, uint8_t intensity)