Skip to content

Commit

Permalink
Fix: USB Power Loss Recovery Check
Browse files Browse the repository at this point in the history
  • Loading branch information
robbycandra committed Apr 10, 2022
1 parent cec7836 commit 4bc38d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ void CardReader::manage_media() {
if (ui.detected()) {

uint8_t old_stat = prev_stat;
prev_stat = stat; // Change now to prevent re-entry

if (stat) { // Media Inserted
safe_delay(500); // Some boards need a delay to get settled
Expand All @@ -500,6 +499,9 @@ void CardReader::manage_media() {
#endif
}

if (stat == 0 && prev_stat == 2) return;
prev_stat = stat; // Change now to prevent re-entry

ui.media_changed(old_stat, stat); // Update the UI

if (stat) {
Expand Down

0 comments on commit 4bc38d9

Please sign in to comment.