-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
SDIO storage Read/write, M21, and print from media menu selectable access #25683
Open
ansonl
wants to merge
26
commits into
MarlinFirmware:bugfix-2.1.x
Choose a base branch
from
ansonl:sdio-support
base: bugfix-2.1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+83
−20
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
152c3c6
Update SdVolume.h
ansonl 173c007
Update Conditionals_post.h
ansonl 7fda542
Update cardreader.h
ansonl 8f41dcf
Update cardreader.cpp
ansonl 7a40ece
Update language_en.h
ansonl a5f50bd
Update menu_media.cpp
ansonl 7978fc7
Update Configuration.h
ansonl 0146597
Update Configuration_adv.h
ansonl 20d800f
Update cardreader.h
ansonl b9a919c
Update M21_M22.cpp
ansonl 71aed05
already defined in configuration_adv.h
thinkyhead 64f6773
Tweaks to M21
thinkyhead 7cdecba
shared lambda
thinkyhead baf4fbe
DEFAULT_VOLUME is obsolete
thinkyhead b9e9627
Merge branch 'MarlinFirmware:bugfix-2.1.x' into sdio-support
ansonl 14da059
Refactor code for user friendly onboard SD label
ansonl 79cb734
Add external SD card label option
ansonl 51e9ee3
Update Configuration.h
ansonl 7a2bd81
Update Configuration_adv.h
ansonl 42be78d
Update Conditionals_post.h
ansonl 7ce7d97
Update cardreader.h
ansonl f4160ec
cleanup
thinkyhead b806822
Merge branch 'MarlinFirmware:bugfix-2.1.x' into sdio-support
ansonl 16da160
Merge branch 'bugfix-2.1.x' into pr/25683
thinkyhead 4eaab03
Merge branch 'bugfix-2.1.x' into pr/25683
thinkyhead 852fd6f
Merge branch 'bugfix-2.1.x' into pr/25683
thinkyhead File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update Conditionals_post.h
Try to fix CI error
- Loading branch information
commit 42be78dd4c12a9083c31be6acf81cf3dfc5868ab
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
SDSUPPORT
option is used as the flag for any and all media types, not just SD Cards. IfSDSUPPORT
is not enabled, none of the file access code (e.g.,cardreader.cpp
) will be compiled in. So the code needs to be reworked a lot more if the intent is to makeSDSUPPORT
only refer to SPI-based SD cards.Since it is possible to have both onboard and external media drives, we would also need to rework the code to remove the assumption that there is only one SD card, either
ONBOARD
,LCD
, orCUSTOM_CABLE
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have
SD_SPI_STORAGE
,SD_SDIO_STORAGE
, andUSBFLASH_STORAGE
options underneath that requiresSDSUPPORT
to be defined. I see that there are currently 3media_driver_X
types implemented:media_driver_usbFlash
(USB)media_driver_sdcard
(SPI)media_driver_sdiocard
(SDIO)Even though the location of the SD slots may be onboard or on LCD to the user, the access method for the SD slots can vary between all three methods no matter where the slots physically are. There is a maximum of one SD slot connected for each
media_driver_X
type, I thinkThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current assumptions are probably a little constrained. As I've been working on separating out the LCD pins in another PR I've become better acquainted with the way that SD Card pins are allocated, either with or without an LCD controller. Here we have a number of different possibilities.
Right now pins files tend to follow the configuration of the original machine they came with, so if there is an LCD Controller with an SD Card drive, the pins file assumes that the presence of an LCD indicates the use of the SD Card drive on the LCD. Most pins files allow that to be overridden.
The "Custom Cable" option for SD Card drives is handled by very few pins files, and it could be better. If you define your own SPI pins (with
SD_
prefix) and useCUSTOM_CABLE
then pins files should allow it, but the logic is not there.There is a lot of overlap between the allocation of pins for the LCD and SD, so it might be good to tackle these two problems at the same time or in a similar manner. See #25650 for that little project, which is coming along slowly but steadily. There I'm trying to weed out assumptions about whether Software or Hardware SPI is used, but also trying to see if that can be based on the chosen pins. i.e., If the pins are not the standard SPI0, SPI1, etc., then we can assume Software-based SPI for that drive.