Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
80c110ec
Commit
80c110ec
authored
Aug 18, 2018
by
me-no-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more methods to access memory properties
parent
65511b23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
cores/esp32/Esp.cpp
cores/esp32/Esp.cpp
+34
-0
cores/esp32/Esp.h
cores/esp32/Esp.h
+12
-1
No files found.
cores/esp32/Esp.cpp
View file @
80c110ec
...
...
@@ -112,16 +112,50 @@ void EspClass::restart(void)
esp_restart
();
}
uint32_t
EspClass
::
getHeapSize
(
void
)
{
multi_heap_info_t
info
;
heap_caps_get_info
(
&
info
,
MALLOC_CAP_INTERNAL
);
return
info
.
total_free_bytes
+
info
.
total_allocated_bytes
;
}
uint32_t
EspClass
::
getFreeHeap
(
void
)
{
return
heap_caps_get_free_size
(
MALLOC_CAP_INTERNAL
);
}
uint32_t
EspClass
::
getMinFreeHeap
(
void
)
{
return
heap_caps_get_minimum_free_size
(
MALLOC_CAP_INTERNAL
);
}
uint32_t
EspClass
::
getMaxAllocHeap
(
void
)
{
return
heap_caps_get_largest_free_block
(
MALLOC_CAP_INTERNAL
);
}
uint32_t
EspClass
::
getPsramSize
(
void
)
{
multi_heap_info_t
info
;
heap_caps_get_info
(
&
info
,
MALLOC_CAP_SPIRAM
);
return
info
.
total_free_bytes
+
info
.
total_allocated_bytes
;
}
uint32_t
EspClass
::
getFreePsram
(
void
)
{
return
heap_caps_get_free_size
(
MALLOC_CAP_SPIRAM
);
}
uint32_t
EspClass
::
getMinFreePsram
(
void
)
{
return
heap_caps_get_minimum_free_size
(
MALLOC_CAP_SPIRAM
);
}
uint32_t
EspClass
::
getMaxAllocPsram
(
void
)
{
return
heap_caps_get_largest_free_block
(
MALLOC_CAP_SPIRAM
);
}
uint8_t
EspClass
::
getChipRevision
(
void
)
{
esp_chip_info_t
chip_info
;
...
...
cores/esp32/Esp.h
View file @
80c110ec
...
...
@@ -56,8 +56,19 @@ public:
EspClass
()
{}
~
EspClass
()
{}
void
restart
();
uint32_t
getFreeHeap
();
//Internal RAM
uint32_t
getHeapSize
();
//total heap size
uint32_t
getFreeHeap
();
//available heap
uint32_t
getMinFreeHeap
();
//lowest level of free heap since boot
uint32_t
getMaxAllocHeap
();
//largest block of heap that can be allocated at once
//SPI RAM
uint32_t
getPsramSize
();
uint32_t
getFreePsram
();
uint32_t
getMinFreePsram
();
uint32_t
getMaxAllocPsram
();
uint8_t
getChipRevision
();
uint8_t
getCpuFreqMHz
(){
return
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
;
}
uint32_t
getCycleCount
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment