mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-30 21:12:55 +08:00
46ea2aa42e
AFAIK no one uses the wifi.startsmart() and wifi.stopsmart(). Removing them frees up an extra 20-25K of Flash to use as filesystem. So I have added a new config define WIFI_SMART_ENABLE which is enabled by default so the default functionality is the same, but if this is commented out then this code is omitted. I have also removed wofs and upgrade from this build as we no longer support these.
29 lines
667 B
C
29 lines
667 B
C
#include "flash_fs.h"
|
|
#include "c_string.h"
|
|
|
|
#include "spiffs.h"
|
|
|
|
int fs_mode2flag(const char *mode){
|
|
if(c_strlen(mode)==1){
|
|
if(c_strcmp(mode,"w")==0)
|
|
return FS_WRONLY|FS_CREAT|FS_TRUNC;
|
|
else if(c_strcmp(mode, "r")==0)
|
|
return FS_RDONLY;
|
|
else if(c_strcmp(mode, "a")==0)
|
|
return FS_WRONLY|FS_CREAT|FS_APPEND;
|
|
else
|
|
return FS_RDONLY;
|
|
} else if (c_strlen(mode)==2){
|
|
if(c_strcmp(mode,"r+")==0)
|
|
return FS_RDWR;
|
|
else if(c_strcmp(mode, "w+")==0)
|
|
return FS_RDWR|FS_CREAT|FS_TRUNC;
|
|
else if(c_strcmp(mode, "a+")==0)
|
|
return FS_RDWR|FS_CREAT|FS_APPEND;
|
|
else
|
|
return FS_RDONLY;
|
|
} else {
|
|
return FS_RDONLY;
|
|
}
|
|
}
|