-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
No SD_CHECK_AND_RETRY with USE_USB_COMPOSITE (STM32F103 + SDIO) #18108
No SD_CHECK_AND_RETRY with USE_USB_COMPOSITE (STM32F103 + SDIO) #18108
Conversation
I personally like compiler errors when incompatible options are used, so people know a feature isn’t going to work as expected. |
Marlin has gone both ways on the decision of compiler error vs. change code. Scott will let us know which way he wants it. In this instance I don't have a strong opinion either way. FYI - the functionality of SD_CHECK_AND_RETRY is already in the code enabled by USE_USB_COMPOSITE. |
True, we have a few different approaches on the menu…
In this case the option is sort-of N/A so silently disabling One other consideration is whether the chosen approach helps in "the Marlin encyclopedia project," where we treat Marlin as a "reference guide" to document the relationship between all these chips, their pins, common peripherals, libraries, and custom software routines all in one codebase. Considering that aspect it's better to have these kinds of checks in the 'Conditional' files — either the global one or just the affected HALs'. |
…inFirmware#18108) * disable SD_CHECK_AND_RETRY when USE_USB_COMPOSITE is enabled * Update Sd2Card.cpp * Disable SD_CHECK_AND_RETRY with USE_USB_COMPOSITE Co-authored-by: Scott Lahteine <[email protected]> Co-authored-by: Scott Lahteine <[email protected]>
…inFirmware#18108) * disable SD_CHECK_AND_RETRY when USE_USB_COMPOSITE is enabled * Update Sd2Card.cpp * Disable SD_CHECK_AND_RETRY with USE_USB_COMPOSITE Co-authored-by: Scott Lahteine <[email protected]> Co-authored-by: Scott Lahteine <[email protected]>
…inFirmware#18108) * disable SD_CHECK_AND_RETRY when USE_USB_COMPOSITE is enabled * Update Sd2Card.cpp * Disable SD_CHECK_AND_RETRY with USE_USB_COMPOSITE Co-authored-by: Scott Lahteine <[email protected]> Co-authored-by: Scott Lahteine <[email protected]>
SD_CHECK_AND_RETRY is not compatible with USE_USB_COMPOSITE. The resulting virtual drive causes error popups on the PC and is eventually disabled by the PC.
This fixes Issue #18097.
The proposed change is to append !ENABLED(USE_USB_COMPOSITE) to #if ENABLED(SD_CHECK_AND_RETRY) in Sd2Card.cpp.
The only other effective change I found was adding a check to SanityCheck.h.
Adding a
#undef SD_CHECK_AND_RETRY
to the pins_YOUR_BOARD.h files or to sdio.cpp did not work.USE_USB_COMPOSITE is only available in the following environments:
These are used only with the following boards: