mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue