From 7ff6a7c249560d4624b2d97ec4c32953fb40e819 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Wed, 17 Jun 2026 21:52:06 +0200 Subject: [PATCH] Fixes --- Devices/m5stack-stackchan/m5stack,stackchan.dts | 1 + Platforms/platform-esp32/source/drivers/esp32_grove.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Devices/m5stack-stackchan/m5stack,stackchan.dts b/Devices/m5stack-stackchan/m5stack,stackchan.dts index 4fdae9ce..00b4729b 100644 --- a/Devices/m5stack-stackchan/m5stack,stackchan.dts +++ b/Devices/m5stack-stackchan/m5stack,stackchan.dts @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/Platforms/platform-esp32/source/drivers/esp32_grove.cpp b/Platforms/platform-esp32/source/drivers/esp32_grove.cpp index 63cf5f12..4e84a2d1 100644 --- a/Platforms/platform-esp32/source/drivers/esp32_grove.cpp +++ b/Platforms/platform-esp32/source/drivers/esp32_grove.cpp @@ -168,7 +168,13 @@ static error_t start_device(Device* device) { if (!data) return ERROR_OUT_OF_MEMORY; device_set_driver_data(device, data); - return start_child(device, config->defaultMode); + if (start_child(device, config->defaultMode) != ERROR_NONE) { + device_set_driver_data(device, nullptr); + delete data; + return ERROR_RESOURCE; + } + + return ERROR_NONE; } static error_t stop_device(Device* device) {