mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 12:37:45 +01:00
use same heap_caps_malloc
parameter as ps_malloc
. (#4484)
Co-authored-by: Your Name <you@example.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
6ec18fc630
commit
1a9141877d
@ -612,7 +612,7 @@ template<class T> class ExternalRAMAllocator {
|
||||
size_t size = n * sizeof(T);
|
||||
T *ptr = nullptr;
|
||||
#ifdef USE_ESP32
|
||||
ptr = static_cast<T *>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM));
|
||||
ptr = static_cast<T *>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
||||
#endif
|
||||
if (ptr == nullptr && (this->flags_ & Flags::REFUSE_INTERNAL) == 0)
|
||||
ptr = static_cast<T *>(malloc(size)); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)
|
||||
|
Loading…
Reference in New Issue
Block a user