File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -111,16 +111,6 @@ bool isSpiffsFilenameValid(const char* name)
111
111
// these symbols should be defined in the linker script for each flash layout
112
112
#ifndef CORE_MOCK
113
113
#ifdef ARDUINO
114
- extern " C" uint32_t _SPIFFS_start;
115
- extern " C" uint32_t _SPIFFS_end;
116
- extern " C" uint32_t _SPIFFS_page;
117
- extern " C" uint32_t _SPIFFS_block;
118
-
119
- #define SPIFFS_PHYS_ADDR ((uint32_t ) (&_SPIFFS_start) - 0x40200000 )
120
- #define SPIFFS_PHYS_SIZE ((uint32_t ) (&_SPIFFS_end) - (uint32_t ) (&_SPIFFS_start))
121
- #define SPIFFS_PHYS_PAGE ((uint32_t ) &_SPIFFS_page)
122
- #define SPIFFS_PHYS_BLOCK ((uint32_t ) &_SPIFFS_block)
123
-
124
114
#ifndef SPIFFS_MAX_OPEN_FILES
125
115
#define SPIFFS_MAX_OPEN_FILES 5
126
116
#endif
Original file line number Diff line number Diff line change 35
35
36
36
using namespace fs ;
37
37
38
+ #ifdef ARDUINO
39
+ extern " C" uint32_t _SPIFFS_start;
40
+ extern " C" uint32_t _SPIFFS_end;
41
+ extern " C" uint32_t _SPIFFS_page;
42
+ extern " C" uint32_t _SPIFFS_block;
43
+
44
+ #define SPIFFS_PHYS_ADDR ((uint32_t ) (&_SPIFFS_start) - 0x40200000 )
45
+ #define SPIFFS_PHYS_SIZE ((uint32_t ) (&_SPIFFS_end) - (uint32_t ) (&_SPIFFS_start))
46
+ #define SPIFFS_PHYS_PAGE ((uint32_t ) &_SPIFFS_page)
47
+ #define SPIFFS_PHYS_BLOCK ((uint32_t ) &_SPIFFS_block)
48
+ #endif
49
+
38
50
extern int32_t spiffs_hal_write (uint32_t addr, uint32_t size, uint8_t *src);
39
51
extern int32_t spiffs_hal_erase (uint32_t addr, uint32_t size);
40
52
extern int32_t spiffs_hal_read (uint32_t addr, uint32_t size, uint8_t *dst);
@@ -114,6 +126,10 @@ class SPIFFSImpl : public FSImpl
114
126
115
127
bool begin () override
116
128
{
129
+ #if defined(ARDUINO) && !defined(CORE_MOCK)
130
+ if (&_SPIFFS_end <= &_SPIFFS_start)
131
+ return false ;
132
+ #endif
117
133
if (SPIFFS_mounted (&_fs) != 0 ) {
118
134
return true ;
119
135
}
You can’t perform that action at this time.
0 commit comments