arduino-audio-tools
src
AudioTools
AudioLibs
MemoryManager.h
1
#pragma once
2
3
#include "AudioLogger.h"
4
#ifdef ESP32
5
#include "esp_heap_caps.h"
6
#endif
7
8
namespace
audio_tools
{
9
18
class
MemoryManager
{
19
public
:
21
MemoryManager
() =
default
;
23
MemoryManager
(
int
limit) {
24
begin
(limit);
25
};
27
bool
begin
(
int
limit = 10000) {
28
#ifdef ESP32
29
LOGI(
"Activate PSRAM from %d bytes"
, limit);
30
heap_caps_malloc_extmem_enable(limit);
31
return
true
;
32
#else
33
return
false
;
34
#endif
35
}
36
};
37
38
}
audio_tools::MemoryManager
MemoryManager which activates the use of external SPIRAM memory. When external memory is in use,...
Definition:
MemoryManager.h:18
audio_tools::MemoryManager::MemoryManager
MemoryManager()=default
Default Constructor - call begin() to activate PSRAM.
audio_tools::MemoryManager::MemoryManager
MemoryManager(int limit)
Constructor which activates PSRAM. This constructor automatically calls begin()
Definition:
MemoryManager.h:23
audio_tools::MemoryManager::begin
bool begin(int limit=10000)
Activate the PSRAM for allocated memory > limit.
Definition:
MemoryManager.h:27
audio_tools
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition:
AudioConfig.h:868
Generated by
1.9.1