Improve USB Media Host conditions (#20176)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Victor Oliveira
2020-11-18 02:48:14 -03:00
committed by GitHub
parent c1920f31ca
commit f1cdd02d4c
11 changed files with 40 additions and 32 deletions

View File

@ -20,3 +20,7 @@
*
*/
#pragma once
#if DISABLED(NO_SD_HOST_DRIVE)
#define HAS_SD_HOST_DRIVE 1
#endif

View File

@ -122,7 +122,7 @@ void HAL_init() {
delay(1000); // Give OS time to notice
USB_Connect(TRUE);
#if DISABLED(NO_SD_HOST_DRIVE)
#if HAS_SD_HOST_DRIVE
MSC_SD_Init(0); // Enable USB SD card access
#endif
@ -140,7 +140,7 @@ void HAL_init() {
// HAL idle task
void HAL_idletask() {
#if HAS_SHARED_MEDIA
#if HAS_SD_HOST_DRIVE
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but