Desuuuu / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform. Modified with a new DWIN T5UID1 touchscreen implementation.
GNU General Public License v3.0
31 stars 10 forks source link

Release SD card when not used #20

Closed mrv96 closed 2 years ago

mrv96 commented 3 years ago

Description

In PR https://github.com/Desuuuu/Marlin/pull/14, we have added the support for boards without SD_DETECT_PIN. This pin can be present but not used in this situation: https://github.com/MarlinFirmware/Marlin/blob/5ee1087959f88dc60386ff3caa21e75d9e20b128/Marlin/src/inc/Conditionals_post.h#L362-L370

When the SD card is shared with a PC exploiting native USB connection, this portion of code is enabled: https://github.com/MarlinFirmware/Marlin/blob/5ee1087959f88dc60386ff3caa21e75d9e20b128/Marlin/src/HAL/LPC1768/main.cpp#L143-L155

If i understood well, if we never release the SD card, once it is mounted, it becomes no longer accessible by the connected PC.

Benefits

This PR aims to avoid this inconvenience.

I'll wait for feedback