mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
fix buffer and block size
This commit is contained in:
@ -175,6 +175,12 @@ uint32_t EspClass::getFlashChipSize(void)
|
|||||||
return (2_MB);
|
return (2_MB);
|
||||||
case 0x4: // 32 MBit (4MB)
|
case 0x4: // 32 MBit (4MB)
|
||||||
return (4_MB);
|
return (4_MB);
|
||||||
|
case 0x5: // 64 MBit (8MB)
|
||||||
|
return (8_MB);
|
||||||
|
case 0x6: // 128 MBit (16MB)
|
||||||
|
return (16_MB);
|
||||||
|
case 0x7: // 256 MBit (32MB)
|
||||||
|
return (32_MB);
|
||||||
default: // fail?
|
default: // fail?
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "spiffs/spiffs_esp8266.h"
|
#include "spiffs/spiffs_esp8266.h"
|
||||||
|
|
||||||
#define LOGICAL_PAGE_SIZE 256
|
#define LOGICAL_PAGE_SIZE 256
|
||||||
#define LOGICAL_BLOCK_SIZE 512
|
#define LOGICAL_BLOCK_SIZE (INTERNAL_FLASH_SECTOR_SIZE * 1)
|
||||||
|
|
||||||
|
|
||||||
// These addresses are defined in the linker script.
|
// These addresses are defined in the linker script.
|
||||||
@ -64,7 +64,7 @@ int FSClass::_mountInternal(){
|
|||||||
|
|
||||||
SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
|
SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
|
||||||
|
|
||||||
_work.reset(new uint8_t[LOGICAL_BLOCK_SIZE]);
|
_work.reset(new uint8_t[2*LOGICAL_PAGE_SIZE]);
|
||||||
_fdsSize = 32 * _maxOpenFiles;
|
_fdsSize = 32 * _maxOpenFiles;
|
||||||
_fds.reset(new uint8_t[_fdsSize]);
|
_fds.reset(new uint8_t[_fdsSize]);
|
||||||
_cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles;
|
_cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles;
|
||||||
|
Reference in New Issue
Block a user