update code base to Marlin 2.0.9.2

This commit is contained in:
Stefan Kalscheuer
2021-10-03 18:57:12 +02:00
parent b9d7ba838e
commit 7077da3591
2617 changed files with 332093 additions and 103438 deletions

69
Marlin/src/lcd/menu/menu_media.cpp Executable file → Normal file
View File

@@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
@@ -26,9 +26,9 @@
#include "../../inc/MarlinConfigPre.h"
#if HAS_LCD_MENU && ENABLED(SDSUPPORT)
#if BOTH(HAS_LCD_MENU, SDSUPPORT)
#include "menu.h"
#include "menu_item.h"
#include "../../sd/cardreader.h"
void lcd_sd_updir() {
@@ -45,25 +45,12 @@ void lcd_sd_updir() {
void MarlinUI::reselect_last_file() {
if (sd_encoder_position == 0xFFFF) return;
//#if HAS_GRAPHICAL_LCD
// // This is a hack to force a screen update.
// ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
// ui.synchronize();
// safe_delay(50);
// ui.synchronize();
// ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
// ui.drawing_screen = ui.screen_changed = true;
//#endif
goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items);
sd_encoder_position = 0xFFFF;
defer_status_screen();
//#if HAS_GRAPHICAL_LCD
// update();
//#endif
TERN_(HAS_TOUCH_SLEEP, ui.wakeup_screen());
}
#endif
inline void sdcard_start_selected_file() {
@@ -113,17 +100,15 @@ class MenuItem_sdfolder : public MenuItem_sdbase {
encoderTopLine = 0;
ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);
ui.screen_changed = true;
#if HAS_GRAPHICAL_LCD
ui.drawing_screen = false;
#endif
TERN_(HAS_MARLINUI_U8GLIB, ui.drawing_screen = false);
ui.refresh();
}
};
void menu_media() {
void menu_media_filelist() {
ui.encoder_direction_menus();
#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB
static uint16_t fileCnt;
if (ui.first_page) fileCnt = card.get_num_Files();
#else
@@ -131,35 +116,49 @@ void menu_media() {
#endif
START_MENU();
BACK_ITEM(MSG_MAIN);
#if ENABLED(MULTI_VOLUME)
ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); });
#else
BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
#endif
if (card.flag.workDirIsRoot) {
#if !PIN_EXISTS(SD_DETECT)
ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); });
#endif
}
else if (card.isMounted())
ACTION_ITEM_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir);
ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir);
if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
if (_menuLineNr == _thisItemNr) {
const uint16_t nr =
#if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
fileCnt - 1 -
#endif
i;
card.getfilename_sorted(nr);
card.getfilename_sorted(SD_ORDER(i, fileCnt));
if (card.flag.filenameIsDir)
MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card);
else
MENU_ITEM(sdfile, MSG_MEDIA_MENU, card);
}
else {
else
SKIP_ITEM();
}
}
END_MENU();
}
#if ENABLED(MULTI_VOLUME)
void menu_media_select() {
START_MENU();
BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK));
#if ENABLED(VOLUME_SD_ONBOARD)
ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); });
#endif
#if ENABLED(VOLUME_USB_FLASH_DRIVE)
ACTION_ITEM(MSG_USB_DISK, []{ card.changeMedia(&card.media_driver_usbFlash); card.mount(); ui.goto_screen(menu_media_filelist); });
#endif
END_MENU();
}
#endif
void menu_media() {
TERN(MULTI_VOLUME, menu_media_select, menu_media_filelist)();
}
#endif // HAS_LCD_MENU && SDSUPPORT