mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
change(test): test changes for esp cache malloc
This commit is contained in:
parent
d341540a5e
commit
e36a396801
@ -525,7 +525,7 @@ TEST_CASE("DW_GDMA M2M Test: memory set with fixed address", "[DW_GDMA]")
|
|||||||
// memset: source in psram and destination in sram
|
// memset: source in psram and destination in sram
|
||||||
size_t ext_mem_alignment = 0;
|
size_t ext_mem_alignment = 0;
|
||||||
size_t int_mem_alignment = 0;
|
size_t int_mem_alignment = 0;
|
||||||
TEST_ESP_OK(esp_cache_get_alignment(ESP_CACHE_MALLOC_FLAG_PSRAM, &ext_mem_alignment));
|
TEST_ESP_OK(esp_cache_get_alignment(MALLOC_CAP_SPIRAM, &ext_mem_alignment));
|
||||||
TEST_ESP_OK(esp_cache_get_alignment(0, &int_mem_alignment));
|
TEST_ESP_OK(esp_cache_get_alignment(0, &int_mem_alignment));
|
||||||
uint8_t *src_buf = heap_caps_aligned_calloc(ext_mem_alignment, 1, 256, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
uint8_t *src_buf = heap_caps_aligned_calloc(ext_mem_alignment, 1, 256, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
uint8_t *dst_buf = heap_caps_aligned_calloc(int_mem_alignment, 1, 256, MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
uint8_t *dst_buf = heap_caps_aligned_calloc(int_mem_alignment, 1, 256, MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||||
|
@ -20,7 +20,7 @@ TEST_CASE("test esp_cache_aligned_malloc_prefer", "[cache]")
|
|||||||
{
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
size_t actual_size = 0;
|
size_t actual_size = 0;
|
||||||
TEST_ESP_OK(esp_cache_aligned_malloc_prefer(40, &ptr, &actual_size, 1, ESP_CACHE_MALLOC_FLAG_DMA, 0));
|
TEST_ESP_OK(esp_cache_aligned_malloc_prefer(40, &ptr, &actual_size, 1, MALLOC_CAP_DMA, 0));
|
||||||
TEST_ASSERT(esp_ptr_dma_capable(ptr));
|
TEST_ASSERT(esp_ptr_dma_capable(ptr));
|
||||||
ESP_LOGI(TAG, "actual size: 0x%x", actual_size);
|
ESP_LOGI(TAG, "actual size: 0x%x", actual_size);
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ TEST_CASE("test esp_cache_aligned_calloc_prefer", "[cache]")
|
|||||||
{
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
size_t actual_size = 0;
|
size_t actual_size = 0;
|
||||||
TEST_ESP_OK(esp_cache_aligned_calloc_prefer(1, 40, &ptr, &actual_size, 1, ESP_CACHE_MALLOC_FLAG_DMA, 0));
|
TEST_ESP_OK(esp_cache_aligned_calloc_prefer(1, 40, &ptr, &actual_size, 1, MALLOC_CAP_DMA, 0));
|
||||||
TEST_ASSERT(esp_ptr_dma_capable(ptr));
|
TEST_ASSERT(esp_ptr_dma_capable(ptr));
|
||||||
ESP_LOGI(TAG, "actual size: 0d%d", actual_size);
|
ESP_LOGI(TAG, "actual size: 0d%d", actual_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user