Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GCodes.cpp25
-rw-r--r--Move.h2
-rw-r--r--Platform.h21
3 files changed, 35 insertions, 13 deletions
diff --git a/GCodes.cpp b/GCodes.cpp
index 691c3a41..1e80bbb1 100644
--- a/GCodes.cpp
+++ b/GCodes.cpp
@@ -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:");
diff --git a/Move.h b/Move.h
index 1ebc3cf5..6edc14be 100644
--- a/Move.h
+++ b/Move.h
@@ -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;
};
//********************************************************************************************************
diff --git a/Platform.h b/Platform.h
index 0fe82145..cf4fd95f 100644
--- a/Platform.h
+++ b/Platform.h
@@ -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)