diff options
-rw-r--r-- | GCodes.cpp | 25 | ||||
-rw-r--r-- | Move.h | 2 | ||||
-rw-r--r-- | Platform.h | 21 |
3 files changed, 35 insertions, 13 deletions
@@ -682,9 +682,28 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb) drivesRelative = true; break; - case 92: - platform->Message(HOST_MESSAGE, "Set steps/mm received\n"); - break; + case 92: // Set steps/mm for each axis + if(reprap.debug()) + platform->GetLine()->Write("Steps/mm: "); + for(uint8_t i = 0; i < DRIVES; i++) + { + if(gb->Seen(gCodeLetters[i])) + { + value = gb->GetFValue(); + }else{ + value = -1; + } + float stepsPerUnit = platform->DriveStepsPerUnit(i,value); + if(reprap.debug()) + { + platform->GetLine()->Write(gCodeLetters[i]); + platform->GetLine()->Write(ftoa(NULL,stepsPerUnit,3)); + platform->GetLine()->Write(" "); + } + } + if(reprap.debug()) + platform->GetLine()->Write("\n"); + break; case 105: // Deprecated... platform->GetLine()->Write("ok T:"); @@ -146,6 +146,7 @@ class Move void InverseTransform(float move[]); void Diagnostics(); float ComputeCurrentCoordinate(int8_t drive, LookAhead* la, DDA* runningDDA); + bool zProbing; friend class DDA; @@ -189,7 +190,6 @@ class Move float extruderStepDistances[(1<<(DRIVES-AXES))]; // NB - limits us to 5 extruders float aX, aY, aC; float lastZHit; - bool zProbing; }; //******************************************************************************************************** @@ -436,7 +436,7 @@ class Platform void Step(byte drive); void Disable(byte drive); // There is no drive enable; drives get enabled automatically the first time they are used. void SetMotorCurrent(byte drive, float current); - float DriveStepsPerUnit(int8_t drive); + float DriveStepsPerUnit(int8_t drive, float value); float Acceleration(int8_t drive, float value); float MaxFeedrate(int8_t drive); float InstantDv(int8_t drive); @@ -658,8 +658,10 @@ inline void Line::Write(char* b) // Drive the RepRap machine - Movement -inline float Platform::DriveStepsPerUnit(int8_t drive) +inline float Platform::DriveStepsPerUnit(int8_t drive, float value = -1) { + if(drive >= 0 && drive < DRIVES && value > 0) + driveStepsPerUnit[drive] = value; return driveStepsPerUnit[drive]; } @@ -739,13 +741,14 @@ inline float Platform::HomeFeedRate(int8_t drive) inline EndStopHit Platform::Stopped(int8_t drive) { - if(drive == Z_AXIS) - { - if(ZProbe() < 0) - return lowHit; - else - return noStop; - } +// if(drive == Z_AXIS && reprap.GetMove()->zProbing) + // if(drive == Z_AXIS) + // { + // if(ZProbe() < 0) + // return lowHit; + // else + // return noStop; + // } if(lowStopPins[drive] >= 0) { if(digitalRead(lowStopPins[drive]) == ENDSTOP_HIT) |