mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-09-20 12:50:34 +08:00

1. Add libssc.a, simple serial console lib. 2. Add libspiffs.a, SPI file system. 3. Add libwps.a to support WPS. 4. Add libespconn.a, Espressif connection lib. 5. Add libespnow.a to support Espressif ESP-NOW. 6. Add libmesh.a, Espressif mesh. 7. Add libnopoll.a, websocket. 8. Add make_lib.sh in "third_party" folder. 9. Add modem-sleep & light-sleep supported. 10. Update libcirom.a to support float IO. 11. Update gen_misc.sh & gen_misc.bat. 12. Update header files, add comments in doxygen style. 13. Update libsmartconfig.a to version 2.5.2. 14. Update libssl.a. 15. Updates driver (PWM/UART/GPIO/SPI/Hardware timer). 16. Update open source codes of third_party. 17. Modify "ld" files, "dram0 len" should be 0x18000 in RTOS SDK. 18. Remove header files in extra_include, which are already in compile folder. 19. Other APIs sync from non-OS SDK, more details in documentation "20B-ESP8266__RTOS_SDK_API Reference". 20. Other optimization to make the SDK more stable.
95 lines
2.2 KiB
C
95 lines
2.2 KiB
C
/*
|
|
* test_spiffs.h
|
|
*
|
|
* Created on: Jun 19, 2013
|
|
* Author: petera
|
|
*/
|
|
|
|
#ifndef TEST_SPIFFS_H_
|
|
#define TEST_SPIFFS_H_
|
|
|
|
#include "spiffs.h"
|
|
|
|
#define FS &__fs
|
|
|
|
extern spiffs __fs;
|
|
|
|
|
|
#define CHECK(r) if (!(r)) return -1;
|
|
#define CHECK_RES(r) if (r < 0) return -1;
|
|
#define FS_PURE_DATA_PAGES(fs) \
|
|
((fs)->cfg.phys_size / (fs)->cfg.log_page_size - (fs)->block_count * SPIFFS_OBJ_LOOKUP_PAGES(fs))
|
|
#define FS_PURE_DATA_SIZE(fs) \
|
|
FS_PURE_DATA_PAGES(fs) * SPIFFS_DATA_PAGE_SIZE(fs)
|
|
|
|
typedef enum {
|
|
EMPTY,
|
|
SMALL,
|
|
MEDIUM,
|
|
LARGE,
|
|
} tfile_size;
|
|
|
|
typedef enum {
|
|
UNTAMPERED,
|
|
APPENDED,
|
|
MODIFIED,
|
|
REWRITTEN,
|
|
} tfile_type;
|
|
|
|
typedef enum {
|
|
SHORT = 4,
|
|
NORMAL = 20,
|
|
LONG = 100,
|
|
} tfile_life;
|
|
|
|
typedef struct {
|
|
tfile_size tsize;
|
|
tfile_type ttype;
|
|
tfile_life tlife;
|
|
} tfile_conf;
|
|
|
|
typedef struct {
|
|
int state;
|
|
spiffs_file fd;
|
|
tfile_conf cfg;
|
|
char name[32];
|
|
} tfile;
|
|
|
|
|
|
void fs_reset();
|
|
void fs_reset_specific(u32_t addr_offset, u32_t phys_addr, u32_t phys_size,
|
|
u32_t phys_sector_size,
|
|
u32_t log_block_size, u32_t log_page_size);
|
|
s32_t fs_mount_specific(u32_t phys_addr, u32_t phys_size,
|
|
u32_t phys_sector_size,
|
|
u32_t log_block_size, u32_t log_page_size);
|
|
void fs_set_addr_offset(u32_t offset);
|
|
int read_and_verify(char *name);
|
|
int read_and_verify_fd(spiffs_file fd, char *name);
|
|
void dump_page(spiffs *fs, spiffs_page_ix p);
|
|
void hexdump(u32_t addr, u32_t len);
|
|
char *make_test_fname(const char *name);
|
|
void clear_test_path();
|
|
void area_write(u32_t addr, u8_t *buf, u32_t size);
|
|
void area_read(u32_t addr, u8_t *buf, u32_t size);
|
|
void dump_erase_counts(spiffs *fs);
|
|
void dump_flash_access_stats();
|
|
void set_flash_ops_log(int enable);
|
|
void clear_flash_ops_log();
|
|
u32_t get_flash_ops_log_read_bytes();
|
|
u32_t get_flash_ops_log_write_bytes();
|
|
void invoke_error_after_read_bytes(u32_t b, char once_only);
|
|
void invoke_error_after_write_bytes(u32_t b, char once_only);
|
|
|
|
void memrand(u8_t *b, int len);
|
|
int test_create_file(char *name);
|
|
int test_create_and_write_file(char *name, int size, int chunk_size);
|
|
void _setup();
|
|
void _setup_test_only();
|
|
void _teardown();
|
|
u32_t tfile_get_size(tfile_size s);
|
|
int run_file_config(int cfg_count, tfile_conf* cfgs, int max_runs, int max_concurrent_files, int dbg);
|
|
|
|
|
|
#endif /* TEST_SPIFFS_H_ */
|