Initial commit. Unusable Marlin 2.0.5.3 core without any custimization.
This commit is contained in:
91
Marlin/src/gcode/lcd/M0_M1.cpp
Executable file
91
Marlin/src/gcode/lcd/M0_M1.cpp
Executable file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../module/planner.h" // for synchronize()
|
||||
#include "../../MarlinCore.h" // for wait_for_user_response()
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
#include "../../feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M0: Unconditional stop - Wait for user button press on LCD
|
||||
* M1: Conditional stop - Wait for user button press on LCD
|
||||
*/
|
||||
void GcodeSuite::M0_M1() {
|
||||
millis_t ms = 0;
|
||||
if (parser.seenval('P')) ms = parser.value_millis(); // Milliseconds to wait
|
||||
if (parser.seenval('S')) ms = parser.value_millis_from_seconds(); // Seconds to wait
|
||||
|
||||
planner.synchronize();
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
|
||||
if (parser.string_arg)
|
||||
ui.set_status(parser.string_arg, true);
|
||||
else {
|
||||
LCD_MESSAGEPGM(MSG_USERWAIT);
|
||||
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
||||
ui.reset_progress_bar_timeout();
|
||||
#endif
|
||||
}
|
||||
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
if (parser.string_arg)
|
||||
ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
|
||||
else
|
||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
||||
#else
|
||||
|
||||
if (parser.string_arg) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLN(parser.string_arg);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
|
||||
#endif
|
||||
|
||||
wait_for_user_response(ms);
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
ui.reset_status();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // HAS_RESUME_CONTINUE
|
36
Marlin/src/gcode/lcd/M117.cpp
Executable file
36
Marlin/src/gcode/lcd/M117.cpp
Executable file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
|
||||
/**
|
||||
* M117: Set LCD Status Message
|
||||
*/
|
||||
void GcodeSuite::M117() {
|
||||
|
||||
if (parser.string_arg && parser.string_arg[0])
|
||||
ui.set_status(parser.string_arg);
|
||||
else
|
||||
ui.reset_status();
|
||||
|
||||
}
|
61
Marlin/src/gcode/lcd/M145.cpp
Executable file
61
Marlin/src/gcode/lcd/M145.cpp
Executable file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HOTENDS && HAS_LCD_MENU
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
|
||||
/**
|
||||
* M145: Set the heatup state for a material in the LCD menu
|
||||
*
|
||||
* S<material>
|
||||
* H<hotend temp>
|
||||
* B<bed temp>
|
||||
* F<fan speed>
|
||||
*/
|
||||
void GcodeSuite::M145() {
|
||||
const uint8_t material = (uint8_t)parser.intval('S');
|
||||
if (material >= COUNT(ui.preheat_hotend_temp))
|
||||
SERIAL_ERROR_MSG(STR_ERR_MATERIAL_INDEX);
|
||||
else {
|
||||
int v;
|
||||
if (parser.seenval('H')) {
|
||||
v = parser.value_int();
|
||||
ui.preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
|
||||
}
|
||||
if (parser.seenval('F')) {
|
||||
v = parser.value_int();
|
||||
ui.preheat_fan_speed[material] = (uint8_t)constrain(v, 0, 255);
|
||||
}
|
||||
#if TEMP_SENSOR_BED != 0
|
||||
if (parser.seenval('B')) {
|
||||
v = parser.value_int();
|
||||
ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 10);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HOTENDS && HAS_LCD_MENU
|
38
Marlin/src/gcode/lcd/M250.cpp
Executable file
38
Marlin/src/gcode/lcd/M250.cpp
Executable file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_LCD_CONTRAST
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
|
||||
/**
|
||||
* M250: Read and optionally set the LCD contrast
|
||||
*/
|
||||
void GcodeSuite::M250() {
|
||||
if (parser.seen('C')) ui.set_contrast(parser.value_int());
|
||||
SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast);
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_CONTRAST
|
45
Marlin/src/gcode/lcd/M300.cpp
Executable file
45
Marlin/src/gcode/lcd/M300.cpp
Executable file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_BUZZER
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../lcd/ultralcd.h" // i2c-based BUZZ
|
||||
#include "../../libs/buzzer.h" // Buzzer, if possible
|
||||
|
||||
/**
|
||||
* M300: Play beep sound S<frequency Hz> P<duration ms>
|
||||
*/
|
||||
void GcodeSuite::M300() {
|
||||
uint16_t const frequency = parser.ushortval('S', 260);
|
||||
uint16_t duration = parser.ushortval('P', 1000);
|
||||
|
||||
// Limits the tone duration to 0-5 seconds.
|
||||
NOMORE(duration, 5000U);
|
||||
|
||||
BUZZ(duration, frequency);
|
||||
}
|
||||
|
||||
#endif // HAS_BUZZER
|
51
Marlin/src/gcode/lcd/M73.cpp
Executable file
51
Marlin/src/gcode/lcd/M73.cpp
Executable file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M73: Set percentage complete (for display on LCD)
|
||||
*
|
||||
* Example:
|
||||
* M73 P25 ; Set progress to 25%
|
||||
*
|
||||
* Notes:
|
||||
* This has no effect during an SD print job
|
||||
*/
|
||||
void GcodeSuite::M73() {
|
||||
if (parser.seen('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
if (parser.seen('R')) ui.set_remaining_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // LCD_SET_PROGRESS_MANUALLY
|
Reference in New Issue
Block a user