0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-31 14:12:52 +00:00

🩹 Fix card.ls call (in easythreed_ui)

Fix regression in #24679
This commit is contained in:
Scott Lahteine 2023-05-24 21:22:54 -05:00
parent e2a7249907
commit 1a4e208c69
4 changed files with 5 additions and 5 deletions

View file

@ -322,12 +322,12 @@ void SdBaseFile::getpos(filepos_t * const pos) {
* \param[in] indent Amount of space before file name. Used for recursive * \param[in] indent Amount of space before file name. Used for recursive
* list to indicate subdirectory level. * list to indicate subdirectory level.
*/ */
void SdBaseFile::ls(uint8_t flags, uint8_t indent) { void SdBaseFile::ls(const uint8_t flags/*=0*/, const uint8_t indent/*=0*/) {
rewind(); rewind();
int8_t status; int8_t status;
while ((status = lsPrintNext(flags, indent))) { while ((status = lsPrintNext(flags, indent))) {
if (status > 1 && (flags & LS_R)) { if (status > 1 && (flags & LS_R)) {
uint16_t index = curPosition() / 32 - 1; const uint16_t index = curPosition() / 32 - 1;
SdBaseFile s; SdBaseFile s;
if (s.open(this, index, O_READ)) s.ls(flags, indent + 2); if (s.open(this, index, O_READ)) s.ls(flags, indent + 2);
seekSet(32 * (index + 1)); seekSet(32 * (index + 1));

View file

@ -283,7 +283,7 @@ class SdBaseFile {
bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; }
bool getDosName(char * const name); bool getDosName(char * const name);
void ls(uint8_t flags=0, uint8_t indent=0); void ls(const uint8_t flags=0, const uint8_t indent=0);
bool mkdir(SdBaseFile *parent, const char *path, const bool pFlag=true); bool mkdir(SdBaseFile *parent, const char *path, const bool pFlag=true);
bool open(SdBaseFile * const dirFile, uint16_t index, const uint8_t oflag); bool open(SdBaseFile * const dirFile, uint16_t index, const uint8_t oflag);

View file

@ -353,7 +353,7 @@ void CardReader::printListing(MediaFile parent, const char * const prepend, cons
// //
// List all files on the SD card // List all files on the SD card
// //
void CardReader::ls(const uint8_t lsflags) { void CardReader::ls(const uint8_t lsflags/*=0*/) {
if (flag.mounted) { if (flag.mounted) {
root.rewind(); root.rewind();
printListing(root, nullptr, lsflags); printListing(root, nullptr, lsflags);

View file

@ -209,7 +209,7 @@ public:
} }
#endif #endif
static void ls(const uint8_t lsflags); static void ls(const uint8_t lsflags=0);
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
static bool jobRecoverFileExists(); static bool jobRecoverFileExists();