Browse Source

Add pause/resume actions on M600, M125

Scott Lahteine 6 years ago
parent
commit
f704f405af
2 changed files with 16 additions and 0 deletions
  1. 8
    0
      Marlin/Configuration_adv.h
  2. 8
    0
      Marlin/src/feature/pause.cpp

+ 8
- 0
Marlin/Configuration_adv.h View File

@@ -1430,6 +1430,14 @@
1430 1430
  */
1431 1431
 //#define ACTION_ON_KILL "poweroff"
1432 1432
 
1433
+/**
1434
+ * Specify an action command to send to the host on pause and resume.
1435
+ * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'.
1436
+ * The host must be configured to handle the action command.
1437
+ */
1438
+//#define ACTION_ON_PAUSE "pause"
1439
+//#define ACTION_ON_RESUME "resume"
1440
+
1433 1441
 //===========================================================================
1434 1442
 //====================== I2C Position Encoder Settings ======================
1435 1443
 //===========================================================================

+ 8
- 0
Marlin/src/feature/pause.cpp View File

@@ -114,6 +114,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
114 114
 ) {
115 115
   if (move_away_flag) return false; // already paused
116 116
 
117
+  #ifdef ACTION_ON_PAUSE
118
+    SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
119
+  #endif
120
+
117 121
   if (!DEBUGGING(DRYRUN) && unload_length != 0) {
118 122
     #if ENABLED(PREVENT_COLD_EXTRUSION)
119 123
       if (!thermalManager.allow_cold_extrude &&
@@ -342,6 +346,10 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l
342 346
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
343 347
   #endif
344 348
 
349
+  #ifdef ACTION_ON_RESUME
350
+    SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
351
+  #endif
352
+
345 353
   #if ENABLED(SDSUPPORT)
346 354
     if (sd_print_paused) {
347 355
       card.startFileprint();

Loading…
Cancel
Save