Report change of pin on emergency stop, report home succesful

pull/97/head
Tim Evers 2017-11-11 16:43:17 +01:00
parent f621d10a4c
commit b6c29e3a69
4 changed files with 27 additions and 1 deletions

View File

@ -24,6 +24,10 @@
const char COMM_REPORT_CMD_ECHO[4] = { 'R', '0', '8', '\0' };
const char COMM_REPORT_BAD_CMD[4] = { 'R', '0', '9', '\0' };
const char COMM_REPORT_HOMED_X[4] = { 'R', '1', '1', '\0' };
const char COMM_REPORT_HOMED_Y[4] = { 'R', '1', '2', '\0' };
const char COMM_REPORT_HOMED_Z[4] = { 'R', '1', '3', '\0' };
const char COMM_REPORT_ENCODER_SCALED[4] = { 'R', '8', '4', '\0' };
const char COMM_REPORT_ENCODER_RAW[4] = { 'R', '8', '5', '\0' };

View File

@ -61,6 +61,7 @@ void PinControl::resetPinsUsed()
Serial.print("\r\n");
digitalWrite(pinNr, false);
readValue(pinNr, 0);
pinWritten[0][pinNr] = false;
}
if (pinWritten[1][pinNr])
@ -71,6 +72,7 @@ void PinControl::resetPinsUsed()
Serial.print("\r\n");
analogWrite(pinNr, 0);
readValue(pinNr, 1);
pinWritten[1][pinNr] = false;
}
}

View File

@ -624,6 +624,26 @@ int StepperControl::moveToCoords(double xDestScaled, double yDestScaled, double
serialBufferEmpty();
Serial.print("R99 stopped\r\n");
// Send feedback for homing
if (xHome && !error && !emergencyStop)
{
Serial.print(COMM_REPORT_HOMED_X);
CurrentState::getInstance()->printQAndNewLine();
}
if (yHome && !error && !emergencyStop)
{
Serial.print(COMM_REPORT_HOMED_Y);
CurrentState::getInstance()->printQAndNewLine();
}
if (zHome && !error && !emergencyStop)
{
Serial.print(COMM_REPORT_HOMED_Z);
CurrentState::getInstance()->printQAndNewLine();
}
// Stop motors
axisSubStep[0] = COMM_REPORT_MOVE_STATUS_STOP_MOTOR;

View File

@ -174,7 +174,7 @@
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties vm.programmer_name="avrisp" arduino.upload.port="COM6" />
<UserProperties vm.programmer_name="avrisp" arduino.upload.port="COM4" />
</VisualStudio>
</ProjectExtensions>
</Project>