Skip to content

Commit

Permalink
🩹 Fix card.ls call (in easythreed_ui)
Browse files Browse the repository at this point in the history
Fix regression in MarlinFirmware#24679
  • Loading branch information
thinkyhead authored and Tracy Spiva committed May 25, 2023
1 parent d78a146 commit f5636c9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/sd/SdBaseFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,12 @@ void SdBaseFile::getpos(filepos_t * const pos) {
* \param[in] indent Amount of space before file name. Used for recursive
* 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();
int8_t status;
while ((status = lsPrintNext(flags, indent))) {
if (status > 1 && (flags & LS_R)) {
uint16_t index = curPosition() / 32 - 1;
const uint16_t index = curPosition() / 32 - 1;
SdBaseFile s;
if (s.open(this, index, O_READ)) s.ls(flags, indent + 2);
seekSet(32 * (index + 1));
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/SdBaseFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class SdBaseFile {
bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; }

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 open(SdBaseFile * const dirFile, uint16_t index, const uint8_t oflag);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void CardReader::printListing(MediaFile parent, const char * const prepend, cons
//
// 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) {
root.rewind();
printListing(root, nullptr, lsflags);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/cardreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class CardReader {
}
#endif

static void ls(const uint8_t lsflags);
static void ls(const uint8_t lsflags=0);

#if ENABLED(POWER_LOSS_RECOVERY)
static bool jobRecoverFileExists();
Expand Down

0 comments on commit f5636c9

Please sign in to comment.