mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 11:56:25 +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);
|
size_t size = n * sizeof(T);
|
||||||
T *ptr = nullptr;
|
T *ptr = nullptr;
|
||||||
#ifdef USE_ESP32
|
#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
|
#endif
|
||||||
if (ptr == nullptr && (this->flags_ & Flags::REFUSE_INTERNAL) == 0)
|
if (ptr == nullptr && (this->flags_ & Flags::REFUSE_INTERNAL) == 0)
|
||||||
ptr = static_cast<T *>(malloc(size)); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)
|
ptr = static_cast<T *>(malloc(size)); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)
|
||||||
|
Loading…
Reference in New Issue
Block a user