This commit is contained in:
2026-06-08 06:15:52 -04:00
parent 69c0846a27
commit 6a120c9114
2 changed files with 26 additions and 5 deletions

View File

@@ -120,6 +120,8 @@ typedef struct Joystick {
int errno;
Button calibration_button;
Joystick js;
alignas(Freenove_ESP32_WS2812) uint8_t strip_storage[sizeof(Freenove_ESP32_WS2812)];
Freenove_ESP32_WS2812 *strip;
/******************************************************************************/
@@ -131,7 +133,7 @@ void initSerial()
int init2812(Freenove_ESP32_WS2812 **strip)
{
Freenove_ESP32_WS2812 *obj = new Freenove_ESP32_WS2812(8, PIN_2812, 0, TYPE_GRB);
Freenove_ESP32_WS2812 *obj = new(strip_storage) Freenove_ESP32_WS2812(8, PIN_2812, 0, TYPE_GRB);
if ( obj == NULL ) {
ERROR(ERRNO_NULLPOINTER);
}