|
|
@ -125,8 +125,8 @@ EspFsFile ICACHE_FLASH_ATTR *espFsOpen(char *fileName) { |
|
|
|
//Grab the name of the file.
|
|
|
|
//Grab the name of the file.
|
|
|
|
p+=sizeof(EspFsHeader);
|
|
|
|
p+=sizeof(EspFsHeader);
|
|
|
|
os_memcpy(namebuf, p, sizeof(namebuf)); |
|
|
|
os_memcpy(namebuf, p, sizeof(namebuf)); |
|
|
|
os_printf("Found file '%s'. Namelen=%x fileLenComp=%x, compr=%d flags=%d\n",
|
|
|
|
// os_printf("Found file '%s'. Namelen=%x fileLenComp=%x, compr=%d flags=%d\n",
|
|
|
|
namebuf, (unsigned int)h.nameLen, (unsigned int)h.fileLenComp, h.compression, h.flags); |
|
|
|
// namebuf, (unsigned int)h.nameLen, (unsigned int)h.fileLenComp, h.compression, h.flags);
|
|
|
|
if (os_strcmp(namebuf, fileName)==0) { |
|
|
|
if (os_strcmp(namebuf, fileName)==0) { |
|
|
|
//Yay, this is the file we need!
|
|
|
|
//Yay, this is the file we need!
|
|
|
|
p+=h.nameLen; //Skip to content.
|
|
|
|
p+=h.nameLen; //Skip to content.
|
|
|
@ -174,7 +174,7 @@ int ICACHE_FLASH_ATTR espFsRead(EspFsFile *fh, char *buff, int len) { |
|
|
|
int toRead; |
|
|
|
int toRead; |
|
|
|
toRead=flen-(fh->posComp-fh->posStart); |
|
|
|
toRead=flen-(fh->posComp-fh->posStart); |
|
|
|
if (len>toRead) len=toRead; |
|
|
|
if (len>toRead) len=toRead; |
|
|
|
os_printf("Reading %d bytes from %x\n", len, (unsigned int)fh->posComp); |
|
|
|
// os_printf("Reading %d bytes from %x\n", len, (unsigned int)fh->posComp);
|
|
|
|
memcpyAligned(buff, fh->posComp, len); |
|
|
|
memcpyAligned(buff, fh->posComp, len); |
|
|
|
fh->posDecomp+=len; |
|
|
|
fh->posDecomp+=len; |
|
|
|
fh->posComp+=len; |
|
|
|
fh->posComp+=len; |
|
|
|