Merge pull request #382 from wolfmanjm/upstreamedge
[clinton/Smoothieware.git] / src / modules / tools / endstops / Endstops.cpp
index 2e67cae..8afda5a 100644 (file)
@@ -276,7 +276,7 @@ void Endstops::do_homing(char axes_to_move)
                 if (this->trim[c - 'X'] < 0) inverted_dir = !inverted_dir;
                 this->feed_rate[c - 'X']= this->slow_rates[c - 'X'];
                 this->steppers[c - 'X']->set_speed(0);
-                this->steppers[c - 'X']->move(inverted_dir, this->trim[c - 'X']);
+                this->steppers[c - 'X']->move(inverted_dir, abs(this->trim[c - 'X']));
             }
         }
 
@@ -476,7 +476,8 @@ void Endstops::on_gcode_received(void *argument)
                 const char *my = this->home_direction[1] ? "min" : "max";
                 const char *mz = this->home_direction[2] ? "min" : "max";
 
-                gcode->stream->printf("X %s:%d Y %s:%d Z %s:%d\n", mx, this->pins[px].get(), my, this->pins[py].get(), mz, this->pins[pz].get());
+                gcode->stream->printf("X %s:%d Y %s:%d Z %s:%d", mx, this->pins[px].get(), my, this->pins[py].get(), mz, this->pins[pz].get());
+                gcode->add_nl= true;
                 gcode->mark_as_taken();
             }
             break;
@@ -513,7 +514,7 @@ void Endstops::on_gcode_received(void *argument)
             break;
 
 
-            case 666: { // M666 - set trim for each axis in mm
+            case 666: { // M666 - set trim for each axis in mm, NB negative mm and positive steps trim is down
                 float mm[3];
                 trim2mm(mm);