From e3fe1f0d007e7306ac3b20bd99b3a7debbf91fcd Mon Sep 17 00:00:00 2001
From: Erik de Bruijn <github@erikdebruijn.nl>
Date: Tue, 8 May 2012 17:27:45 +0200
Subject: [PATCH] =?UTF-8?q?Made=20a=20more=20granular=20configuration=20po?=
 =?UTF-8?q?ssible=20PREVENT=5FLENGTHY=5FEXTRUDE=EF=9C=88.=20You=20can=20no?=
 =?UTF-8?q?w=20decide=20to=20allow/disallow=20large=20length=20of=20extrus?=
 =?UTF-8?q?ions=20to=20be=20executed.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Turning off the protection might be beneficial to those who want to do fast and long reversals.
---
 Marlin/Configuration.h | 3 +++
 Marlin/planner.cpp     | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index f15876770e..880d48a7d2 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -108,6 +108,9 @@
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
 //can be software-disabled for whatever purposes by
 #define PREVENT_DANGEROUS_EXTRUDE
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
+#define PREVENT_LENGTHY_EXTRUDE
+
 #define EXTRUDE_MINTEMP 170
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
 
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index cfb503deb8..b620589533 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -495,12 +495,14 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
       SERIAL_ECHO_START;
       SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
     }
+    #ifdef PREVENT_LENGTHY_EXTRUDE
     if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH)
     {
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
       SERIAL_ECHO_START;
       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
     }
+    #endif
   #endif
   
   // Prepare to set up new block