Fix "sorting files" messages for both ShellSort and BubbleSort

This commit is contained in:
Alex Voinea 2021-02-04 15:44:15 +02:00
parent 279c0aaa21
commit df163066fb

View File

@ -883,6 +883,9 @@ void CardReader::presort() {
#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1)) #define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1))
#endif #endif
lcd_set_cursor(0, 1);
lcd_printf_P(PSTR("%-20.20S"), _i("Sorting files"));
for (uint16_t i = fileCnt; --i;) { for (uint16_t i = fileCnt; --i;) {
if (!IS_SD_INSERTED) return; if (!IS_SD_INSERTED) return;
bool didSwap = false; bool didSwap = false;
@ -936,6 +939,11 @@ void CardReader::presort() {
if (!didSwap) break; if (!didSwap) break;
} //end of bubble sort loop } //end of bubble sort loop
#endif #endif
lcd_set_cursor(0, 2);
for (int column = 0; column <= 19; column++)
lcd_print('\xFF'); //simple progress bar
_delay(300);
lcd_clear();
} }
else { else {
sort_order[0] = 0; sort_order[0] = 0;
@ -944,11 +952,6 @@ void CardReader::presort() {
sort_count = fileCnt; sort_count = fileCnt;
} }
lcd_set_cursor(0, 2);
for (int column = 0; column <= 19; column++) lcd_print('\xFF'); //simple progress bar
_delay(300);
lcd_clear();
lcd_update(2); lcd_update(2);
KEEPALIVE_STATE(NOT_BUSY); KEEPALIVE_STATE(NOT_BUSY);
lcd_timeoutToStatus.start(); lcd_timeoutToStatus.start();