Skip to content

Commit 469427c

Browse files
ficetoficeto
ficeto
authored and
ficeto
committed
fix buffer and block size
1 parent 316554f commit 469427c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ uint32_t EspClass::getFlashChipSize(void)
175175
return (2_MB);
176176
case 0x4: // 32 MBit (4MB)
177177
return (4_MB);
178+
case 0x5: // 64 MBit (8MB)
179+
return (8_MB);
180+
case 0x6: // 128 MBit (16MB)
181+
return (16_MB);
182+
case 0x7: // 256 MBit (32MB)
183+
return (32_MB);
178184
default: // fail?
179185
return 0;
180186
}

hardware/esp8266com/esp8266/cores/esp8266/FileSystem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "spiffs/spiffs_esp8266.h"
2424

2525
#define LOGICAL_PAGE_SIZE 256
26-
#define LOGICAL_BLOCK_SIZE 512
26+
#define LOGICAL_BLOCK_SIZE (INTERNAL_FLASH_SECTOR_SIZE * 1)
2727

2828

2929
// These addresses are defined in the linker script.
@@ -64,7 +64,7 @@ int FSClass::_mountInternal(){
6464

6565
SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
6666

67-
_work.reset(new uint8_t[LOGICAL_BLOCK_SIZE]);
67+
_work.reset(new uint8_t[2*LOGICAL_PAGE_SIZE]);
6868
_fdsSize = 32 * _maxOpenFiles;
6969
_fds.reset(new uint8_t[_fdsSize]);
7070
_cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles;

0 commit comments

Comments
 (0)