Browse Source

Add pause/resume actions on M600, M125

pull/1/head
Scott Lahteine 7 years ago
parent
commit
f704f405af
  1. 8
      Marlin/Configuration_adv.h
  2. 8
      Marlin/src/feature/pause.cpp

8
Marlin/Configuration_adv.h

@ -1430,6 +1430,14 @@
*/ */
//#define ACTION_ON_KILL "poweroff" //#define ACTION_ON_KILL "poweroff"
/**
* Specify an action command to send to the host on pause and resume.
* Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'.
* The host must be configured to handle the action command.
*/
//#define ACTION_ON_PAUSE "pause"
//#define ACTION_ON_RESUME "resume"
//=========================================================================== //===========================================================================
//====================== I2C Position Encoder Settings ====================== //====================== I2C Position Encoder Settings ======================
//=========================================================================== //===========================================================================

8
Marlin/src/feature/pause.cpp

@ -114,6 +114,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
) { ) {
if (move_away_flag) return false; // already paused if (move_away_flag) return false; // already paused
#ifdef ACTION_ON_PAUSE
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
#endif
if (!DEBUGGING(DRYRUN) && unload_length != 0) { if (!DEBUGGING(DRYRUN) && unload_length != 0) {
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
if (!thermalManager.allow_cold_extrude && if (!thermalManager.allow_cold_extrude &&
@ -342,6 +346,10 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif
#ifdef ACTION_ON_RESUME
SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
#endif
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
if (sd_print_paused) { if (sd_print_paused) {
card.startFileprint(); card.startFileprint();

Loading…
Cancel
Save