MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / selectNewestFile

Method selectNewestFile

Marlin/src/sd/cardreader.cpp:1075–1091  ·  view source on GitHub ↗

* Recurse the entire directory to find the newest file. * Make the found file the current selection. */

Source from the content-addressed store, hash-verified

1073 * Make the found file the current selection.
1074 */
1075 bool CardReader::selectNewestFile() {
1076 uint32_t dateTimeStorage = 0;
1077 MediaFile foundDir;
1078 char foundName[FILENAME_LENGTH];
1079 foundName[0] = '\0';
1080
1081 diveToNewestFile(root, dateTimeStorage, foundDir, foundName);
1082
1083 if (foundName[0]) {
1084 workDir = foundDir;
1085 workDir.rewind();
1086 selectByName(workDir, foundName);
1087 //workDir.close(); // Not needed?
1088 return true;
1089 }
1090 return false;
1091 }
1092
1093#endif // ONE_CLICK_PRINT
1094

Callers

nothing calls this directly

Calls 1

rewindMethod · 0.45

Tested by

no test coverage detected