Browse Source

Add pause/resume actions on M600, M125

Scott Lahteine 7 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
  */
1430
  */
1431
 //#define ACTION_ON_KILL "poweroff"
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
 //====================== I2C Position Encoder Settings ======================
1442
 //====================== I2C Position Encoder Settings ======================
1435
 //===========================================================================
1443
 //===========================================================================

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

114
 ) {
114
 ) {
115
   if (move_away_flag) return false; // already paused
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
   if (!DEBUGGING(DRYRUN) && unload_length != 0) {
121
   if (!DEBUGGING(DRYRUN) && unload_length != 0) {
118
     #if ENABLED(PREVENT_COLD_EXTRUSION)
122
     #if ENABLED(PREVENT_COLD_EXTRUSION)
119
       if (!thermalManager.allow_cold_extrude &&
123
       if (!thermalManager.allow_cold_extrude &&
342
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
346
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
343
   #endif
347
   #endif
344
 
348
 
349
+  #ifdef ACTION_ON_RESUME
350
+    SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
351
+  #endif
352
+
345
   #if ENABLED(SDSUPPORT)
353
   #if ENABLED(SDSUPPORT)
346
     if (sd_print_paused) {
354
     if (sd_print_paused) {
347
       card.startFileprint();
355
       card.startFileprint();

Loading…
Cancel
Save