Fix issue with invalid user file system

pull/193/head
Karai Csaba 9 years ago committed by Thorsten von Eicken
parent ec7d79e458
commit ad34095bfa
  1. 10
      web-server/web-server.c

@ -15,9 +15,10 @@ void ICACHE_FLASH_ATTR webServerBrowseFiles()
char buffer[1024]; char buffer[1024];
buffer[0] = 0; buffer[0] = 0;
EspFsIterator it; if( espFsIsValid( userPageCtx ) )
espFsIteratorInit(userPageCtx, &it);
{ {
EspFsIterator it;
espFsIteratorInit(userPageCtx, &it);
while( espFsIteratorNext(&it) ) while( espFsIteratorNext(&it) )
{ {
int nlen = strlen(it.name); int nlen = strlen(it.name);
@ -65,11 +66,10 @@ void ICACHE_FLASH_ATTR webServerBrowseFiles()
void ICACHE_FLASH_ATTR webServerInit() void ICACHE_FLASH_ATTR webServerInit()
{ {
espFsInit(userPageCtx, (void *)getUserPageSectionStart(), ESPFS_FLASH); espFsInit(userPageCtx, (void *)getUserPageSectionStart(), ESPFS_FLASH);
if( espFsIsValid( userPageCtx ) ) { if( espFsIsValid( userPageCtx ) )
os_printf("Valid user file system found!\n"); os_printf("Valid user file system found!\n");
webServerBrowseFiles();
}
else else
os_printf("No user file system found!\n"); os_printf("No user file system found!\n");
webServerBrowseFiles();
} }

Loading…
Cancel
Save