update code base to Marlin 2.0.9.2
This commit is contained in:
51
Marlin/src/gcode/feature/pause/M125.cpp
Executable file → Normal file
51
Marlin/src/gcode/feature/pause/M125.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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,13 +27,10 @@
|
||||
#include "../../gcode.h"
|
||||
#include "../../parser.h"
|
||||
#include "../../../feature/pause.h"
|
||||
#include "../../../lcd/marlinui.h"
|
||||
#include "../../../module/motion.h"
|
||||
#include "../../../sd/cardreader.h"
|
||||
#include "../../../module/printcounter.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#include "../../../lcd/ultralcd.h"
|
||||
#endif
|
||||
#include "../../../sd/cardreader.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../feature/powerloss.h"
|
||||
@@ -49,18 +46,17 @@
|
||||
* position and waits, resuming with a button click or M108.
|
||||
* Without PARK_HEAD_ON_PAUSE the M125 command does nothing.
|
||||
*
|
||||
* L = override retract length
|
||||
* X = override X
|
||||
* Y = override Y
|
||||
* Z = override Z raise
|
||||
* L<linear> = Override retract Length
|
||||
* X<pos> = Override park position X
|
||||
* Y<pos> = Override park position Y
|
||||
* Z<linear> = Override Z raise
|
||||
*
|
||||
* With an LCD menu:
|
||||
* P<bool> = Always show a prompt and await a response
|
||||
*/
|
||||
void GcodeSuite::M125() {
|
||||
// Initial retract before move to filament change position
|
||||
const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0
|
||||
#ifdef PAUSE_PARK_RETRACT_LENGTH
|
||||
+ (PAUSE_PARK_RETRACT_LENGTH)
|
||||
#endif
|
||||
);
|
||||
const float retract = TERN0(HAS_EXTRUDERS, -ABS(parser.axisunitsval('L', E_AXIS, PAUSE_PARK_RETRACT_LENGTH)));
|
||||
|
||||
xyz_pos_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
@@ -75,26 +71,17 @@ void GcodeSuite::M125() {
|
||||
park_point += hotend_offset[active_extruder];
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
const bool sd_printing = IS_SD_PRINTING();
|
||||
#else
|
||||
constexpr bool sd_printing = false;
|
||||
#endif
|
||||
const bool sd_printing = TERN0(SDSUPPORT, IS_SD_PRINTING());
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
lcd_pause_show_message(PAUSE_MESSAGE_PAUSING, PAUSE_MODE_PAUSE_PRINT);
|
||||
const bool show_lcd = parser.seenval('P');
|
||||
#else
|
||||
constexpr bool show_lcd = false;
|
||||
#endif
|
||||
ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT);
|
||||
|
||||
if (pause_print(retract, park_point, 0, show_lcd)) {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
if (recovery.enabled) recovery.save(true);
|
||||
#endif
|
||||
if (!sd_printing || show_lcd) {
|
||||
// If possible, show an LCD prompt with the 'P' flag
|
||||
const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P'));
|
||||
|
||||
if (pause_print(retract, park_point, show_lcd, 0)) {
|
||||
if (ENABLED(EXTENSIBLE_UI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) || !sd_printing || show_lcd) {
|
||||
wait_for_confirmation(false, 0);
|
||||
resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0);
|
||||
resume_print(0, 0, -retract, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user