witnessmenow / ESP32-Cheap-Yellow-Display

Building a community around a cheap ESP32 Display with a touch screen
MIT License
1.31k stars 130 forks source link

Error in SD test program #56

Closed craiglindley closed 7 months ago

craiglindley commented 8 months ago

In the listDir function you have a line

File file = root.openNextFile(); while (file) { if (file.isDirectory()) { Serial.print(" DIR : "); Serial.println(file.name()); if (levels) { listDir(fs, file.name(), levels - 1); <-- } } else { Serial.print(" FILE: "); Serial.print(file.name()); Serial.print(" SIZE: "); Serial.println(file.size()); } file = root.openNextFile(); } It should be:

listDir(fs, file.path(), levels - 1); <-- This will allow the listDir function to run recursively