From 7aa99095ff81f83a5d68a02317c8408d336f96db Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Tue, 26 Oct 2010 01:03:06 +1100 Subject: [PATCH] exclude code for no-ooze if disabled --- config.h.dist | 2 +- gcode_process.c | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config.h.dist b/config.h.dist index b9cdcf8..853bc00 100644 --- a/config.h.dist +++ b/config.h.dist @@ -38,7 +38,7 @@ #define TEMP_HYSTERESIS 20 #define TEMP_RESIDENCY_TIME 60 -// this is how many steps to suck back the filament by when we stop +// this is how many steps to suck back the filament by when we stop. set to zero to disable #define E_STARTSTOP_STEPS 20 /* diff --git a/gcode_process.c b/gcode_process.c index 4e1a9d9..f91ace8 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -173,26 +173,30 @@ void process_gcode_command() { if (temp_achieved() == 0) { enqueue(NULL); } - do { - // backup feedrate, move E very quickly then restore feedrate - backup_f = startpoint.F; - startpoint.F = MAXIMUM_FEEDRATE_E; - SpecialMoveE(E_STARTSTOP_STEPS, MAXIMUM_FEEDRATE_E); - startpoint.F = backup_f; - } while (0); + #if E_STARTSTOP_STEPS > 0 + do { + // backup feedrate, move E very quickly then restore feedrate + backup_f = startpoint.F; + startpoint.F = MAXIMUM_FEEDRATE_E; + SpecialMoveE(E_STARTSTOP_STEPS, MAXIMUM_FEEDRATE_E); + startpoint.F = backup_f; + } while (0); + #endif break; // M102- extruder reverse // M103- extruder off case 103: - do { - // backup feedrate, move E very quickly then restore feedrate - backup_f = startpoint.F; - startpoint.F = MAXIMUM_FEEDRATE_E; - SpecialMoveE(-E_STARTSTOP_STEPS, MAXIMUM_FEEDRATE_E); - startpoint.F = backup_f; - } while (0); + #if E_STARTSTOP_STEPS > 0 + do { + // backup feedrate, move E very quickly then restore feedrate + backup_f = startpoint.F; + startpoint.F = MAXIMUM_FEEDRATE_E; + SpecialMoveE(-E_STARTSTOP_STEPS, MAXIMUM_FEEDRATE_E); + startpoint.F = backup_f; + } while (0); + #endif break; // M104- set temperature