fix espfs image alignment issue

platformio
Thorsten von Eicken 5 years ago
parent 011f095959
commit 63b7d4a5a9
No known key found for this signature in database
GPG Key ID: C7F972A59D834B46
  1. 4
      pio-genespfs.py
  2. 5
      src/main.c

@ -15,7 +15,9 @@ buf = BytesIO()
espfsimg = mkespfs(dir, buf) espfsimg = mkespfs(dir, buf)
fd = Path(espfile).open(mode='w') fd = Path(espfile).open(mode='w')
fd.write("unsigned char espfs_image[] __attribute__((section(\".irom.text\"))) = {"); fd.write("unsigned char espfs_image[] ");
fd.write("__attribute__((aligned(4))) ");
fd.write("__attribute__((section(\".irom.text\"))) = {");
for i, b in enumerate(buf.getbuffer()): for i, b in enumerate(buf.getbuffer()):
if i%16 == 0: fd.write("\n") if i%16 == 0: fd.write("\n")
fd.write(" 0x{:02x},".format(b)) fd.write(" 0x{:02x},".format(b))

@ -185,10 +185,9 @@ user_init(void) {
// Wifi // Wifi
wifiInit(); wifiInit();
// init the flash filesystem with the html stuff // init the flash filesystem with the html stuff
espFsInit(espLinkCtx, espfs_image, ESPFS_MEMORY); EspFsInitResult res = espFsInit(espLinkCtx, espfs_image, ESPFS_MEMORY);
os_printf("espFsInit %s (%d)\n", res?"ERR":"ok", res);
//EspFsInitResult res = espFsInit(&_binary_espfs_img_start);
//os_printf("espFsInit %s\n", res?"ERR":"ok");
// mount the http handlers // mount the http handlers
httpdInit(builtInUrls, 80); httpdInit(builtInUrls, 80);
#ifdef WEBSERVER #ifdef WEBSERVER

Loading…
Cancel
Save