TEST_SOURCE_FILES = \
test_fatfs.cpp \
main.cpp \
- test_utils.c
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
#include "catch.hpp"
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
TEST_CASE("create volume, open file, write and read back data", "[fatfs]")
{
- init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+ _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
FRESULT fr_result;
BYTE pdrv;
+++ /dev/null
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
- spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
#include "esp_err.h"
#include "esp32/rom/spi_flash.h"
-extern void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
-
-void spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
- _spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
-
bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length)
{
return true;
#include "projdefs.h"
#include "semphr.h"
-
-// Avoid redefinition compile error. Put here since this is included
-// in flash_ops.c.
-#define spi_flash_init() overriden_spi_flash_init()
TEST_SOURCE_FILES = \
test_spiffs.cpp \
main.cpp \
- test_utils.c
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
#include "catch.hpp"
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
static void init_spiffs(spiffs *fs, uint32_t max_files)
{
TEST_CASE("format disk, open file, write and read file", "[spiffs]")
{
- init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+ _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
spiffs fs;
s32_t spiffs_res;
TEST_CASE("can read spiffs image", "[spiffs]")
{
- init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+ _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
spiffs fs;
s32_t spiffs_res;
+++ /dev/null
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
- spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
TEST_SOURCE_FILES = \
test_wl.cpp \
main.cpp \
- test_utils.c
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
+++ /dev/null
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
- spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
#include "sdkconfig.h"
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
extern SpiFlash spiflash;
#define TEST_COUNT_MAX 100
TEST_CASE("write and read back data", "[wear_levelling]")
{
- init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+ _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
esp_err_t result;
wl_handle_t wl_handle;
TEST_CASE("power down test", "[wear_levelling]")
{
- init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+ _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
esp_err_t result;
wl_handle_t wl_handle;