Version 0.78n

Bug fix: file list should be encapsulated UNLESS the source of the M20
command is serial and the emulation is Marlin
This commit is contained in:
David Crocker 2014-08-26 08:30:32 +01:00
parent 4f7cd4a833
commit 405c529b01
3 changed files with 8 additions and 6 deletions

View file

@ -24,8 +24,8 @@ Licence: GPL
#define CONFIGURATION_H #define CONFIGURATION_H
#define NAME "RepRapFirmware" #define NAME "RepRapFirmware"
#define VERSION "0.78m-dc42" #define VERSION "0.78n-dc42"
#define DATE "2014-08-24" #define DATE "2014-08-26"
#define AUTHORS "reprappro, dc42, zpl" #define AUTHORS "reprappro, dc42, zpl"
// Other firmware that we might switch to be compatible with. // Other firmware that we might switch to be compatible with.

View file

@ -1840,18 +1840,20 @@ bool GCodes::HandleMcode(GCodeBuffer* gb)
case 20: // Deprecated... case 20: // Deprecated...
{ {
bool encapsulate_list; // To mimic the behaviour of the official RepRapPro firmware:
// If we are emulating RepRap then we print "GCode files:\n" at the start, otherwise we don't.
// If we are emulating Marlin and the code came via the serial/USB interface, then we don't put quotes around the names and we separate them with newline;
// otherwise we put quotes around them and separate them with comma.
if (platform->Emulating() == me || platform->Emulating() == reprapFirmware) if (platform->Emulating() == me || platform->Emulating() == reprapFirmware)
{ {
reply.copy("GCode files:\n"); reply.copy("GCode files:\n");
encapsulate_list = false;
} }
else else
{ {
reply.Clear(); reply.Clear();
encapsulate_list = true;
} }
bool encapsulate_list = (gb != serialGCode || platform->Emulating() != marlin);
FileInfo file_info; FileInfo file_info;
if (platform->GetMassStorage()->FindFirst(platform->GetGCodeDir(), file_info)) if (platform->GetMassStorage()->FindFirst(platform->GetGCodeDir(), file_info))
{ {
@ -1867,7 +1869,7 @@ bool GCodes::HandleMcode(GCodeBuffer* gb)
} }
} while (platform->GetMassStorage()->FindNext(file_info)); } while (platform->GetMassStorage()->FindNext(file_info));
// remove the last character // remove the last separator
reply[reply.strlen() - 1] = 0; reply[reply.strlen() - 1] = 0;
} }
else else

Binary file not shown.