Skip to content

Commit

Permalink
Support for board without SD_DETECT_PIN (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv96 authored Jan 10, 2021
1 parent 19c7892 commit 2e4fe4a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Marlin/src/lcd/extui/lib/dgus_reloaded/DGUSRxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,22 @@
void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
const DGUS_Screen screen = (DGUS_Screen)((uint8_t*)data_ptr)[1];

if (vp.addr == DGUS_Addr::SCREENCHANGE_SD
if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) {
#if ENABLED(SDSUPPORT)
&& !ExtUI::isMediaInserted()
#if !PIN_EXISTS(SD_DETECT)
card.mount();
#endif

if (!ExtUI::isMediaInserted()) {
dgus_screen_handler.SetStatusMessagePGM(GET_TEXT(MSG_NO_MEDIA));
return;
}

card.cdroot();
#else
dgus_screen_handler.SetStatusMessagePGM(GET_TEXT(MSG_NO_MEDIA));
return;
#endif
) {
dgus_screen_handler.SetStatusMessagePGM(GET_TEXT(MSG_NO_MEDIA));
return;
}

if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle
Expand Down

0 comments on commit 2e4fe4a

Please sign in to comment.