From b485992c9ed45bfe7ab176be7301d1904c24afca Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Tue, 18 Oct 2022 17:29:31 +0200 Subject: [PATCH] If in farm mode, force the sorting direction to be reversed So in an ideal scenario, the newest file is first. This of course breaks as soon as a file is deleted/renamed/moved, but it should at least be fixed now compared to before where the direction could be influenced by a disabled setting --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 53bf4fc79..fb926fe89 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6001,7 +6001,7 @@ void lcd_sdcard_menu() lcd_update_enabled = true; } _md->fileCnt = card.getnrfilenames(); - _md->sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); + _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); _md->menuState = _standard; _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. }