✨ M21 P / S / U - Select Volume (#23780)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
Scott Lahteine
parent
39001bd8d2
commit
feafb7d49a
@ -29,8 +29,21 @@
|
||||
|
||||
/**
|
||||
* M21: Init SD Card
|
||||
*
|
||||
* With MULTI_VOLUME:
|
||||
* P0 or S - Change to the SD Card and mount it
|
||||
* P1 or U - Change to the USB Drive and mount it
|
||||
*/
|
||||
void GcodeSuite::M21() { card.mount(); }
|
||||
void GcodeSuite::M21() {
|
||||
#if ENABLED(MULTI_VOLUME)
|
||||
const int8_t vol = parser.intval('P', -1);
|
||||
if (vol == 0 || parser.seen_test('S')) // "S" for SD Card
|
||||
card.changeMedia(&card.media_driver_sdcard);
|
||||
else if (vol == 1 || parser.seen_test('U')) // "U" for USB
|
||||
card.changeMedia(&card.media_driver_usbFlash);
|
||||
#endif
|
||||
card.mount();
|
||||
}
|
||||
|
||||
/**
|
||||
* M22: Release SD Card
|
||||
|
Reference in New Issue
Block a user