freertos(IDF): Remove usage of xPortGetFreeHeapSize() outside FreeRTOS

After heap_idf.c has been added (where the FreeRTOS heap is a subset of the
ESP-IDF heap), xPortGetFreeHeapSize() was updated to only returns the free
size of the FreeRTOS heap and not the entire ESP-IDF heap.

This commit replaces calls of xPortGetFreeHeapSize() with
esp_get_free_heap_size() in places outside of FreeRTOS.
This commit is contained in:
Darian Leung
2023-03-07 02:02:28 +08:00
parent e21ab0332b
commit 4069a62629
2 changed files with 9 additions and 7 deletions

View File

@@ -16,6 +16,7 @@
#include "freertos/queue.h"
#include "unity.h"
#include "esp_heap_caps.h"
#include "esp_system.h"
#include "sdkconfig.h"
@@ -127,7 +128,7 @@ TEST_CASE("unreasonable allocs should all fail", "[heap]")
TEST_ASSERT_NULL(test_malloc_wrapper(16*1024*1024));
TEST_ASSERT_NULL(test_malloc_wrapper(SIZE_MAX / 2));
TEST_ASSERT_NULL(test_malloc_wrapper(SIZE_MAX - 256));
TEST_ASSERT_NULL(test_malloc_wrapper(xPortGetFreeHeapSize() - 1));
TEST_ASSERT_NULL(test_malloc_wrapper(esp_get_free_heap_size() - 1));
}
TEST_CASE("malloc(0) should return a NULL pointer", "[heap]")