update code base to Marlin 2.0.9.2
This commit is contained in:
18
Marlin/src/gcode/lcd/M0_M1.cpp
Executable file → Normal file
18
Marlin/src/gcode/lcd/M0_M1.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -32,9 +32,11 @@
|
||||
#include "../../MarlinCore.h" // for wait_for_user_response()
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extui/ui_api.h"
|
||||
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
||||
#include "../../lcd/e3v2/enhanced/dwin.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
@@ -68,6 +70,8 @@ void GcodeSuite::M0_M1() {
|
||||
ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
|
||||
else
|
||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
||||
#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
||||
DWIN_Popup_Confirm(ICON_BLTouch, parser.string_arg ?: GET_TEXT(MSG_STOPPED), GET_TEXT(MSG_USERWAIT));
|
||||
#else
|
||||
|
||||
if (parser.string_arg) {
|
||||
@@ -77,15 +81,11 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
|
||||
#endif
|
||||
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR));
|
||||
|
||||
wait_for_user_response(ms);
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
ui.reset_status();
|
||||
#endif
|
||||
TERN_(HAS_LCD_MENU, ui.reset_status());
|
||||
}
|
||||
|
||||
#endif // HAS_RESUME_CONTINUE
|
||||
|
10
Marlin/src/gcode/lcd/M117.cpp
Executable file → Normal file
10
Marlin/src/gcode/lcd/M117.cpp
Executable file → Normal file
@@ -16,12 +16,16 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M117: Set LCD Status Message
|
||||
@@ -34,3 +38,5 @@ void GcodeSuite::M117() {
|
||||
ui.reset_status();
|
||||
|
||||
}
|
||||
|
||||
#endif // HAS_STATUS_MESSAGE
|
||||
|
59
Marlin/src/gcode/lcd/M145.cpp
Executable file → Normal file
59
Marlin/src/gcode/lcd/M145.cpp
Executable file → Normal file
@@ -16,16 +16,20 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HOTENDS && HAS_LCD_MENU
|
||||
#if PREHEAT_COUNT
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
#if HAS_HOTEND
|
||||
#include "../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M145: Set the heatup state for a material in the LCD menu
|
||||
@@ -37,25 +41,42 @@
|
||||
*/
|
||||
void GcodeSuite::M145() {
|
||||
const uint8_t material = (uint8_t)parser.intval('S');
|
||||
if (material >= COUNT(ui.preheat_hotend_temp))
|
||||
if (material >= PREHEAT_COUNT)
|
||||
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);
|
||||
}
|
||||
preheat_t &mat = ui.material_preset[material];
|
||||
#if HAS_HOTEND
|
||||
if (parser.seenval('H'))
|
||||
mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, thermalManager.hotend_max_target(0));
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
if (parser.seenval('B'))
|
||||
mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET);
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
if (parser.seenval('F'))
|
||||
mat.fan_speed = constrain(parser.value_int(), 0, 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HOTENDS && HAS_LCD_MENU
|
||||
void GcodeSuite::M145_report(const bool forReplay/*=true*/) {
|
||||
report_heading(forReplay, PSTR(STR_MATERIAL_HEATUP));
|
||||
LOOP_L_N(i, PREHEAT_COUNT) {
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
PSTR(" M145 S"), i
|
||||
#if HAS_HOTEND
|
||||
, PSTR(" H"), parser.to_temp_units(ui.material_preset[i].hotend_temp)
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
, SP_B_STR, parser.to_temp_units(ui.material_preset[i].bed_temp)
|
||||
#endif
|
||||
#if HAS_FAN
|
||||
, PSTR(" F"), ui.material_preset[i].fan_speed
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PREHEAT_COUNT
|
||||
|
15
Marlin/src/gcode/lcd/M250.cpp
Executable file → Normal file
15
Marlin/src/gcode/lcd/M250.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -25,14 +25,21 @@
|
||||
#if HAS_LCD_CONTRAST
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../lcd/marlinui.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);
|
||||
if (parser.seenval('C'))
|
||||
ui.set_contrast(parser.value_byte());
|
||||
else
|
||||
M250_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M250_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_LCD_CONTRAST));
|
||||
SERIAL_ECHOLNPGM(" M250 C", ui.contrast);
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_CONTRAST
|
||||
|
44
Marlin/src/gcode/lcd/M256.cpp
Normal file
44
Marlin/src/gcode/lcd/M256.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M256: Set the LCD brightness
|
||||
*/
|
||||
void GcodeSuite::M256() {
|
||||
if (parser.seenval('B'))
|
||||
ui.set_brightness(parser.value_int());
|
||||
else
|
||||
M256_report();
|
||||
}
|
||||
|
||||
void GcodeSuite::M256_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_LCD_BRIGHTNESS));
|
||||
SERIAL_ECHOLNPGM(" M256 B", ui.brightness);
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_BRIGHTNESS
|
4
Marlin/src/gcode/lcd/M300.cpp
Executable file → Normal file
4
Marlin/src/gcode/lcd/M300.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../lcd/ultralcd.h" // i2c-based BUZZ
|
||||
#include "../../lcd/marlinui.h" // i2c-based BUZZ
|
||||
#include "../../libs/buzzer.h" // Buzzer, if possible
|
||||
|
||||
/**
|
||||
|
51
Marlin/src/gcode/lcd/M414.cpp
Normal file
51
Marlin/src/gcode/lcd/M414.cpp
Normal 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_MULTI_LANGUAGE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
/**
|
||||
* M414: Set the language for the UI
|
||||
*
|
||||
* Parameters
|
||||
* S<index> : The language to select
|
||||
*/
|
||||
void GcodeSuite::M414() {
|
||||
|
||||
if (parser.seenval('S'))
|
||||
ui.set_language(parser.value_byte());
|
||||
else
|
||||
M414_report();
|
||||
|
||||
}
|
||||
|
||||
void GcodeSuite::M414_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_UI_LANGUAGE));
|
||||
SERIAL_ECHOLNPGM(" M414 S", ui.language);
|
||||
}
|
||||
|
||||
#endif // HAS_MULTI_LANGUAGE
|
35
Marlin/src/gcode/lcd/M73.cpp
Executable file → Normal file
35
Marlin/src/gcode/lcd/M73.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -25,26 +25,37 @@
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
||||
#include "../../lcd/e3v2/enhanced/dwin.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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());
|
||||
|
||||
#if ENABLED(DWIN_CREALITY_LCD_ENHANCED)
|
||||
|
||||
DWIN_Progress_Update();
|
||||
|
||||
#else
|
||||
|
||||
if (parser.seenval('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
48
Marlin/src/gcode/lcd/M995.cpp
Normal file
48
Marlin/src/gcode/lcd/M995.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
#include "../../lcd/extui/mks_ui/draw_touch_calibration.h"
|
||||
#else
|
||||
#include "../../lcd/menu/menu.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M995: Touch screen calibration for TFT display
|
||||
*/
|
||||
void GcodeSuite::M995() {
|
||||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
lv_draw_touch_calibration_screen();
|
||||
#else
|
||||
ui.goto_screen(touch_screen_calibration);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // TOUCH_SCREEN_CALIBRATION
|
Reference in New Issue
Block a user