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-10-28 13:22:22 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-10-28 13:22:39 +0300
commit97df14938ad64b4c24870a2619494104a345c484 (patch)
tree448ee01896859e633fbaa17a6bf64c48ca128ff2 /src
parent1b00da46a6160137711080fc2b5e72b0839edf9e (diff)
Version 1.20beta3 provisional
Fixed CoreXY homing bug Fixed M585 bug Fixed motor idle timeout bug Fixed bug that causes additional M307 lines ot be written to config-override.g
Diffstat (limited to 'src')
-rw-r--r--src/DuetNG/HttpResponder.cpp11
-rw-r--r--src/GCodes/GCodeMachineState.h2
-rw-r--r--src/GCodes/GCodes.cpp8
-rw-r--r--src/GCodes/GCodes2.cpp110
-rw-r--r--src/IoPort.cpp2
-rw-r--r--src/IoPort.h2
-rw-r--r--src/Libraries/General/IP4String.cpp2
-rw-r--r--src/Libraries/General/IP4String.h2
-rw-r--r--src/Movement/DDA.cpp2
-rw-r--r--src/Movement/Kinematics/ScaraKinematics.cpp4
-rw-r--r--src/Movement/Move.cpp2
-rw-r--r--src/Platform.cpp18
-rw-r--r--src/RepRap.cpp17
-rw-r--r--src/Version.h4
14 files changed, 102 insertions, 84 deletions
diff --git a/src/DuetNG/HttpResponder.cpp b/src/DuetNG/HttpResponder.cpp
index cb25d9d8..d48e57d8 100644
--- a/src/DuetNG/HttpResponder.cpp
+++ b/src/DuetNG/HttpResponder.cpp
@@ -462,6 +462,10 @@ bool HttpResponder::GetJsonResponse(const char* request, OutputBuffer *&response
}
}
+ // Client has been logged in
+ response->printf("{\"err\":0,\"sessionTimeout\":%" PRIu32 ",\"boardType\":\"%s\"}", HttpSessionTimeout, GetPlatform().GetBoardString());
+ reprap.GetPlatform().MessageF(LogMessage, "HTTP client %s login succeeded\n", IP4String(GetRemoteIP()).c_str());
+
// See if we can update the current RTC date and time
const char* const timeString = GetKeyValue("time");
if (timeString != nullptr && !GetPlatform().IsDateTimeSet())
@@ -470,14 +474,9 @@ bool HttpResponder::GetJsonResponse(const char* request, OutputBuffer *&response
memset(&timeInfo, 0, sizeof(timeInfo));
if (strptime(timeString, "%Y-%m-%dT%H:%M:%S", &timeInfo) != nullptr)
{
- time_t newTime = mktime(&timeInfo);
- GetPlatform().SetDateTime(newTime);
+ GetPlatform().SetDateTime(mktime(&timeInfo));
}
}
-
- // Client has been logged in
- response->printf("{\"err\":0,\"sessionTimeout\":%" PRIu32 ",\"boardType\":\"%s\"}", HttpSessionTimeout, GetPlatform().GetBoardString());
- reprap.GetPlatform().MessageF(LogMessage, "HTTP client %s login succeeded\n", IP4String(GetRemoteIP()).c_str());
}
else if (!CheckAuthenticated())
{
diff --git a/src/GCodes/GCodeMachineState.h b/src/GCodes/GCodeMachineState.h
index 0848f369..a22e0885 100644
--- a/src/GCodes/GCodeMachineState.h
+++ b/src/GCodes/GCodeMachineState.h
@@ -54,7 +54,7 @@ enum class GCodeState : uint8_t
gridProbing3,
gridProbing4,
gridProbing5,
- gridprobing6,
+ gridProbing6,
// These next 8 must be contiguous
probingAtPoint0,
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index 1e5777f9..92178fd4 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -830,7 +830,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, StringRef& reply)
}
break;
- case GCodeState::gridprobing6:
+ case GCodeState::gridProbing6:
// Finished probing the grid, and retracted the probe if necessary
{
float mean, deviation;
@@ -3096,10 +3096,8 @@ GCodeResult GCodes::DoDwell(GCodeBuffer& gb)
simulationTime += (float)dwell * 0.001;
return GCodeResult::ok;
}
- else
- {
- return DoDwellTime(gb, (uint32_t)dwell);
- }
+
+ return DoDwellTime(gb, (uint32_t)dwell);
}
GCodeResult GCodes::DoDwellTime(GCodeBuffer& gb, uint32_t dwellMillis)
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 5920f434..ac893733 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -29,7 +29,7 @@
# include "FirmwareUpdater.h"
#endif
-#include <algorithm> // for std::swap
+#include <utility> // for std::swap
// If the code to act on is completed, this returns true,
// otherwise false. It is called repeatedly for a given
@@ -3358,67 +3358,69 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
break;
}
- if (LockMovementAndWaitForStandstill(gb))
+ if (!LockMovementAndWaitForStandstill(gb))
{
- for (size_t axis = 0; axis < numTotalAxes; axis++)
+ return false;
+ }
+
+ for (size_t axis = 0; axis < numTotalAxes; axis++)
+ {
+ if (gb.Seen(axisLetters[axis]))
{
- if (gb.Seen(axisLetters[axis]))
+ // Get parameters first and check them
+ const int endStopToUse = gb.Seen('E') ? gb.GetIValue() : 0;
+ if (endStopToUse < 0 || endStopToUse > (int)DRIVES)
{
- // Get parameters first and check them
- const int endStopToUse = gb.Seen('E') ? gb.GetIValue() : 0;
- if (endStopToUse < 0 || endStopToUse > (int)DRIVES)
- {
- reply.copy("Invalid endstop number");
- result = GCodeResult::error;
- break;
- }
+ reply.copy("Invalid endstop number");
+ result = GCodeResult::error;
+ break;
+ }
- // Save the current axis coordinates
- memcpy(toolChangeRestorePoint.moveCoords, currentUserPosition, ARRAY_SIZE(currentUserPosition) * sizeof(currentUserPosition[0]));
+ // Save the current axis coordinates
+ memcpy(toolChangeRestorePoint.moveCoords, currentUserPosition, ARRAY_SIZE(currentUserPosition) * sizeof(currentUserPosition[0]));
- // Prepare another move similar to G1 .. S3
- moveBuffer.moveType = 3;
- if (endStopToUse == 0)
- {
- moveBuffer.endStopsToCheck = 0;
- SetBit(moveBuffer.endStopsToCheck, axis);
- }
- else
- {
- moveBuffer.endStopsToCheck = UseSpecialEndstop;
- SetBit(moveBuffer.endStopsToCheck, endStopToUse);
- }
- moveBuffer.xAxes = DefaultXAxisMapping;
- moveBuffer.yAxes = DefaultYAxisMapping;
- moveBuffer.usePressureAdvance = false;
- moveBuffer.filePos = noFilePosition;
- moveBuffer.canPauseAfter = false;
- moveBuffer.canPauseBefore = true;
-
- // Decide which way and how far to go
- const float axisLength = platform.AxisMaximum(axis) - platform.AxisMinimum(axis) + 5.0;
- moveBuffer.coords[axis] = (gb.Seen('S') && gb.GetIValue() == 1) ? axisLength * -1.0 : axisLength;
-
- // Zero every extruder drive
- for (size_t drive = numTotalAxes; drive < DRIVES; drive++)
- {
- moveBuffer.coords[drive] = 0.0;
- }
- moveBuffer.hasExtrusion = false;
+ // Prepare another move similar to G1 .. S3
+ moveBuffer.moveType = 3;
+ if (endStopToUse == 0)
+ {
+ moveBuffer.endStopsToCheck = 0;
+ SetBit(moveBuffer.endStopsToCheck, axis);
+ }
+ else
+ {
+ moveBuffer.endStopsToCheck = UseSpecialEndstop;
+ SetBit(moveBuffer.endStopsToCheck, endStopToUse);
+ }
+ moveBuffer.xAxes = DefaultXAxisMapping;
+ moveBuffer.yAxes = DefaultYAxisMapping;
+ moveBuffer.usePressureAdvance = false;
+ moveBuffer.filePos = noFilePosition;
+ moveBuffer.canPauseAfter = false;
+ moveBuffer.canPauseBefore = true;
- // Deal with feed rate
- if (gb.Seen(feedrateLetter))
- {
- const float rate = gb.GetFValue() * distanceScale;
- gb.MachineState().feedrate = rate * SecondsToMinutes; // don't apply the speed factor to homing and other special moves
- }
- moveBuffer.feedRate = gb.MachineState().feedrate;
+ // Decide which way and how far to go
+ const float axisLength = platform.AxisMaximum(axis) - platform.AxisMinimum(axis) + 5.0;
+ moveBuffer.coords[axis] = (gb.Seen('S') && gb.GetIValue() == 1) ? axisLength * -1.0 : axisLength;
- // Kick off new movement
- segmentsLeft = 1;
- gb.SetState(GCodeState::probingToolOffset);
- break;
+ // Zero every extruder drive
+ for (size_t drive = numTotalAxes; drive < DRIVES; drive++)
+ {
+ moveBuffer.coords[drive] = 0.0;
}
+ moveBuffer.hasExtrusion = false;
+
+ // Deal with feed rate
+ if (gb.Seen(feedrateLetter))
+ {
+ const float rate = gb.GetFValue() * distanceScale;
+ gb.MachineState().feedrate = rate * SecondsToMinutes; // don't apply the speed factor to homing and other special moves
+ }
+ moveBuffer.feedRate = gb.MachineState().feedrate;
+
+ // Kick off new movement
+ segmentsLeft = 1;
+ gb.SetState(GCodeState::probingToolOffset);
+ break;
}
}
break;
diff --git a/src/IoPort.cpp b/src/IoPort.cpp
index 0ce968bc..d5b81821 100644
--- a/src/IoPort.cpp
+++ b/src/IoPort.cpp
@@ -1,5 +1,5 @@
/*
- * LogicalPort.cpp
+ * IoPort.cpp
*
* Created on: 30 Sep 2017
* Author: David
diff --git a/src/IoPort.h b/src/IoPort.h
index 94e9f4cf..17182a2f 100644
--- a/src/IoPort.h
+++ b/src/IoPort.h
@@ -1,5 +1,5 @@
/*
- * LogicalPort.h
+ * IoPort.h
*
* Created on: 30 Sep 2017
* Author: David
diff --git a/src/Libraries/General/IP4String.cpp b/src/Libraries/General/IP4String.cpp
index 5b4091be..7f03e836 100644
--- a/src/Libraries/General/IP4String.cpp
+++ b/src/Libraries/General/IP4String.cpp
@@ -1,5 +1,5 @@
/*
- * IPString.cpp
+ * IP4String.cpp
*
* Created on: 19 Sep 2017
* Author: David
diff --git a/src/Libraries/General/IP4String.h b/src/Libraries/General/IP4String.h
index 3fa84d9a..371401b1 100644
--- a/src/Libraries/General/IP4String.h
+++ b/src/Libraries/General/IP4String.h
@@ -1,5 +1,5 @@
/*
- * IPString.h
+ * IP4String.h
*
* Created on: 19 Sep 2017
* Author: David
diff --git a/src/Movement/DDA.cpp b/src/Movement/DDA.cpp
index 896e588c..40b648b7 100644
--- a/src/Movement/DDA.cpp
+++ b/src/Movement/DDA.cpp
@@ -1262,7 +1262,6 @@ void DDA::CheckEndstops(Platform& platform)
if ((endStopsToCheck & UseSpecialEndstop) != 0) // use only one (probably non-default) endstop while probing a tool offset
{
MoveAborted();
- return;
}
else
{
@@ -1271,7 +1270,6 @@ void DDA::CheckEndstops(Platform& platform)
if (endStopsToCheck == 0 || kin.QueryTerminateHomingMove(drive))
{
MoveAborted(); // no more endstops to check, or this axis uses shared motors, so stop the entire move
- return;
}
else
{
diff --git a/src/Movement/Kinematics/ScaraKinematics.cpp b/src/Movement/Kinematics/ScaraKinematics.cpp
index 9a5580b0..2bfbc5b3 100644
--- a/src/Movement/Kinematics/ScaraKinematics.cpp
+++ b/src/Movement/Kinematics/ScaraKinematics.cpp
@@ -254,7 +254,7 @@ bool ScaraKinematics::LimitPosition(float coords[], size_t numVisibleAxes, AxesB
}
// The requested position was not reachable
- if (isnan(theta))
+ if (std::isnan(theta))
{
// We are radius-limited
float x = coords[X_AXIS] + xOffset;
@@ -286,7 +286,7 @@ bool ScaraKinematics::LimitPosition(float coords[], size_t numVisibleAxes, AxesB
}
// Recalculate theta and psi, but don't allow arm mode changes this time
- if (!CalculateThetaAndPsi(coords, true, theta, psi, armMode) && !isnan(theta))
+ if (!CalculateThetaAndPsi(coords, true, theta, psi, armMode) && !std::isnan(theta))
{
// Radius is in range but at least one arm angle isn't
cachedTheta = theta = constrain<float>(theta, thetaLimits[0], thetaLimits[1]);
diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp
index 4304db5d..6fa2ebdc 100644
--- a/src/Movement/Move.cpp
+++ b/src/Movement/Move.cpp
@@ -271,7 +271,7 @@ void Move::Spin()
}
moveState = MoveState::executing;
}
- else if (simulationMode != 0)
+ else if (simulationMode == 0)
{
if (moveState == MoveState::executing && !reprap.GetGCodes().IsPaused())
{
diff --git a/src/Platform.cpp b/src/Platform.cpp
index b9a79ad4..57307c0a 100644
--- a/src/Platform.cpp
+++ b/src/Platform.cpp
@@ -2296,10 +2296,22 @@ EndStopHit Platform::GetZProbeResult() const
// Write the platform parameters to file
bool Platform::WritePlatformParameters(FileStore *f) const
{
- bool ok = WriteAxisLimits(f, axisMinimaProbed, axisMinima, 1);
- if (ok)
+ bool ok;
+ if (axisMinimaProbed != 0 || axisMaximaProbed != 0)
+ {
+ ok = f->Write("; Probed axis limits\n");
+ if (ok)
+ {
+ ok = WriteAxisLimits(f, axisMinimaProbed, axisMinima, 1);
+ }
+ if (ok)
+ {
+ ok = WriteAxisLimits(f, axisMaximaProbed, axisMaxima, 0);
+ }
+ }
+ else
{
- ok = WriteAxisLimits(f, axisMaximaProbed, axisMaxima, 0);
+ ok = true;
}
#if 0 // From version 1.20 we no longer write the Z probe parameters, but keep the code for now in case too many users complain
diff --git a/src/RepRap.cpp b/src/RepRap.cpp
index 2618d31a..9ae86b5f 100644
--- a/src/RepRap.cpp
+++ b/src/RepRap.cpp
@@ -1755,13 +1755,22 @@ bool RepRap::WriteToolSettings(FileStore *f) const
// Save some information in config-override.g
bool RepRap::WriteToolParameters(FileStore *f) const
{
- bool ok = true;
+ bool ok = true, written = false;
for (const Tool *t = toolList; ok && t != nullptr; t = t->Next())
{
const AxesBitmap axesProbed = t->GetAxisOffsetsProbed();
if (axesProbed != 0)
{
- scratchString.printf("G10 P%d", t->Number());
+ if (written)
+ {
+ scratchString.Clear();
+ }
+ else
+ {
+ scratchString.copy("; Probed tool offsets\n");
+ written = true;
+ }
+ scratchString.catf("G10 P%d", t->Number());
for (size_t axis = 0; axis < MaxAxes; ++axis)
{
if (IsBitSet(axesProbed, axis))
@@ -1769,9 +1778,9 @@ bool RepRap::WriteToolParameters(FileStore *f) const
scratchString.catf(" %c%.2f", GCodes::axisLetters[axis], (double)(t->GetOffset(axis)));
}
}
+ scratchString.cat('\n');
+ ok = f->Write(scratchString.Pointer());
}
- scratchString.cat('\n');
- ok = f->Write(scratchString.Pointer());
}
return ok;
}
diff --git a/src/Version.h b/src/Version.h
index 999670c4..41e3a9dc 100644
--- a/src/Version.h
+++ b/src/Version.h
@@ -9,11 +9,11 @@
#define SRC_VERSION_H_
#ifndef VERSION
-# define VERSION "1.20beta2+1"
+# define VERSION "1.20beta3"
#endif
#ifndef DATE
-# define DATE "2017-10-26"
+# define DATE "2017-10-28"
#endif
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman"