Fix a build issue with replacing init_spi_flash() in the host tests
This commit is contained in:
parent
12403e39b4
commit
ec94ee80f7
11 changed files with 8 additions and 43 deletions
|
@ -81,7 +81,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
|
||||||
TEST_SOURCE_FILES = \
|
TEST_SOURCE_FILES = \
|
||||||
test_fatfs.cpp \
|
test_fatfs.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
test_utils.c
|
|
||||||
|
|
||||||
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
|
|
||||||
#include "catch.hpp"
|
#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]")
|
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;
|
FRESULT fr_result;
|
||||||
BYTE pdrv;
|
BYTE pdrv;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#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);
|
|
||||||
}
|
|
|
@ -4,13 +4,6 @@
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "esp32/rom/spi_flash.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)
|
bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2,7 +2,3 @@
|
||||||
|
|
||||||
#include "projdefs.h"
|
#include "projdefs.h"
|
||||||
#include "semphr.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()
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
|
||||||
TEST_SOURCE_FILES = \
|
TEST_SOURCE_FILES = \
|
||||||
test_spiffs.cpp \
|
test_spiffs.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
test_utils.c
|
|
||||||
|
|
||||||
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "catch.hpp"
|
#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)
|
static void init_spiffs(spiffs *fs, uint32_t max_files)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ static void check_spiffs_files(spiffs *fs, const char *base_path, char* cur_path
|
||||||
|
|
||||||
TEST_CASE("format disk, open file, write and read file", "[spiffs]")
|
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;
|
spiffs fs;
|
||||||
s32_t spiffs_res;
|
s32_t spiffs_res;
|
||||||
|
@ -204,7 +204,7 @@ TEST_CASE("format disk, open file, write and read file", "[spiffs]")
|
||||||
|
|
||||||
TEST_CASE("can read spiffs image", "[spiffs]")
|
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;
|
spiffs fs;
|
||||||
s32_t spiffs_res;
|
s32_t spiffs_res;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#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);
|
|
||||||
}
|
|
|
@ -80,7 +80,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
|
||||||
TEST_SOURCE_FILES = \
|
TEST_SOURCE_FILES = \
|
||||||
test_wl.cpp \
|
test_wl.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
test_utils.c
|
|
||||||
|
|
||||||
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#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);
|
|
||||||
}
|
|
|
@ -12,14 +12,14 @@
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#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;
|
extern SpiFlash spiflash;
|
||||||
|
|
||||||
#define TEST_COUNT_MAX 100
|
#define TEST_COUNT_MAX 100
|
||||||
|
|
||||||
TEST_CASE("write and read back data", "[wear_levelling]")
|
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;
|
esp_err_t result;
|
||||||
wl_handle_t wl_handle;
|
wl_handle_t wl_handle;
|
||||||
|
@ -92,7 +92,7 @@ TEST_CASE("write and read back data", "[wear_levelling]")
|
||||||
|
|
||||||
TEST_CASE("power down test", "[wear_levelling]")
|
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;
|
esp_err_t result;
|
||||||
wl_handle_t wl_handle;
|
wl_handle_t wl_handle;
|
||||||
|
|
Loading…
Reference in a new issue