Merge remote-tracking branch 'upstream/duet' into duet
This commit is contained in:
commit
e5fccb13c0
11 changed files with 48266 additions and 43 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
*.o
|
||||
.*
|
||||
Release/*
|
||||
!Release/RepRapFirmware.bin
|
||||
*~
|
||||
*orig
|
||||
/Release
|
||||
|
|
|
@ -67,13 +67,13 @@ enum Compatibility
|
|||
|
||||
#define DEFAULT_PASSWORD "reprap"
|
||||
#define DEFAULT_NAME "My RepRap 1"
|
||||
|
||||
/* Z PROBE CALIBRATION
|
||||
* Set = 1 to enable Z probe ADC output on SerialUSb
|
||||
*/
|
||||
#define CALIB_Z 0
|
||||
#define INDEX_PAGE "reprap.htm"
|
||||
#define MESSAGE_FILE "messages.txt"
|
||||
#define FOUR04_FILE "html404.htm"
|
||||
|
||||
#define LONG_TIME 300.0 // Seconds
|
||||
|
||||
#define EOF_STRING "<!-- **EoF** -->"
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Binary file not shown.
40
Data/ormerod-xlr.scad
Normal file
40
Data/ormerod-xlr.scad
Normal file
|
@ -0,0 +1,40 @@
|
|||
rotate([-90,0,0])
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
cube([30, 5, 35], center=true);
|
||||
|
||||
|
||||
translate([-17, -7.5, 0])
|
||||
cube([5, 20, 35], center=true);
|
||||
}
|
||||
|
||||
translate([-16.7/2, 0, -26.2/2])
|
||||
rotate([90,0,0])
|
||||
cylinder(r=1.7, h=40, center=true, $fn=30);
|
||||
|
||||
translate([16.7/2, 0, 26.2/2])
|
||||
rotate([90,0,0])
|
||||
cylinder(r=1.7, h=40, center=true, $fn=30);
|
||||
|
||||
rotate([90,0,0])
|
||||
cylinder(r=24/2, h=40, center=true, $fn=30);
|
||||
|
||||
|
||||
translate([-15.5, -8, 10])
|
||||
rotate([0,90,0])
|
||||
{
|
||||
cylinder(r=2.2, h=40, center=true, $fn=30);
|
||||
cylinder(r1=2.2, r2 = 4, h=2.5, center=true, $fn=30);
|
||||
}
|
||||
|
||||
translate([-15.5, -12, -10])
|
||||
rotate([0,90,0])
|
||||
{
|
||||
cylinder(r=2.2, h=40, center=true, $fn=30);
|
||||
cylinder(r1=2.2, r2 = 4, h=2.5, center=true, $fn=30);
|
||||
}
|
||||
}
|
||||
|
||||
|
6106
Data/ormerod-xlr.stl
Normal file
6106
Data/ormerod-xlr.stl
Normal file
File diff suppressed because it is too large
Load diff
42014
Data/ormerod-xlr2.gcode
Normal file
42014
Data/ormerod-xlr2.gcode
Normal file
File diff suppressed because it is too large
Load diff
110
GCodes.cpp
110
GCodes.cpp
|
@ -61,6 +61,9 @@ void GCodes::Init()
|
|||
fileToPrint = NULL;
|
||||
fileBeingWritten = NULL;
|
||||
configFile = NULL;
|
||||
eofString = EOF_STRING;
|
||||
eofStringCounter = 0;
|
||||
eofStringLength = strlen(eofString);
|
||||
homeX = false;
|
||||
homeY = false;
|
||||
homeZ = false;
|
||||
|
@ -121,9 +124,10 @@ void GCodes::Spin()
|
|||
|
||||
if(webserver->GCodeAvailable())
|
||||
{
|
||||
if(webGCode->Put(webserver->ReadGCode()))
|
||||
b = webserver->ReadGCode();
|
||||
if(webGCode->Put(b))
|
||||
{
|
||||
if(webGCode->WritingFile())
|
||||
if(webGCode->WritingFileDirectory())
|
||||
WriteGCodeToFile(webGCode);
|
||||
else
|
||||
webGCode->SetFinished(ActOnGcode(webGCode));
|
||||
|
@ -132,20 +136,37 @@ void GCodes::Spin()
|
|||
return;
|
||||
}
|
||||
|
||||
if(platform->GetLine()->Status() & byteAvailable)
|
||||
// Now the serial interface. First check the special case of our
|
||||
// uploading the reprap.htm file
|
||||
|
||||
if(serialGCode->WritingFileDirectory() == platform->GetWebDir())
|
||||
{
|
||||
platform->GetLine()->Read(b);
|
||||
if(serialGCode->Put(b))
|
||||
{
|
||||
if(serialGCode->WritingFile())
|
||||
WriteGCodeToFile(serialGCode);
|
||||
else
|
||||
serialGCode->SetFinished(ActOnGcode(serialGCode));
|
||||
}
|
||||
platform->ClassReport("GCodes", longWait);
|
||||
return;
|
||||
if(platform->GetLine()->Status() & byteAvailable)
|
||||
{
|
||||
platform->GetLine()->Read(b);
|
||||
WriteHTMLToFile(b, serialGCode);
|
||||
}
|
||||
} else
|
||||
{
|
||||
// Otherwise just deal in general with incoming bytes from the serial interface
|
||||
|
||||
if(platform->GetLine()->Status() & byteAvailable)
|
||||
{
|
||||
platform->GetLine()->Read(b);
|
||||
if(serialGCode->Put(b))
|
||||
{
|
||||
if(serialGCode->WritingFileDirectory())
|
||||
WriteGCodeToFile(serialGCode);
|
||||
else
|
||||
serialGCode->SetFinished(ActOnGcode(serialGCode));
|
||||
}
|
||||
platform->ClassReport("GCodes", longWait);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(fileBeingPrinted != NULL)
|
||||
{
|
||||
if(fileBeingPrinted->Read(b))
|
||||
|
@ -500,18 +521,47 @@ char* GCodes::GetCurrentCoordinates()
|
|||
return scratchString;
|
||||
}
|
||||
|
||||
char* GCodes::OpenFileToWrite(char* fileName, GCodeBuffer *gb, bool configFile)
|
||||
char* GCodes::OpenFileToWrite(char* directory, char* fileName, GCodeBuffer *gb)
|
||||
{
|
||||
if(configFile)
|
||||
fileBeingWritten = platform->GetFileStore(platform->GetSysDir(), fileName, true);
|
||||
else
|
||||
fileBeingWritten = platform->GetFileStore(platform->GetGCodeDir(), fileName, true);
|
||||
fileBeingWritten = platform->GetFileStore(directory, fileName, true);
|
||||
if(fileBeingWritten == NULL)
|
||||
platform->Message(HOST_MESSAGE, "Can't open GCode file for writing.\n");
|
||||
else
|
||||
gb->SetWritingFile(true);
|
||||
gb->SetWritingFileDirectory(directory);
|
||||
|
||||
eofStringCounter = 0;
|
||||
}
|
||||
|
||||
void GCodes::WriteHTMLToFile(char b, GCodeBuffer *gb)
|
||||
{
|
||||
char reply[1];
|
||||
reply[0] = 0;
|
||||
|
||||
if(fileBeingWritten == NULL)
|
||||
{
|
||||
platform->Message(HOST_MESSAGE, "Attempt to write to a null file.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fileBeingWritten->Write(b);
|
||||
|
||||
if(b == eofString[eofStringCounter])
|
||||
{
|
||||
eofStringCounter++;
|
||||
if(eofStringCounter >= eofStringLength)
|
||||
{
|
||||
fileBeingWritten->Close();
|
||||
fileBeingWritten = NULL;
|
||||
gb->SetWritingFileDirectory(NULL);
|
||||
char* r = reply;
|
||||
if(platform->Emulating() == marlin)
|
||||
r = "Done saving file.";
|
||||
HandleReply(false, gb == serialGCode , r, 'M', 560, false);
|
||||
return;
|
||||
}
|
||||
} else
|
||||
eofStringCounter = 0;
|
||||
}
|
||||
|
||||
void GCodes::WriteGCodeToFile(GCodeBuffer *gb)
|
||||
{
|
||||
|
@ -532,7 +582,7 @@ void GCodes::WriteGCodeToFile(GCodeBuffer *gb)
|
|||
{
|
||||
fileBeingWritten->Close();
|
||||
fileBeingWritten = NULL;
|
||||
gb->SetWritingFile(false);
|
||||
gb->SetWritingFileDirectory(NULL);
|
||||
char* r = reply;
|
||||
if(platform->Emulating() == marlin)
|
||||
r = "Done saving file.";
|
||||
|
@ -1033,7 +1083,7 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
|
||||
case 28: // Write to file
|
||||
str = gb->GetUnprecedentedString();
|
||||
OpenFileToWrite(str, gb, false);
|
||||
OpenFileToWrite(platform->GetGCodeDir(), str, gb);
|
||||
snprintf(reply, STRING_LENGTH, "Writing to file: %s", str);
|
||||
break;
|
||||
|
||||
|
@ -1042,20 +1092,24 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
break;
|
||||
|
||||
case 82:
|
||||
if(drivesRelative)
|
||||
// if(drivesRelative)
|
||||
for(int8_t extruder = AXES; extruder < DRIVES; extruder++)
|
||||
lastPos[extruder - AXES] = 0.0;
|
||||
drivesRelative = false;
|
||||
break;
|
||||
|
||||
case 83:
|
||||
if(!drivesRelative)
|
||||
// if(!drivesRelative)
|
||||
for(int8_t extruder = AXES; extruder < DRIVES; extruder++)
|
||||
lastPos[extruder - AXES] = 0.0;
|
||||
drivesRelative = true;
|
||||
|
||||
break;
|
||||
|
||||
case 84: // Motors off - deprecated, use M18
|
||||
result = DisableDrives();
|
||||
break;
|
||||
|
||||
case 85: // Set inactive time
|
||||
break;
|
||||
|
||||
|
@ -1296,10 +1350,16 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
|
||||
case 559: // Upload config.g
|
||||
str = platform->GetConfigFile();
|
||||
OpenFileToWrite(str, gb, true);
|
||||
OpenFileToWrite(platform->GetSysDir(), str, gb);
|
||||
snprintf(reply, STRING_LENGTH, "Writing to file: %s", str);
|
||||
break;
|
||||
|
||||
case 560: // Upload reprap.htm
|
||||
str = INDEX_PAGE;
|
||||
OpenFileToWrite(platform->GetWebDir(), str, gb);
|
||||
snprintf(reply, STRING_LENGTH, "Writing to file: %s", str);
|
||||
break;
|
||||
|
||||
case 906: // Set Motor currents
|
||||
for(uint8_t i = 0; i < DRIVES; i++)
|
||||
{
|
||||
|
@ -1376,7 +1436,7 @@ GCodeBuffer::GCodeBuffer(Platform* p, char* id)
|
|||
{
|
||||
platform = p;
|
||||
identity = id;
|
||||
writingFile = false; // Has to be done here as Init() is called every line.
|
||||
writingFileDirectory = NULL; // Has to be done here as Init() is called every line.
|
||||
}
|
||||
|
||||
void GCodeBuffer::Init()
|
||||
|
|
20
GCodes.h
20
GCodes.h
|
@ -43,8 +43,8 @@ class GCodeBuffer
|
|||
char* Buffer();
|
||||
bool Finished();
|
||||
void SetFinished(bool f);
|
||||
bool WritingFile();
|
||||
void SetWritingFile(bool wf);
|
||||
char* WritingFileDirectory();
|
||||
void SetWritingFileDirectory(char* wfd);
|
||||
|
||||
private:
|
||||
int CheckSum();
|
||||
|
@ -55,7 +55,7 @@ class GCodeBuffer
|
|||
int readPointer;
|
||||
bool inComment;
|
||||
bool finished;
|
||||
bool writingFile;
|
||||
char* writingFileDirectory;
|
||||
};
|
||||
|
||||
//****************************************************************************************************
|
||||
|
@ -98,9 +98,10 @@ class GCodes
|
|||
bool StandbyHeaters();
|
||||
void SetEthernetAddress(GCodeBuffer *gb, int mCode);
|
||||
void HandleReply(bool error, bool fromLine, char* reply, char gMOrT, int code, bool resend);
|
||||
char* OpenFileToWrite(char* fileName, GCodeBuffer *gb, bool configFile);
|
||||
char* OpenFileToWrite(char* directory, char* fileName, GCodeBuffer *gb);
|
||||
void WriteGCodeToFile(GCodeBuffer *gb);
|
||||
bool SendConfigToLine();
|
||||
void WriteHTMLToFile(char b, GCodeBuffer *gb);
|
||||
|
||||
int8_t Heater(int8_t head);
|
||||
Platform* platform;
|
||||
|
@ -127,6 +128,9 @@ class GCodes
|
|||
FileStore* fileToPrint;
|
||||
FileStore* fileBeingWritten;
|
||||
FileStore* configFile;
|
||||
char* eofString;
|
||||
uint8_t eofStringCounter;
|
||||
uint8_t eofStringLength;
|
||||
int8_t selectedHead;
|
||||
bool homeX;
|
||||
bool homeY;
|
||||
|
@ -165,14 +169,14 @@ inline void GCodeBuffer::SetFinished(bool f)
|
|||
finished = f;
|
||||
}
|
||||
|
||||
inline bool GCodeBuffer::WritingFile()
|
||||
inline char* GCodeBuffer::WritingFileDirectory()
|
||||
{
|
||||
return writingFile;
|
||||
return writingFileDirectory;
|
||||
}
|
||||
|
||||
inline void GCodeBuffer::SetWritingFile(bool wf)
|
||||
inline void GCodeBuffer::SetWritingFileDirectory(char* wfd)
|
||||
{
|
||||
writingFile = wf;
|
||||
writingFileDirectory = wfd;
|
||||
}
|
||||
|
||||
inline bool GCodes::PrintingAFile()
|
||||
|
|
BIN
Release/RepRapFirmware.bin
Executable file
BIN
Release/RepRapFirmware.bin
Executable file
Binary file not shown.
|
@ -777,3 +777,4 @@ poll();
|
|||
|
||||
|
||||
</html>
|
||||
<!-- **EoF** -->
|
||||
|
|
|
@ -31,9 +31,6 @@ Licence: GPL
|
|||
#define WEBSERVER_H
|
||||
|
||||
|
||||
#define INDEX_PAGE "reprap.htm"
|
||||
#define MESSAGE_FILE "messages.txt"
|
||||
#define FOUR04_FILE "html404.htm"
|
||||
#define KO_START "rr_"
|
||||
#define KO_FIRST 3
|
||||
#define POST_LENGTH 200
|
||||
|
|
Reference in a new issue