fix retry after timeout bug

pull/100/head
gabrielburnworth 2018-01-05 18:20:01 -08:00
parent b86873d5cc
commit b0ad9e9902
2 changed files with 9 additions and 5 deletions

View File

@ -146,7 +146,8 @@ int GCodeProcessor::execute(Command *command)
// Execute command with retry
CurrentState::getInstance()->setLastError(0);
while (attempt < 1 || (!emergencyStop && attempt < maximumAttempts && execution != 0))
while (attempt < 1 || (!emergencyStop && attempt < maximumAttempts && execution != 0 && execution != 2))
// error 2 is timeout error: stop movement retries
{
if (LOGGING || debugMessages)

View File

@ -536,19 +536,22 @@ int StepperControl::moveToCoords(double xDestScaled, double yDestScaled, double
{
serialBuffer += "R99 timeout X axis\r\n";
//Serial.print("R99 timeout X axis\r\n");
error = 1;
// error 2 is timeout error: stop movement retries
error = 2;
}
if (axisActive[1] == true && ((millis() >= timeStart && millis() - timeStart > timeOut[0] * 1000) || (millis() < timeStart && millis() > timeOut[0] * 1000)))
{
serialBuffer += "R99 timeout Y axis\r\n";
//Serial.print("R99 timeout Y axis\r\n");
error = 1;
// error 2 is timeout error: stop movement retries
error = 2;
}
if (axisActive[2] == true && ((millis() >= timeStart && millis() - timeStart > timeOut[0] * 1000) || (millis() < timeStart && millis() > timeOut[0] * 1000)))
{
serialBuffer += "R99 timeout Z axis\r\n";
//Serial.print("R99 timeout Z axis\r\n");
error = 1;
// error 2 is timeout error: stop movement retries
error = 2;
}
// Check if there is an emergency stop command
@ -578,7 +581,7 @@ int StepperControl::moveToCoords(double xDestScaled, double yDestScaled, double
}
}
if (error == 1)
if (error != 0)
{
serialBuffer += "R99 error\r\n";
//Serial.print("R99 error\r\n");