提交 17a1a240 编写于 作者: M me-no-dev

fix SPIFFS example

上级 d208a368
......@@ -36,7 +36,7 @@ void readFile(fs::FS &fs, const char * path){
Serial.printf("Reading file: %s\n", path);
File file = fs.open(path);
if(!file){
if(!file || file.isDirectory()){
Serial.println("Failed to open file for reading");
return;
}
......@@ -101,7 +101,7 @@ void testFileIO(fs::FS &fs, const char * path){
size_t len = 0;
uint32_t start = millis();
uint32_t end = start;
if(file){
if(file && !file.isDirectory()){
len = file.size();
size_t flen = len;
start = millis();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册