From fdab70fa3a2627173f9e60159db3c86d12e01a9b Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Fri, 22 Nov 2019 14:39:21 +0200 Subject: [PATCH] Dir fixes --- Firmware/cardreader.cpp | 1 + Firmware/ultralcd.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index 3c01bf84..7d64286e 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -960,6 +960,7 @@ void CardReader::presort() { lcd_set_degree(); lcd_clear(); #endif + lcd_scrollTimer.start(); lcd_update(2); KEEPALIVE_STATE(NOT_BUSY); lcd_timeoutToStatus.start(); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ab7e3830..c4bbb94c 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -337,12 +337,13 @@ static void lcd_filename_scroll() //this is a submenu } if(lcd_scrollTimer.expired(200) && (scrollPointer != NULL)) { - uint8_t i = LCD_WIDTH - 1; + uint8_t i = LCD_WIDTH - ((_md->isDir)?2:1); lcd_set_cursor(0, _md->row); lcd_print('>'); + if (_md->isDir) lcd_print(LCD_STR_FOLDER[0]); for (; i != 0; i--) { - char c = *(scrollPointer + ((LCD_WIDTH - 1) - i)); + char c = *(scrollPointer + ((LCD_WIDTH - ((_md->isDir)?2:1)) - i)); if (c == '\0') { scrollPointer = NULL; //invalidate string @@ -414,7 +415,7 @@ uint8_t menu_item_sddir(const char* str_fn, char* str_fnl) _md->isDir = 1; _md->row = menu_row; menu_submenu_scroll(lcd_filename_scroll); - return 1; + return 1; //stop menu generation early } else lcd_implementation_drawmenu_sddirectory(menu_row, scrollPointer); } @@ -424,7 +425,7 @@ uint8_t menu_item_sddir(const char* str_fn, char* str_fnl) lcd_update_enabled = 0; menu_action_sddirectory(str_fn); lcd_update_enabled = 1; - // return menu_item_ret(); + /* return */ menu_item_ret(); return 1; } } @@ -454,7 +455,7 @@ static uint8_t menu_item_sdfile(const char* str_fn, char* str_fnl) { lcd_consume_click(); menu_action_sdfile(str_fn); - // return menu_item_ret(); + /* return */ menu_item_ret(); return 1; } }