Skip to content

Commit c77b768

Browse files
committed
Make M117 custom message persistant if print is paused
If M117 is called before M601 then we would like the custom message to be visible on the LCD screen until the print is resumed. Change in memory: +10 bytes of flash Fixes prusa3d#3316
1 parent 9bb8797 commit c77b768

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Firmware/Marlin_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4272,7 +4272,7 @@ void process_commands()
42724272
if (starpos != NULL)
42734273
*(starpos) = '\0';
42744274
lcd_setstatus(strchr_pointer + 5);
4275-
custom_message_type = CustomMsg::MsgUpdate;
4275+
custom_message_type = CustomMsg::M117;
42764276
}
42774277

42784278
/*!

Firmware/ultralcd.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ void lcdui_print_status_line(void)
676676
case CustomMsg::Resuming: //Resuming
677677
lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT));
678678
break;
679+
case CustomMsg::M117:
680+
lcd_print(lcd_status_message);
681+
break;
679682
}
680683
}
681684

@@ -875,10 +878,13 @@ void lcd_commands()
875878
{
876879
if (!blocks_queued() && !homing_flag)
877880
{
878-
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20
879-
lcd_commands_type = LcdCommands::Idle;
880-
lcd_commands_step = 0;
881-
long_pause();
881+
if (custom_message_type != CustomMsg::M117)
882+
{
883+
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20
884+
}
885+
lcd_commands_type = LcdCommands::Idle;
886+
lcd_commands_step = 0;
887+
long_pause();
882888
}
883889
}
884890

Firmware/ultralcd.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ enum class CustomMsg : uint_least8_t
122122
TempCompPreheat, //!< Temperature compensation preheat
123123
M0Wait, //!< M0/M1 Wait command working even from SD
124124
MsgUpdate, //!< Short message even while printing from SD
125-
Resuming, //!< Resuming message
125+
Resuming, //!< Resuming message
126+
M117, //!< M117 Custom Message to be displayed
126127
};
127128

128129
extern CustomMsg custom_message_type;

0 commit comments

Comments
 (0)