Skip to content

Commit 5e62ef5

Browse files
author
David Betz
committed
Move the flash filesystem for 1MB modules lower so it will also work
with 512K modules.
1 parent 3c46e0b commit 5e62ef5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

parallax/roffs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Connector to let httpd use the espfs filesystem to serve the files in it.
3030
#include "roffsformat.h"
3131

3232
// default filesystem base address in flash
33-
#define FLASH_FILESYSTEM_BASE_1M (1024*1024 - 128*1024)
33+
#define FLASH_FILESYSTEM_BASE_1M (512*1024 - 128*1024)
3434
#define FLASH_FILESYSTEM_BASE_2M (1024*1024)
3535

3636
// open file structure
@@ -74,8 +74,8 @@ int ICACHE_FLASH_ATTR roffs_mount(uint32_t flashAddress)
7474
{
7575
RoFsHeader testHeader;
7676

77-
// base address must be aligned to 4 bytes
78-
if ((flashAddress & 3) != 0)
77+
// base address must be non-zero and aligned to 4 bytes
78+
if (flashAddress == 0 || (flashAddress & 3) != 0)
7979
return -1;
8080

8181
// get and display the flash ID
@@ -90,6 +90,7 @@ int ICACHE_FLASH_ATTR roffs_mount(uint32_t flashAddress)
9090
return -3;
9191

9292
// filesystem is mounted successfully
93+
os_printf("mount: flash filesystem mounted at %08x\n", flashAddress);
9394
fsData = flashAddress;
9495
return 0;
9596
}

0 commit comments

Comments
 (0)