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
path: root/src
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2017-01-28 20:58:18 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-01-28 20:59:09 +0300
commit2984b6ac327b3934a9b5df5d8d2d9e8e9f1256ef (patch)
tree92ffb507d194382faa3c7e8f37ae3735de9bdadc /src
parentdff384dcc7ebf73f3bfbf83f6056aa8c589dd3fb (diff)
Version 1.17d
Fixed bug with resetting extruder position introduced at version 1.17c+1 G2, G3 and M206 now take account of the mm/inches setting Fixed bug with second SD card on Duet085 and RADDS builds M102 command generated by D3D is now sliently ignored
Diffstat (limited to 'src')
-rw-r--r--src/GCodes/GCodes.cpp36
-rw-r--r--src/GCodes/GCodes2.cpp5
-rw-r--r--src/Version.h4
3 files changed, 27 insertions, 18 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index bf5f2d95..35c8714e 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -983,11 +983,11 @@ void GCodes::Pop(GCodeBuffer& gb)
}
// Set up the extrusion and feed rate of a move for the Move class
-// 'moveType' is the S parameter in the G0 or G1 command, or zero for a G2 or G3 command
+// 'moveType' is the S parameter in the G0 or G1 command, or zero for a G2 or G3 command, or -1 for a G92 command
// Returns true if this gcode is valid so far, false if it should be discarded
bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, int moveType)
{
- // Zero every extruder drive as some drives may not be changed
+ // Zero every extruder drive as some drives may not be moved
for (size_t drive = numAxes; drive < DRIVES; drive++)
{
moveBuffer.coords[drive] = 0.0;
@@ -1004,9 +1004,9 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, int moveType)
moveBuffer.feedRate = gb.MachineState().feedrate;
// First do extrusion, and check, if we are extruding, that we have a tool to extrude with
- Tool* const tool = reprap.GetCurrentTool();
if (gb.Seen(extrudeLetter))
{
+ Tool* const tool = reprap.GetCurrentTool();
if (tool == nullptr)
{
platform->Message(GENERIC_MESSAGE, "Attempting to extrude with no tool selected.\n");
@@ -1057,7 +1057,7 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, int moveType)
if (eMoveCount != mc)
{
platform->MessageF(GENERIC_MESSAGE, "Wrong number of extruder drives for the selected tool: %s\n", gb.Buffer());
- return 0;
+ return false;
}
for (size_t eDrive = 0; eDrive < eMoveCount; eDrive++)
@@ -1066,7 +1066,6 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, int moveType)
const float moveArg = eMovement[eDrive] * distanceScale;
if (moveType == -1)
{
- moveBuffer.coords[drive + numAxes] = moveArg;
lastRawExtruderPosition[drive] = moveArg;
}
else
@@ -1090,7 +1089,7 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, int moveType)
// Move expects all axis movements to be absolute, and all extruder drive moves to be relative. This function serves that.
// 'moveType' is the S parameter in the G0 or G1 command, or -1 if we are doing G92.
// For regular (type 0) moves, we apply limits and do X axis mapping.
-// Returns the number of segments if we have a legal move, 1 if we are doing G92, or zero if this gcode should be discarded
+// Returns the number of segments in the move
unsigned int GCodes::LoadMoveBufferFromGCode(GCodeBuffer& gb, int moveType)
{
const Tool * const currentTool = reprap.GetCurrentTool();
@@ -1155,6 +1154,7 @@ unsigned int GCodes::LoadMoveBufferFromGCode(GCodeBuffer& gb, int moveType)
if (axis != Z_AXIS && moveType == 0)
{
+ // Segment the move if necessary
const HeightMap& heightMap = reprap.GetMove()->AccessBedProbeGrid();
if (heightMap.UsingHeightMap())
{
@@ -1327,24 +1327,24 @@ int GCodes::SetUpMove(GCodeBuffer& gb, StringRef& reply)
// We already have the movement lock and the last move has gone
bool GCodes::DoArcMove(GCodeBuffer& gb, bool clockwise)
{
- memcpy(moveBuffer.initialCoords, moveBuffer.coords, numAxes * sizeof(moveBuffer.initialCoords[0]));
-
// Get the axis parameters. X Y I J are compulsory, Z is optional.
if (!gb.Seen('X')) return true;
- const float xParam = gb.GetFValue();
+ const float xParam = gb.GetFValue() * distanceScale;
if (!gb.Seen('Y')) return true;
- const float yParam = gb.GetFValue();
+ const float yParam = gb.GetFValue() * distanceScale;
if (!gb.Seen('I')) return true;
- const float iParam = gb.GetFValue();
+ const float iParam = gb.GetFValue() * distanceScale;
if (!gb.Seen('J')) return true;
- const float jParam = gb.GetFValue();
+ const float jParam = gb.GetFValue() * distanceScale;
// Adjust them for relative/absolute coordinates, tool offset, and X axis mapping. Also get the optional Z parameter
const Tool * const currentTool = reprap.GetCurrentTool();
const bool axesRelative = gb.MachineState().axesRelative;
+ memcpy(moveBuffer.initialCoords, moveBuffer.coords, numAxes * sizeof(moveBuffer.initialCoords[0]));
+
if (gb.Seen('Z'))
{
- const float zParam = gb.GetFValue();
+ const float zParam = gb.GetFValue() * distanceScale;
if (axesRelative)
{
moveBuffer.coords[Z_AXIS] += zParam;
@@ -1635,9 +1635,13 @@ bool GCodes::SetPositions(GCodeBuffer& gb)
return false;
}
- const bool ok = LoadMoveBufferFromGCode(gb, -1);
- if (ok && includingAxes)
+ // Handle any E parameter in the G92 command. If we get an error, ignore it and do the axes anyway.
+ (void)LoadExtrusionAndFeedrateFromGCode(gb, -1);
+
+ if (includingAxes)
{
+ (void)LoadMoveBufferFromGCode(gb, -1);
+
#if SUPPORT_ROLAND
if (reprap.GetRoland()->Active())
{
@@ -1675,7 +1679,7 @@ bool GCodes::OffsetAxes(GCodeBuffer& gb)
record[drive] = moveBuffer.coords[drive];
if (gb.Seen(axisLetters[drive]))
{
- cannedMoveCoords[drive] = gb.GetFValue();
+ cannedMoveCoords[drive] = gb.GetFValue() * distanceScale;
cannedMoveType[drive] = CannedMoveType::relative;
}
}
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 86690abf..0d136eb6 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -905,6 +905,11 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
result = RetractFilament(gb, false);
break;
+ case 102:
+ // S3D generates this command once at the start of he print job if firmware retraction is enabled.
+ // It's not documented, so we just ignore it rather than generate an error message.
+ break;
+
case 103: // Retract
if (!LockMovement(gb))
{
diff --git a/src/Version.h b/src/Version.h
index 32afea09..51ed7b46 100644
--- a/src/Version.h
+++ b/src/Version.h
@@ -9,11 +9,11 @@
#define SRC_VERSION_H_
#ifndef VERSION
-# define VERSION "1.17c+2"
+# define VERSION "1.17d"
#endif
#ifndef DATE
-# define DATE "2017-01-24"
+# define DATE "2017-01-28"
#endif
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman"