Skip to content

Commit

Permalink
2.02 release
Browse files Browse the repository at this point in the history
Fixes for Duet 06/085 build
  • Loading branch information
dc42 committed Dec 24, 2018
1 parent dc455f5 commit c4a6248
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 61 deletions.
28 changes: 15 additions & 13 deletions .cproject

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/BugList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ Done in 2.02RC7:
- [done, ok] Support Fanuc-style G2/G3 whole circle moves
- [done, ok] Add SD card write timing

Todo before 2.02 release:
Done in 2.02 release:
- [done] Step clock on Duet Maestro going backwards, https://forum.duet3d.com/topic/8264/steptimer-getinterruptclocks-isn-t-incrementing
- Investigate Duet Maestro socket behaviour when cable disconnected, see email from chris
- [can't reproduce] Investigate Duet Maestro socket behaviour when cable disconnected, see email from chris

2.03:
2.03 planned:
- Object model
- Conditionals, loops and maths in GCode commands
- S-curve acceleration
Expand Down
8 changes: 6 additions & 2 deletions src/Duet/MCP4461/MCP4461.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ void MCP4461::setVolatileWiper(uint8_t wiper, uint16_t wiper_value)

uint8_t i2cBytes[2] = { c_byte, d_byte };
MutexLocker lock(Tasks::GetI2CMutex());
MCP_WIRE.Transfer(_mcp4461_address, i2cBytes, 2, 0, nullptr);
MCP_WIRE.Transfer(_mcp4461_address, i2cBytes, 2, 0);

delayMicroseconds(5); // bus needs to be free for 4.7us before the next command
}

void MCP4461::setNonVolatileWiper(uint8_t wiper, uint16_t wiper_value)
Expand Down Expand Up @@ -101,7 +103,9 @@ void MCP4461::setNonVolatileWiper(uint8_t wiper, uint16_t wiper_value)

uint8_t i2cBytes[2] = { c_byte, d_byte };
MutexLocker lock(Tasks::GetI2CMutex());
MCP_WIRE.Transfer(_mcp4461_address, i2cBytes, 2, 0, nullptr);
MCP_WIRE.Transfer(_mcp4461_address, i2cBytes, 2, 0);

delay(20); // writing to nonvolatile memory takes up to 10ms to complete
}

// End
75 changes: 44 additions & 31 deletions src/Duet/Webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,29 +619,48 @@ void Webserver::HttpInterpreter::SendFile(const char* nameOfFileToSend, bool isW
if (nameOfFileToSend[0] == '/')
{
++nameOfFileToSend; // all web files are relative to the /www folder, so remove the leading '/'
if (nameOfFileToSend[0] == 0)
{
nameOfFileToSend = INDEX_PAGE_FILE;
}
}

// Try to open a gzipped version of the file first
if (!StringEndsWithIgnoreCase(nameOfFileToSend, ".gz") && strlen(nameOfFileToSend) + 3 <= MaxFilenameLength)
if (nameOfFileToSend[0] == 0)
{
char nameBuf[MaxFilenameLength + 1];
strcpy(nameBuf, nameOfFileToSend);
strcat(nameBuf, ".gz");
fileToSend = platform->OpenFile(platform->GetWebDir(), nameBuf, OpenMode::read);
if (fileToSend != nullptr)
{
zip = true;
}
nameOfFileToSend = INDEX_PAGE_FILE;
}

// If that failed, try to open the normal version of the file
if (fileToSend == nullptr)
for (;;)
{
// Try to open a gzipped version of the file first
if (!StringEndsWithIgnoreCase(nameOfFileToSend, ".gz") && strlen(nameOfFileToSend) + 3 <= MaxFilenameLength)
{
char nameBuf[MaxFilenameLength + 1];
strcpy(nameBuf, nameOfFileToSend);
strcat(nameBuf, ".gz");
fileToSend = platform->OpenFile(platform->GetWebDir(), nameBuf, OpenMode::read);
if (fileToSend != nullptr)
{
zip = true;
break;
}
}

// That failed, try to open the normal version of the file
fileToSend = platform->OpenFile(platform->GetWebDir(), nameOfFileToSend, OpenMode::read);
if (fileToSend != nullptr)
{
break;
}

if (StringEqualsIgnoreCase(nameOfFileToSend, INDEX_PAGE_FILE))
{
nameOfFileToSend = OLD_INDEX_PAGE_FILE; // the index file wasn't found, so try the old one
}
else if (!strchr(nameOfFileToSend, '.')) // if we were asked to return a file without a '.' in the name, return the index page
{
nameOfFileToSend = INDEX_PAGE_FILE;
}
else
{
break;
}
}

// If we still couldn't find the file and it was an HTML file, return the 404 error page
Expand All @@ -650,25 +669,19 @@ void Webserver::HttpInterpreter::SendFile(const char* nameOfFileToSend, bool isW
nameOfFileToSend = FOUR04_PAGE_FILE;
fileToSend = platform->OpenFile(platform->GetWebDir(), nameOfFileToSend, OpenMode::read);
}

if (fileToSend == nullptr)
{
RejectMessage("not found", 404);
return;
}
transaction->SetFileToWrite(fileToSend);
}
else
{
fileToSend = platform->OpenFile(FS_PREFIX, nameOfFileToSend, OpenMode::read);
if (fileToSend == nullptr)
{
RejectMessage("not found", 404);
return;
}
transaction->SetFileToWrite(fileToSend);
}

