From 1a9141877d261334393183dfe66e372e9d67832b Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 26 Feb 2023 19:42:29 +0100 Subject: [PATCH] use same `heap_caps_malloc` parameter as `ps_malloc`. (#4484) Co-authored-by: Your Name Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/core/helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 477dadc187..cef303941e 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -612,7 +612,7 @@ template class ExternalRAMAllocator { size_t size = n * sizeof(T); T *ptr = nullptr; #ifdef USE_ESP32 - ptr = static_cast(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)); + ptr = static_cast(heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)); #endif if (ptr == nullptr && (this->flags_ & Flags::REFUSE_INTERNAL) == 0) ptr = static_cast(malloc(size)); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)