Prevent duplication of PSTRs to save memory (#15435)

This commit is contained in:
Marcio Teixeira
2019-09-30 21:53:34 -06:00
committed by Scott Lahteine
parent 98f614ddb1
commit e3ff27c95a
3 changed files with 22 additions and 21 deletions

View File

@@ -97,7 +97,7 @@ inline void sdcard_start_selected_file() {
class MenuItem_sdfile {
public:
static void action(CardReader &) {
static void action(PGM_P const pstr, CardReader &) {
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
// Save menu state for the selected file
sd_encoder_position = ui.encoderPosition;
@@ -105,7 +105,7 @@ class MenuItem_sdfile {
sd_items = screen_items;
#endif
#if ENABLED(SD_MENU_CONFIRM_START)
MenuItem_submenu::action(menu_sd_confirm);
MenuItem_submenu::action(pstr, menu_sd_confirm);
#else
sdcard_start_selected_file();
#endif
@@ -114,7 +114,7 @@ class MenuItem_sdfile {
class MenuItem_sdfolder {
public:
static void action(CardReader &theCard) {
static void action(PGM_P const, CardReader &theCard) {
card.cd(theCard.filename);
encoderTopLine = 0;
ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM);