Fix M0/M1 message string
This commit is contained in:
parent
459a0dae29
commit
6d18f715e4
1 changed files with 9 additions and 21 deletions
|
@ -50,32 +50,20 @@
|
||||||
* M1: Conditional stop - Wait for user button press on LCD
|
* M1: Conditional stop - Wait for user button press on LCD
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M0_M1() {
|
void GcodeSuite::M0_M1() {
|
||||||
const char * const args = parser.string_arg;
|
|
||||||
|
|
||||||
millis_t ms = 0;
|
millis_t ms = 0;
|
||||||
bool hasP = false, hasS = false;
|
if (parser.seenval('P')) ms = parser.value_millis(); // Milliseconds to wait
|
||||||
if (parser.seenval('P')) {
|
if (parser.seenval('S')) ms = parser.value_millis_from_seconds(); // Seconds to wait
|
||||||
ms = parser.value_millis(); // milliseconds to wait
|
|
||||||
hasP = ms > 0;
|
|
||||||
}
|
|
||||||
if (parser.seenval('S')) {
|
|
||||||
ms = parser.value_millis_from_seconds(); // seconds to wait
|
|
||||||
hasS = ms > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const bool has_message = !hasP && !hasS && args && *args;
|
|
||||||
|
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
|
|
||||||
#if HAS_LEDS_OFF_FLAG
|
#if HAS_LEDS_OFF_FLAG
|
||||||
if (parser.seen('Q'))
|
if (parser.seen('Q')) printerEventLEDs.onPrintCompleted(); // Change LED color for Print Completed
|
||||||
printerEventLEDs.onPrintCompleted(); // Change LED color for Print Completed
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_LCD_MENU
|
#if HAS_LCD_MENU
|
||||||
|
|
||||||
if (has_message)
|
if (parser.string_arg)
|
||||||
ui.set_status(args, true);
|
ui.set_status(parser.string_arg, true);
|
||||||
else {
|
else {
|
||||||
LCD_MESSAGEPGM(MSG_USERWAIT);
|
LCD_MESSAGEPGM(MSG_USERWAIT);
|
||||||
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
||||||
|
@ -85,16 +73,16 @@ void GcodeSuite::M0_M1() {
|
||||||
|
|
||||||
#elif ENABLED(EXTENSIBLE_UI)
|
#elif ENABLED(EXTENSIBLE_UI)
|
||||||
|
|
||||||
if (has_message)
|
if (parser.string_arg)
|
||||||
ExtUI::onUserConfirmRequired(args); // Can this take an SRAM string??
|
ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
|
||||||
else
|
else
|
||||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (has_message) {
|
if (parser.string_arg) {
|
||||||
SERIAL_ECHO_START();
|
SERIAL_ECHO_START();
|
||||||
SERIAL_ECHOLN(args);
|
SERIAL_ECHOLN(parser.string_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in a new issue