if (fileToSend == nullptr)
{
RejectMessage("not found", 404);
return;
}

transaction->SetFileToWrite(fileToSend);
transaction->Write("HTTP/1.1 200 OK\r\n");

// Don't cache files served by rr_download
Expand Down Expand Up @@ -716,12 +729,12 @@ void Webserver::HttpInterpreter::SendFile(const char* nameOfFileToSend, bool isW
}
transaction->Printf("Content-Type: %s\r\n", contentType);

if (zip && fileToSend != nullptr)
if (zip)
{
transaction->Write("Content-Encoding: gzip\r\n");
transaction->Printf("Content-Length: %lu\r\n", fileToSend->Length());
}

transaction->Printf("Content-Length: %lu\r\n", fileToSend->Length());
transaction->Write("Connection: close\r\n\r\n");
transaction->Commit(false);
}
Expand Down
12 changes: 4 additions & 8 deletions src/Networking/HttpResponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ void HttpResponder::SendFile(const char* nameOfFileToSend, bool isWebFile)
RejectMessage("page not found<br>Check that the SD card is mounted and has the correct files in its /www folder", 404);
return;
}
fileBeingSent = fileToSend;
}
else
{
Expand All @@ -789,9 +788,9 @@ void HttpResponder::SendFile(const char* nameOfFileToSend, bool isWebFile)
RejectMessage("file not found", 404);
return;
}
fileBeingSent = fileToSend;
}

fileBeingSent = fileToSend;
outBuf->copy("HTTP/1.1 200 OK\r\n");

// Don't cache files served by rr_download
Expand Down Expand Up @@ -840,15 +839,12 @@ void HttpResponder::SendFile(const char* nameOfFileToSend, bool isWebFile)
}
outBuf->catf("Content-Type: %s\r\n", contentType);

if (fileToSend != nullptr)
if (zip)
{
if (zip)
{
outBuf->cat("Content-Encoding: gzip\r\n");
}
outBuf->catf("Content-Length: %lu\r\n", fileToSend->Length());
outBuf->cat("Content-Encoding: gzip\r\n");
}

outBuf->catf("Content-Length: %lu\r\n", fileToSend->Length());
outBuf->cat("Connection: close\r\n\r\n");
Commit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class Platform
// Digipots
MCP4461 mcpDuet;
MCP4461 mcpExpansion;
Pin potWipes[8]; // we have only 8 digipots, on the Duet 0.8.5 we use the DAC for the 9th
uint8_t potWipes[8]; // we have only 8 digipots, on the Duet 0.8.5 we use the DAC for the 9th
float senseResistor;
float maxStepperDigipotVoltage;
float stepperDacVoltageRange, stepperDacVoltageOffset;
Expand Down
6 changes: 3 additions & 3 deletions src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
#ifndef VERSION
#ifdef RTOS
# define RTOSVER "(RTOS)"
# define MAIN_VERSION "2.02RC7+"
# define MAIN_VERSION "2.02"
#else
# define MAIN_VERSION "1.22"
# define MAIN_VERSION "1.23"
# define RTOSVER
#endif

# define VERSION MAIN_VERSION RTOSVER
#endif

#ifndef DATE
# define DATE "2018-12-23b2"
# define DATE "2018-12-24b1"
#endif

#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman, printm3d"
Expand Down

0 comments on commit c4a6248

Please sign in to comment.