File tree 2 files changed +27
-0
lines changed
components/heap/port/esp8266
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
#include "esp_heap_caps.h"
16
+ #include "esp_attr.h"
16
17
17
18
#define HEAP_REGION_IRAM_MIN 512
18
19
#define HEAP_REGION_IRAM_MAX 0x00010000
19
20
20
21
heap_region_t g_heap_region [HEAP_REGIONS_MAX ];
21
22
23
+ size_t IRAM_ATTR heap_caps_get_dram_free_size (void )
24
+ {
25
+ #ifndef CONFIG_HEAP_DISABLE_IRAM
26
+ extern size_t g_heap_region_num ;
27
+
28
+ return g_heap_region [g_heap_region_num - 1 ].free_bytes ;
29
+ #else
30
+ return g_heap_region [0 ].free_bytes ;
31
+ #endif
32
+ }
22
33
23
34
/**
24
35
* @brief Initialize the capability-aware heap allocator.
Original file line number Diff line number Diff line change 14
14
15
15
#pragma once
16
16
17
+ #include <stddef.h>
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
17
23
#define _heap_caps_lock (_num ) \
18
24
{ \
19
25
extern void vPortETSIntrLock(void); \
32
38
esp_task_wdt_reset(); \
33
39
}
34
40
41
+ /**
42
+ * @brief Get the total free size of DRAM region
43
+ *
44
+ * @return Amount of free bytes in DRAM region
45
+ */
46
+ size_t heap_caps_get_dram_free_size (void );
47
+
48
+ #ifdef __cplusplus
49
+ }
50
+ #endif
You can’t perform that action at this time.
0 commit comments