Merge pull request #254 from PavelSindler/sort_dir_fix
removing SD during sorting fixed
This commit is contained in:
commit
1b69a3f9be
|
|
@ -834,6 +834,7 @@ void CardReader::presort() {
|
|||
if (fileCnt > 1) {
|
||||
// Init sort order.
|
||||
for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
if (!IS_SD_INSERTED) return;
|
||||
manage_heater();
|
||||
sort_order[i] = i;
|
||||
|
||||
|
|
@ -909,6 +910,8 @@ void CardReader::presort() {
|
|||
#endif
|
||||
|
||||
for (uint16_t i = fileCnt; --i;) {
|
||||
if (!IS_SD_INSERTED) return;
|
||||
|
||||
bool didSwap = false;
|
||||
#if !SDSORT_USES_RAM //show progresss bar only if slow sorting method is used
|
||||
int8_t percent = (counter * 100) / total;//((counter * 100) / pow((fileCnt-1),2));
|
||||
|
|
@ -920,6 +923,7 @@ void CardReader::presort() {
|
|||
|
||||
//MYSERIAL.println(int(i));
|
||||
for (uint16_t j = 0; j < i; ++j) {
|
||||
if (!IS_SD_INSERTED) return;
|
||||
manage_heater();
|
||||
const uint16_t o1 = sort_order[j], o2 = sort_order[j + 1];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue