Skip to content

Commit 29159a5

Browse files
authored
Merge pull request prusa3d#3475 from gudnimg/custom_message_m601
Make M117 message persistent on LCD when used with M601 or G4
2 parents 6115125 + bf38241 commit 29159a5

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Firmware/Marlin_main.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -4264,7 +4264,7 @@ void process_commands()
42644264
if (starpos != NULL)
42654265
*(starpos) = '\0';
42664266
lcd_setstatus(strchr_pointer + 5);
4267-
custom_message_type = CustomMsg::MsgUpdate;
4267+
custom_message_type = CustomMsg::M117;
42684268
}
42694269

42704270
/*!
@@ -4762,7 +4762,13 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
47624762
codenum = 0;
47634763
if(code_seen('P')) codenum = code_value(); // milliseconds to wait
47644764
if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
4765-
if(codenum != 0) LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL
4765+
if(codenum != 0)
4766+
{
4767+
if(custom_message_type != CustomMsg::M117)
4768+
{
4769+
LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL
4770+
}
4771+
}
47664772
st_synchronize();
47674773
codenum += _millis(); // keep track of when we started waiting
47684774
previous_millis_cmd.start();

Firmware/ultralcd.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ void lcdui_print_status_line(void)
618618
}
619619
} else { // Otherwise check for other special events
620620
switch (custom_message_type) {
621-
case CustomMsg::MsgUpdate: //Short message even while printing from SD
621+
case CustomMsg::M117: // M117 Set the status line message on the LCD
622622
case CustomMsg::Status: // Nothing special, print status message normally
623623
case CustomMsg::M0Wait: // M0/M1 Wait command working even from SD
624624
lcd_print(lcd_status_message);
@@ -875,10 +875,13 @@ void lcd_commands()
875875
{
876876
if (!blocks_queued() && !homing_flag)
877877
{
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();
878+
if (custom_message_type != CustomMsg::M117)
879+
{
880+
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20
881+
}
882+
lcd_commands_type = LcdCommands::Idle;
883+
lcd_commands_step = 0;
884+
long_pause();
882885
}
883886
}
884887

Firmware/ultralcd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ enum class CustomMsg : uint_least8_t
121121
TempCal, //!< PINDA temperature calibration
122122
TempCompPreheat, //!< Temperature compensation preheat
123123
M0Wait, //!< M0/M1 Wait command working even from SD
124-
MsgUpdate, //!< Short message even while printing from SD
125-
Resuming, //!< Resuming message
124+
M117, //!< M117 Set the status line message on the LCD
125+
Resuming, //!< Resuming message
126126
};
127127

128128
extern CustomMsg custom_message_type;

0 commit comments

Comments
 (0)