From ba6659f6bebf51533aecd717be76f1bc2ccb3d08 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Tue, 8 Sep 2020 14:31:20 -0600 Subject: [PATCH] Fix ExtUI SD sorting, compile issues --- Marlin/src/HAL/STM32F1/MarlinSerial.cpp | 4 ++++ Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp | 2 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp index f965bc99c..61fde718b 100644 --- a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp @@ -20,6 +20,8 @@ * */ +#ifdef __STM32F1__ + #include "../../inc/MarlinConfigPre.h" #include "MarlinSerial.h" #include @@ -91,3 +93,5 @@ static inline __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb #if SERIAL_PORT == 5 || SERIAL_PORT_2 == 5 || DGUS_SERIAL_PORT == 5 DEFINE_HWSERIAL_UART_MARLIN(MSerial5, 5); #endif + +#endif // __STM32F1__ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp index e06f9f3a2..270ec5581 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -61,7 +61,7 @@ namespace ExtUI { if (AT_SCREEN(StatusScreen) || isPrintingFromMedia()) StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_REMOVED)); - if (AT_SCREEN(FilesScreen)) GOTO_SCREEN(StatusScreen) + if (AT_SCREEN(FilesScreen)) GOTO_SCREEN(StatusScreen); } void onMediaError() { diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 31449fcef..c40a86942 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1003,7 +1003,7 @@ namespace ExtUI { bool FileList::seek(const uint16_t pos, const bool skip_range_check) { #if ENABLED(SDSUPPORT) if (!skip_range_check && (pos + 1) > count()) return false; - card.getfilename_sorted(pos); + card.getfilename_sorted(SD_ORDER(pos, count())); return card.filename[0] != '\0'; #else UNUSED(pos);