mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Oops. Need to pass layout by reference in order to capture the correct address. Took a while to find that. There maybe a better way to store all these configs
This commit is contained in:
parent
0fb1ebc3c0
commit
745db9ab55
@ -34,6 +34,7 @@ namespace FST {
|
|||||||
const layout layout_16m14m (0x40400000, 0x411FA000, 0x100, 0x2000 );
|
const layout layout_16m14m (0x40400000, 0x411FA000, 0x100, 0x2000 );
|
||||||
const layout layout_16m15m (0x40300000, 0x411FA000, 0x100, 0x2000 );
|
const layout layout_16m15m (0x40300000, 0x411FA000, 0x100, 0x2000 );
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FSTools::FSTools()
|
FSTools::FSTools()
|
||||||
@ -60,7 +61,7 @@ bool FSTools::attemptToMountFS(fs::FS & fs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FSTools::mountAlternativeFS( FST::FS_t type, const FST::layout layout, bool keepMounted )
|
bool FSTools::mountAlternativeFS( FST::FS_t type, const FST::layout & layout, bool keepMounted )
|
||||||
{
|
{
|
||||||
FSConfig * pCfg{nullptr};
|
FSConfig * pCfg{nullptr};
|
||||||
LittleFSConfig littleFSCfg(false);
|
LittleFSConfig littleFSCfg(false);
|
||||||
@ -123,12 +124,12 @@ bool FSTools::moveFS(fs::FS & destinationFS)
|
|||||||
//uint32_t endSector = (uint32_t)&_FS_start - FST::lowestSPIFFSstartAddr;
|
//uint32_t endSector = (uint32_t)&_FS_start - FST::lowestSPIFFSstartAddr;
|
||||||
uint32_t lowestFSStart = 0x40300000;
|
uint32_t lowestFSStart = 0x40300000;
|
||||||
|
|
||||||
if (_layout) {
|
if (_layout) {
|
||||||
lowestFSStart = _layout->startAddr;
|
lowestFSStart = _layout->startAddr;
|
||||||
}
|
//Serial.printf("** _layout->startADDR = 0x%08x\n", _layout->startAddr );
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t endSector = lowestFSStart - 0x40200000;
|
uint32_t endSector = lowestFSStart - 0x40200000;
|
||||||
|
|
||||||
uint32_t tempFSsize = endSector - startSector;
|
uint32_t tempFSsize = endSector - startSector;
|
||||||
|
|
||||||
//Serial.printf("TempFS: start: %u, end: %u, size: %u, sketchSize = %u, _FS_start = %u\n", startSector, endSector, tempFSsize, ESP.getSketchSize(), (uint32_t)&_FS_start );
|
//Serial.printf("TempFS: start: %u, end: %u, size: %u, sketchSize = %u, _FS_start = %u\n", startSector, endSector, tempFSsize, ESP.getSketchSize(), (uint32_t)&_FS_start );
|
||||||
@ -183,7 +184,6 @@ void FSTools::fileListIterator(FS & fs, const char * dirName, FST::FileCb Cb )
|
|||||||
{
|
{
|
||||||
Dir dir = fs.openDir(dirName);
|
Dir dir = fs.openDir(dirName);
|
||||||
while (dir.next()) {
|
while (dir.next()) {
|
||||||
//const char * fileName = dir.fileName();
|
|
||||||
if (dir.isFile()) {
|
if (dir.isFile()) {
|
||||||
File f = dir.openFile("r");
|
File f = dir.openFile("r");
|
||||||
if (Cb) {
|
if (Cb) {
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
FSTools();
|
FSTools();
|
||||||
~FSTools();
|
~FSTools();
|
||||||
bool attemptToMountFS(fs::FS & fs);
|
bool attemptToMountFS(fs::FS & fs);
|
||||||
bool mountAlternativeFS( FST::FS_t type, const FST::layout layout, bool keepMounted = false );
|
bool mountAlternativeFS( FST::FS_t type, const FST::layout & layout, bool keepMounted = false );
|
||||||
bool mounted();
|
bool mounted();
|
||||||
bool moveFS(fs::FS & destinationFS);
|
bool moveFS(fs::FS & destinationFS);
|
||||||
void reset();
|
void reset();
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "FSTools",
|
"name": "FSTools",
|
||||||
"keywords": "SPIFFS LittleFS",
|
"keywords": "SPIFFS LittleFS",
|
||||||
"description": "A library that manages convertion between SPIFFS and LITTLEFS as well as mounting partitions outside of sketch default.",
|
"description": "A library that manages convertion between SPIFFS and LITTLEFS as well as mounting partitions outside of sketch default.",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"author": "sticilface",
|
"author": "sticilface",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"frameworks": "arduino",
|
"frameworks": "arduino",
|
||||||
"platforms": "esp8266"
|
"platforms": "esp8266"
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user