Skip to content

Commit 3d3a3ec

Browse files
committed
Add compile time switches to enable selection of flash chip at compile time to support various flash chips
1 parent a5b780e commit 3d3a3ec

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Arduino_SPIFFS.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@ Directory Arduino_SPIFFS::opendir(const char *name)
7474
* EXTERN DECLARATION
7575
**************************************************************************************/
7676

77-
Arduino_SPIFFS filesystem(w25q16_spi_read, w25q16_spi_write, w25q16_spi_erase);
77+
Arduino_SPIFFS filesystem(
78+
#if defined(SPIFFS_USE_W25Q16DV_FLASH)
79+
w25q16_spi_read, w25q16_spi_write, w25q16_spi_erase
80+
#endif
81+
);

src/Arduino_SPIFFS.h

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ extern "C"
3333
#include "spiffs.h"
3434
}
3535

36+
/**************************************************************************************
37+
* CONFIGURATION
38+
**************************************************************************************/
39+
40+
#define SPIFFS_USE_W25Q16DV_FLASH
41+
42+
/**************************************************************************************
43+
* SANITY CHECK
44+
**************************************************************************************/
45+
46+
#if !defined(SPIFFS_USE_W25Q16DV_FLASH)
47+
#error "Enable at least one flash chip for usage with Arduino_SPIFFS"
48+
#endif
49+
3650
/**************************************************************************************
3751
* STATIC ASSERTIONS
3852
**************************************************************************************/

0 commit comments

Comments
 (0)