1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Added missing check for failure on umm_push_heap calls in Esp.cpp (#7767)

Added lost comments for Esp.h
This commit is contained in:
M Hightower 2020-12-14 11:37:41 -08:00 committed by GitHub
parent fd69945abc
commit 9eb618e3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 3 deletions

View File

@ -984,15 +984,20 @@ void EspClass::enableVM()
void EspClass::setExternalHeap()
{
#ifdef UMM_HEAP_EXTERNAL
if (vmEnabled)
umm_push_heap(UMM_HEAP_EXTERNAL);
if (vmEnabled) {
if (!umm_push_heap(UMM_HEAP_EXTERNAL)) {
panic();
}
}
#endif
}
void EspClass::setIramHeap()
{
#ifdef UMM_HEAP_IRAM
umm_push_heap(UMM_HEAP_IRAM);
if (!umm_push_heap(UMM_HEAP_IRAM)) {
panic();
}
#endif
}

View File

@ -215,10 +215,41 @@ class EspClass {
#else
uint32_t getCycleCount();
#endif // !defined(CORE_MOCK)
/**
* @brief Installs VM exception handler to support External memory (Experimental)
*
* @param none
* @return none
*/
void enableVM();
/**
* @brief Push current Heap selection and set Heap selection to DRAM.
*
* @param none
* @return none
*/
void setDramHeap();
/**
* @brief Push current Heap selection and set Heap selection to IRAM.
*
* @param none
* @return none
*/
void setIramHeap();
/**
* @brief Push current Heap selection and set Heap selection to External. (Experimental)
*
* @param none
* @return none
*/
void setExternalHeap();
/**
* @brief Restores Heap selection back to value present when
* setDramHeap, setIramHeap, or setExternalHeap was called.
*
* @param none
* @return none
*/
void resetHeap();
private:
#ifdef UMM_HEAP_EXTERNAL