Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboard multi volume support #2418

Merged

Conversation

kisslorand
Copy link
Contributor

@kisslorand kisslorand commented Feb 21, 2022

Requirements

  • BTT or MKS TFT
  • motherboard with an USB storage port
  • Marlin (not older than 28.II.2022)

Description

This PR adds the ability to select USB media also from motherboards which are equipped with it

Benefits

Everyone using Marlin with motherboards that also have USB media storage port.

Related Issues

Fixes #2215

Notes

This PR is marked as draft because in Marlin there's no gcode for setting/switching the storage yet. However there's a pending PR for that on Marlin's Github repository (MarlinFirmware/Marlin#23780).
For those who still want to use this feature here's what is needed to be done in Marlin source code in order to be able to use this feature:

1. in "M21_M22.cpp" replace

void GcodeSuite::M21() { card.mount(); }

with

void GcodeSuite::M21()
{
  #if ENABLED(MULTI_VOLUME)
    if (parser.seen('S')) {  // "S" for SD Card
      card.changeMedia(&card.media_driver_sdcard);
    }
    else if (parser.seen('U')) {  // "U" for USB
      card.changeMedia(&card.media_driver_usbFlash);
    }
  #endif
  card.mount();
}

2. in "M155.cpp" after the lines

    // SDCARD (M20, M23, M24, etc.)
    cap_line(F("SDCARD"), ENABLED(SDSUPPORT));

add the folowing:

    // MULTI_VOLUME (M21 S/M21 U)
    #if ENABLED(SDSUPPORT)
      cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME));
    #endif

Enjoy !!!

L.E.: MarlinFirmware/Marlin#23780 has been merged so this PR is fully functional without any Marlin modification.

TFT/src/User/API/Gcode/gcode.c Outdated Show resolved Hide resolved
TFT/src/User/API/Language/language_jp.h Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@Guilouz
Copy link
Contributor

Guilouz commented Feb 26, 2022

Tested and working fine !

@kisslorand
Copy link
Contributor Author

Thank you for the feedback.

@kisslorand kisslorand marked this pull request as ready for review February 28, 2022 04:37
@kisslorand
Copy link
Contributor Author

@bigtreetech
MarlinFirmware/Marlin#23780 has been merged so this PR is fully functional without any Marlin modification, it can be merged.

@bigtreetech bigtreetech merged commit a9186f4 into bigtreetech:master Mar 9, 2022
mehmetsutas pushed a commit to mehmetsutas/BIGTREETECH-TouchScreenFirmware that referenced this pull request May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] MULTI_VOLUME for onboard SD & onboard USB Support
4 participants