From 893cbbab83ebd4906eab0ce9bb08d0fb4f805af7 Mon Sep 17 00:00:00 2001
From: Arksine <arksine.code@gmail.com>
Date: Mon, 21 Jan 2019 17:24:17 -0500
Subject: [PATCH] pause_resume: update documentation

Add updates to example-extras.cfg and G-Codes.md documenting pause_resume.  Also add M600 (filament change) to sample-macros.cfg.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
---
 config/example-extras.cfg |  6 ++++++
 config/sample-macros.cfg  | 21 +++++++++++++++++++++
 docs/G-Codes.md           | 10 ++++++++++
 3 files changed, 37 insertions(+)

diff --git a/config/example-extras.cfg b/config/example-extras.cfg
index a4e52ddef..2a2e8ccfb 100644
--- a/config/example-extras.cfg
+++ b/config/example-extras.cfg
@@ -1142,3 +1142,9 @@
 # default_prefix: echo:
 #    Directly sets the default prefix. If present, this value will override
 #    the "default_type".
+
+# Pause/Resume functionality with support of position capture and restore
+#[pause_resume]
+#recover_velocity: 50.
+#  When capture/restore is enabled, the speed at which to return to
+#  the captured position (in mm/s).  Default is 50.0 mm/s.
diff --git a/config/sample-macros.cfg b/config/sample-macros.cfg
index 10854b580..1f6d84a19 100644
--- a/config/sample-macros.cfg
+++ b/config/sample-macros.cfg
@@ -34,3 +34,24 @@
 #gcode:  SET_PIN PIN=BEEPER_pin VALUE={S}
 #        G4 P{P}
 #        SET_PIN PIN=BEEPER_pin VALUE=0
+
+# M600: Filament Change.  This macro will pause the printer, move
+# the tool to the change position, and retract the filament 50mm.
+# Adjust the retraction settings for your own extruder.  After filament
+# has been changed, the print can be resumed from its previous position
+# with the "RESUME" gcode
+#
+#[gcode_macro M600]
+#default_parameter_X: 50
+#default_parameter_Y: 0
+#default_parameter_Z: 10
+#gcode:
+# PAUSE
+# G91
+# G1 E-.8 F2700
+# G1 Z{Z}
+# G90
+# G1 X{X} Y{Y} F3000
+# G91
+# G1 E-50 F1000
+# G90
diff --git a/docs/G-Codes.md b/docs/G-Codes.md
index d7fcbedb4..6848279f5 100644
--- a/docs/G-Codes.md
+++ b/docs/G-Codes.md
@@ -291,3 +291,13 @@ enabled.
   - `RESPOND TYPE=error MSG="<message>"`: echo the message prepended with `!! `.
   - `RESPOND PREFIX=<prefix> MSG="<message>"`: echo the message prepended with `<prefix>`
     (The `PREFIX` parameter will take priority over the `TYPE` parameter)
+
+## Pause Resume
+
+The following commands are available when the "pause_resume" config section
+is enabled:
+  - `PAUSE`:  Pauses the current print.  The current position is captured for
+  restoration upon resume.
+  - `RESUME [VELOCITY=<value>]`: Resumes the print from a pause, first restoring
+  the previously captured position.  The VELOCITY parameter determines the speed
+  at which the tool should return to the original captured position.