Fix wrong direction for config based trim values
authorJim Morris <morris@wolfman.com>
Mon, 5 May 2014 21:14:40 +0000 (14:14 -0700)
committerJim Morris <morris@wolfman.com>
Mon, 5 May 2014 21:14:40 +0000 (14:14 -0700)
src/modules/tools/endstops/Endstops.cpp

index 3ba467c..f712ac0 100644 (file)
@@ -180,9 +180,9 @@ void Endstops::on_config_reload(void *argument)
 
     // endstop trim used by deltas to do soft adjusting, in mm, negate depending on homing direction
     // eg on a delta homing to max, a negative trim value will move the carriage down, and a positive will move it up
-    int dirx = (this->home_direction[0] ? 1 : -1);
-    int diry = (this->home_direction[1] ? 1 : -1);
-    int dirz = (this->home_direction[2] ? 1 : -1);
+    int dirx = (this->home_direction[0] ? -1 : 1);
+    int diry = (this->home_direction[1] ? -1 : 1);
+    int dirz = (this->home_direction[2] ? -1 : 1);
     this->trim_mm[0] = THEKERNEL->config->value(alpha_trim_checksum )->by_default(0  )->as_number() * dirx;
     this->trim_mm[1] = THEKERNEL->config->value(beta_trim_checksum  )->by_default(0  )->as_number() * diry;
     this->trim_mm[2] = THEKERNEL->config->value(gamma_trim_checksum )->by_default(0  )->as_number() * dirz;