Error on home if max-soft-limit <= min-soft-limit + 1. #139
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 23 Jun 2018 19:21:29 +0000 (12:21 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 23 Jun 2018 19:21:29 +0000 (12:21 -0700)
CHANGELOG.md
src/py/bbctrl/State.py

index 2b264aa2b512193463f197c98e48123d65ee839b..3a2d134970fb0377f9b57a3759092d2efc9d398c 100644 (file)
@@ -1,6 +1,9 @@
 Buildbotics CNC Controller Firmware Changelog
 ==============================================
 
+## v0.3.25
+ - Error on home if max-soft-limit <= min-soft-limit + 1. #139
+
 ## v0.3.24
  - Added unhome button on axis position popup.
  - Ignore soft limits of max <= min.
index 5c390a6fb2e88a74ac81231d58b959f490d5676f..2bee646292eba6d114683da349d5a6407ca2aef4 100644 (file)
@@ -201,6 +201,12 @@ class State(object):
         if mode == 'switch-max' and not int(self.get(axis + '_xs')):
             return 'Configured for max switch but switch is disabled'
 
+        softMin = int(self.get(axis + '_tn'))
+        softMax = int(self.get(axis + '_tm'))
+        if softMax <= softMin + 1:
+            return 'max-soft-limit must be at least 1mm greater ' \
+                'than min-soft-limit'
+
 
     def motor_enabled(self, motor):
         return bool(int(self.vars.get('%dpm' % motor, 0)))