Fixes to get serial interface working

1. Fixed 2 bugs that prevented the aux interface working.

2. Fixed incorrect format in M105 S2 command
This commit is contained in:
David Crocker 2014-11-14 21:25:35 +00:00
parent 19d8e625ea
commit 01e470d8f4
5 changed files with 14 additions and 9 deletions

View file

@ -24,8 +24,8 @@ Licence: GPL
#define CONFIGURATION_H
#define NAME "RepRapFirmware"
#define VERSION "0.78w-dc42"
#define DATE "2014-11-10"
#define VERSION "0.78x-dc42"
#define DATE "2014-11-14"
#define AUTHORS "reprappro, dc42, zpl"
// Other firmware that we might switch to be compatible with.

View file

@ -249,7 +249,7 @@ void GCodes::Spin()
platform->GetAux()->Read(b);
if (auxGCode->Put(b)) // add char to buffer and test whether the gcode is complete
{
auxGCode->SetFinished(ActOnCode(serialGCode));
auxGCode->SetFinished(ActOnCode(auxGCode));
break; // stop after receiving a complete gcode in case we haven't finished processing it
}
++i;
@ -1491,8 +1491,11 @@ void GCodes::HandleReply(bool error, const GCodeBuffer *gb, const char* reply, c
if (gb == auxGCode)
{
// Command was received from the aux interface (LCD display), so send the response only to the aux interface.
platform->GetAux()->Write(reply);
platform->GetAux()->Write('\n');
if (reply[0] != 0)
{
platform->GetAux()->Write(reply);
platform->GetAux()->Write('\n');
}
return;
}

View file

@ -97,11 +97,9 @@ bool PidParameters::operator==(const PidParameters& other) const
Platform::Platform() :
tickState(0), fileStructureInitialised(false), active(false), errorCodeBits(0), debugCode(0),
messageString(messageStringBuffer, ARRAY_SIZE(messageStringBuffer))
messageString(messageStringBuffer, ARRAY_SIZE(messageStringBuffer)), line(NULL), aux(NULL)
{
SerialUSB.begin(BAUD_RATE);
line = new Line(SerialUSB);
Serial.begin(BAUD_RATE);
aux = new Line(Serial);
// Files
@ -121,6 +119,9 @@ void Platform::Init()
digitalWriteNonDue(atxPowerPin, LOW); // ensure ATX power is off by default
pinModeNonDue(atxPowerPin, OUTPUT);
SerialUSB.begin(BAUD_RATE);
Serial.begin(BAUD_RATE); // this can't be done in the constructor because the Arduino port initialisation isn't complete at that point
DueFlashStorage::init();
#if __cplusplus >= 201103L

Binary file not shown.

View file

@ -678,9 +678,10 @@ void RepRap::GetStatusResponse(StringRef& response, uint8_t type) const
}
}
response[jp] = 0;
response.cat("\"");
}
response.cat("\"}");
response.cat("}");
}