summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-06-23 22:15:38 +0000
committerkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-06-23 22:15:38 +0000
commit80a512741ee69f4961abc12e282ff3ac2feb844c (patch)
treeaa0e336fae26d9a499d27ec037a69013aa53aebc
parenta50f7ed3b4f75ae31b4122b3ba2521d707527c0c (diff)
downloadreprap-backup-80a512741ee69f4961abc12e282ff3ac2feb844c.tar.gz
reprap-backup-80a512741ee69f4961abc12e282ff3ac2feb844c.zip
Added define to optionally disable min/max endstops
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@1654 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rw-r--r--trunk/reprap/firmware/Arduino/GCode_Interpreter/stepper_control.pde10
1 files changed, 7 insertions, 3 deletions
diff --git a/trunk/reprap/firmware/Arduino/GCode_Interpreter/stepper_control.pde b/trunk/reprap/firmware/Arduino/GCode_Interpreter/stepper_control.pde
index b709f1b4..0860287f 100644
--- a/trunk/reprap/firmware/Arduino/GCode_Interpreter/stepper_control.pde
+++ b/trunk/reprap/firmware/Arduino/GCode_Interpreter/stepper_control.pde
@@ -148,12 +148,16 @@ bool can_step(byte min_pin, byte max_pin, long current, long target, byte direct
//stop us if we're on target
if (target == current)
return false;
+#if ENDSTOPS_MIN_ENABLED == 1
//stop us if we're at home and still going
else if (read_switch(min_pin) && !direction)
return false;
+#endif
+#if ENDSTOPS_MAX_ENABLED == 1
//stop us if we're at max and still going
- else if (read_switch(max_pin) && direction)
- return false;
+ else if (read_switch(max_pin) && direction)
+ return false;
+#endif
//default to being able to step
return true;
@@ -169,7 +173,7 @@ void do_step(byte step_pin)
bool read_switch(byte pin)
{
//dual read as crude debounce
- #if SENSORS_INVERTING == 1
+ #if ENDSTOPS_INVERTING == 1
return !digitalRead(pin) && !digitalRead(pin);
#else
return digitalRead(pin) && digitalRead(pin);