Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
313 stars 199 forks source link

sdcard: sd card detect #173

Open jgrjgr opened 9 years ago

jgrjgr commented 9 years ago

can we setup the sd card detect pin to automatically mount the card when one is detected, it would be usefull when running in a standalone mode when you can't send mcodes because the pc isn't connected to theboard

Traumflug commented 9 years ago

The original Petit FatFs code checks for presence of a card 1000(!) times a second. That's certainly too much.

A reasonable solution might be to try mounting the card on a read attempt, if its not yet mounted. Might even make M21 obsolete. Possibly also the opposite, to unmount the card on read failures, making M22 obsolete.