summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Keller <cakeller98@gmail.com>2011-05-07 16:01:41 -0500
committerChristopher Keller <cakeller98@gmail.com>2011-05-07 16:01:41 -0500
commitd0a32823f39d377c34338d1f89b6f380715284ee (patch)
treeee152bec3479e4c92f34ec9ed88cde9139d768ba
parent3f541055df1c9e2913a0e2b6e3b876deb99b4014 (diff)
Added M84 Timeout for steppers:
Changed the comment to reflect the updated usage Old functionality remains unchanged M84 disables steppers after finishing previous move. Added functionality: M84 S<seconds> adds an inactivity timeout, after which the steppers will be disabled. If S0, then no timeout (default)
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde15
1 files changed, 9 insertions, 6 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index bb77f7e..9c395f8 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -76,7 +76,8 @@ void kill(byte debug);
// M81 - Turn off Power Supply
// M82 - Set E codes absolute (default)
// M83 - Set E codes relative while in Absolute Coordinates (G90) mode
-// M84 - Disable steppers until next move
+// M84 - Disable steppers until next move,
+// or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
// M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
// M86 - If Endstop is Not Activated then Abort Print. Specify X and/or Y
// M92 - Set axis_steps_per_unit - same syntax as G92
@@ -173,6 +174,7 @@ int minttemp=temp2analog(MINTEMP);
//Inactivity shutdown variables
unsigned long previous_millis_cmd=0;
unsigned long max_inactive_time = 0;
+unsigned long stepper_inactive_time = 0;
#ifdef SDSUPPORT
Sd2Card card;
@@ -780,10 +782,8 @@ inline void process_commands()
relative_mode_e = true;
break;
case 84:
- disable_x();
- disable_y();
- disable_z();
- disable_e();
+ if(code_seen('S')){ stepper_inactive_time = code_value()*1000; }
+ else{ disable_x(); disable_y(); disable_z(); disable_e(); }
break;
case 85: // M85
code_seen('S');
@@ -1534,4 +1534,7 @@ inline void kill(byte debug)
}
}
-inline void manage_inactivity(byte debug) { if( (millis()-previous_millis_cmd) > max_inactive_time ) if(max_inactive_time) kill(debug); }
+inline void manage_inactivity(byte debug) {
+if( (millis()-previous_millis_cmd) > max_inactive_time ) if(max_inactive_time) kill(debug);
+if( (millis()-previous_millis_cmd) > stepper_inactive_time ) if(stepper_inactive_time) { disable_x(); disable_y(); disable_z(); disable_e(); }
+}