mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fatfs: fix SPIRAM allocation not used due to Kconfig option name error
Closes https://github.com/espressif/esp-idf/issues/5756
This commit is contained in:
parent
1a1e1911f9
commit
c330def25a
@ -8,7 +8,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "ff.h"
|
||||
#include "sdkconfig.h"
|
||||
#ifdef CONFIG_FATFS_ALLOC_EXTRAM_FIRST
|
||||
#ifdef CONFIG_FATFS_ALLOC_PREFER_EXTRAM
|
||||
#include "esp_heap_caps.h"
|
||||
#endif
|
||||
|
||||
@ -16,8 +16,8 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block (null on
|
||||
unsigned msize /* Number of bytes to allocate */
|
||||
)
|
||||
{
|
||||
#ifdef CONFIG_FATFS_ALLOC_EXTRAM_FIRST
|
||||
return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM,
|
||||
#ifdef CONFIG_FATFS_ALLOC_PREFER_EXTRAM
|
||||
return heap_caps_malloc_prefer(msize, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM,
|
||||
MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
|
||||
#else
|
||||
return malloc(msize);
|
||||
|
@ -223,3 +223,15 @@ TEST_CASE("(WL) opendir, readdir, rewinddir, seekdir work as expected using UTF-
|
||||
test_teardown();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SPIRAM
|
||||
TEST_CASE("FATFS prefers SPI RAM for allocations", "[fatfs]")
|
||||
{
|
||||
test_setup();
|
||||
DIR* dir = opendir("/spiflash");
|
||||
TEST_ASSERT_NOT_NULL(dir);
|
||||
TEST_ASSERT(esp_ptr_external_ram(dir));
|
||||
closedir(dir);
|
||||
test_teardown();
|
||||
}
|
||||
#endif // CONFIG_SPIRAM
|
||||
|
@ -24,6 +24,6 @@ CONFIG_COMPILER_WARN_WRITE_STRINGS=y
|
||||
CONFIG_SPI_MASTER_IN_IRAM=y
|
||||
CONFIG_EFUSE_VIRTUAL=y
|
||||
CONFIG_SPIRAM_BANKSWITCH_ENABLE=n
|
||||
CONFIG_FATFS_ALLOC_EXTRAM_FIRST=y
|
||||
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y
|
||||
CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL=y
|
||||
CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=n
|
||||
|
Loading…
Reference in New Issue
Block a user