Skip to content

Commit 1c481d2

Browse files
fix: M20 F: list binary files without ProUI
This addresses MarlinFirmware#24332. Likely MarlinFirmware#23878 introduced a change, where M20 F listed binary only when DO_LIST_BIN_FILES was set, which in turn was only set indirectly by DWIN_LCD_PROUI. This fix re-enables listing ".BIN"-files when CUSTOM_FIRMWARE_UPLOAD is configured, as documented for M20. ".BIN" files are only listed for M20 F, not in the UI on the printer. Signed-off-by: Hannes Weisbach <[email protected]>
1 parent 66474f6 commit 1c481d2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Marlin/src/sd/cardreader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD,
224224
) return false;
225225

226226
flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder
227-
setBinFlag(extIsBIN((char *)&p.name[8])); // List .bin files (a firmware file for flashing)
227+
setBinFlag(onlyBin && extIsBIN((char *)&p.name[8])); // List .bin files (a firmware file for flashing)
228228

229229
return (
230230
flag.filenameIsDir // All Directories are ok

Marlin/src/sd/cardreader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ class CardReader {
300300
#endif
301301

302302
// Binary flag for the current file
303-
static bool fileIsBinary() { return TERN0(DO_LIST_BIN_FILES, flag.filenameIsBin); }
304-
static void setBinFlag(const bool bin) { TERN(DO_LIST_BIN_FILES, flag.filenameIsBin = bin, UNUSED(bin)); }
303+
static bool fileIsBinary() { return TERN0(DO_LIST_BIN_FILES || ENABLED(CUSTOM_FIRMWARE_UPLOAD), flag.filenameIsBin); }
304+
static void setBinFlag(const bool bin) { TERN(DO_LIST_BIN_FILES || ENABLED(CUSTOM_FIRMWARE_UPLOAD), flag.filenameIsBin = bin, UNUSED(bin)); }
305305

306306
// Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...)
307307
static char* getWorkDirName() { workDir.getDosName(filename); return filename; }

0 commit comments

Comments
 (0)