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) {