Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-04-27 13:00:01 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-04-27 13:00:01 +0300
commit0a1b2ee0cfc7c344a9fa5f27be45fd30b7b9d54b (patch)
treec3175e9c8446cd38b5a9244835f17fa23d061041
parentc52f889f0e01a856934dbc01e30971dd48e3585d (diff)
Fixes for systems without mass storage
-rw-r--r--src/Comms/FirmwareUpdater.cpp8
-rw-r--r--src/GCodes/GCodes.cpp2
-rw-r--r--src/GCodes/GCodes3.cpp3
-rw-r--r--src/Networking/ESP8266WiFi/WiFiInterface.cpp5
-rw-r--r--src/Networking/ESP8266WiFi/WifiFirmwareUploader.cpp2
-rw-r--r--src/Platform/Platform.h2
-rw-r--r--src/Platform/RepRap.cpp8
-rw-r--r--src/Storage/FileData.h4
-rw-r--r--src/bossa/Flasher.cpp6
9 files changed, 32 insertions, 8 deletions
diff --git a/src/Comms/FirmwareUpdater.cpp b/src/Comms/FirmwareUpdater.cpp
index 84597db2..4cb44e73 100644
--- a/src/Comms/FirmwareUpdater.cpp
+++ b/src/Comms/FirmwareUpdater.cpp
@@ -33,7 +33,7 @@ namespace FirmwareUpdater
const size_t serialChannel,
const StringRef& filenameRef) noexcept
{
-#if HAS_WIFI_NETWORKING
+#if HAS_WIFI_NETWORKING && (HAS_MASS_STORAGE || HAS_EMBEDDED_FILES)
if (moduleMap.IsBitSet(WifiExternalFirmwareModule) || moduleMap.IsBitSet(WifiFirmwareModule))
{
GCodeResult result;
@@ -58,7 +58,7 @@ namespace FirmwareUpdater
}
}
#endif
-#if HAS_AUX_DEVICES
+#if SUPPORT_PANELDUE_FLASH && (HAS_MASS_STORAGE || HAS_EMBEDDED_FILES)
if (moduleMap.IsBitSet(PanelDueFirmwareModule))
{
if (!reprap.GetPlatform().IsAuxEnabled(serialChannel-1) || reprap.GetPlatform().IsAuxRaw(serialChannel-1))
@@ -80,7 +80,7 @@ namespace FirmwareUpdater
bool IsReady() noexcept
{
-#if HAS_WIFI_NETWORKING
+#if HAS_WIFI_NETWORKING && (HAS_MASS_STORAGE || HAS_EMBEDDED_FILES)
WifiFirmwareUploader * const uploader = reprap.GetNetwork().GetWifiUploader();
if (uploader != nullptr && !uploader->IsReady())
{
@@ -99,7 +99,7 @@ namespace FirmwareUpdater
void UpdateModule(unsigned int module, const size_t serialChannel, const StringRef& filenameRef) noexcept
{
-#if HAS_WIFI_NETWORKING || SUPPORT_PANELDUE_FLASH
+#if (HAS_WIFI_NETWORKING || SUPPORT_PANELDUE_FLASH) && (HAS_MASS_STORAGE || HAS_EMBEDDED_FILES)
switch(module)
{
# if HAS_WIFI_NETWORKING
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index b322ac9e..957dc1a5 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -3133,7 +3133,9 @@ bool GCodes::QueueFileToPrint(const char* fileName, const StringRef& reply) noex
// Start printing the file already selected. We must hold the movement lock and wait for all moves to finish before calling this, because of the call to ResetMoveCounters.
void GCodes::StartPrinting(bool fromStart) noexcept
{
+#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES
fileOffsetToPrint = 0;
+#endif
restartMoveFractionDone = 0.0;
buildObjects.Init();
diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp
index 8530975f..c0b55ec6 100644
--- a/src/GCodes/GCodes3.cpp
+++ b/src/GCodes/GCodes3.cpp
@@ -1918,6 +1918,8 @@ void GCodes::ProcessEvent(GCodeBuffer& gb) noexcept
// Get the name of the macro file that we should look for
String<StringLength50> macroName;
Event::GetMacroFileName(macroName.GetRef());
+
+#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES
if (platform.SysFileExists(macroName.c_str()))
{
// Set up the macro parameters
@@ -1932,6 +1934,7 @@ void GCodes::ProcessEvent(GCodeBuffer& gb) noexcept
return;
}
}
+#endif
// We didn't execute the macro, so do the default action
if (Event::GetDefaultPauseReason() == PrintPausedReason::dontPause)
diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
index 106c14d8..bb7e0c29 100644
--- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp
+++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
@@ -474,8 +474,9 @@ void WiFiInterface::Activate() noexcept
bufferOut = new MessageBufferOut;
bufferIn = new MessageBufferIn;
+#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES
uploader = new WifiFirmwareUploader(SERIAL_WIFI_DEVICE, *this);
-
+#endif
if (requestedMode != WiFiState::disabled)
{
Start();
@@ -680,10 +681,12 @@ void WiFiInterface::Spin() noexcept
break;
case NetworkState::disabled:
+#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES
if (uploader != nullptr)
{
uploader->Spin();
}
+#endif
break;
case NetworkState::active:
diff --git a/src/Networking/ESP8266WiFi/WifiFirmwareUploader.cpp b/src/Networking/ESP8266WiFi/WifiFirmwareUploader.cpp
index 69739e39..d2f5f2a2 100644
--- a/src/Networking/ESP8266WiFi/WifiFirmwareUploader.cpp
+++ b/src/Networking/ESP8266WiFi/WifiFirmwareUploader.cpp
@@ -7,7 +7,7 @@
#include "WifiFirmwareUploader.h"
-#if HAS_WIFI_NETWORKING
+#if HAS_WIFI_NETWORKING && (HAS_MASS_STORAGE || HAS_EMBEDDED_FILES)
#include "WiFiInterface.h"
diff --git a/src/Platform/Platform.h b/src/Platform/Platform.h
index d6513b78..960a3406 100644
--- a/src/Platform/Platform.h
+++ b/src/Platform/Platform.h
@@ -415,7 +415,7 @@ public:
bool FileExists(const char *_ecv_array folder, const char *_ecv_array filename) const noexcept;
# if HAS_MASS_STORAGE || HAS_SBC_INTERFACE
bool Delete(const char *_ecv_array folder, const char *_ecv_array filename) const noexcept;
-#endif
+# endif
static const char *_ecv_array GetWebDir() noexcept; // Where the html etc files are
static const char *_ecv_array GetGCodeDir() noexcept; // Where the gcodes are
diff --git a/src/Platform/RepRap.cpp b/src/Platform/RepRap.cpp
index 10f21723..a9b635cd 100644
--- a/src/Platform/RepRap.cpp
+++ b/src/Platform/RepRap.cpp
@@ -2077,7 +2077,13 @@ OutputBuffer *RepRap::GetLegacyStatusResponse(uint8_t type, int seq) const noexc
{
// Add the static fields
response->catf(",\"geometry\":\"%s\",\"axes\":%u,\"totalAxes\":%u,\"axisNames\":\"%s\",\"volumes\":%u,\"numTools\":%u,\"myName\":\"%.s\",\"firmwareName\":\"%.s\"",
- move->GetGeometryString(), numVisibleAxes, gCodes->GetTotalAxes(), gCodes->GetAxisLetters(), MassStorage::GetNumVolumes(), GetNumberOfContiguousTools(), myName.c_str(), FIRMWARE_NAME);
+ move->GetGeometryString(), numVisibleAxes, gCodes->GetTotalAxes(), gCodes->GetAxisLetters(),
+#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES
+ MassStorage::GetNumVolumes(),
+#else
+ 0,
+#endif
+ GetNumberOfContiguousTools(), myName.c_str(), FIRMWARE_NAME);
}
response->cat("}\n"); // include a newline to help PanelDue resync
diff --git a/src/Storage/FileData.h b/src/Storage/FileData.h
index 12e22ae9..8cb4d0f3 100644
--- a/src/Storage/FileData.h
+++ b/src/Storage/FileData.h
@@ -10,6 +10,8 @@
#include "FileStore.h"
+#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES
+
class FileGCodeInput;
// Small class to hold an open file and data relating to it.
@@ -167,3 +169,5 @@ private:
};
#endif
+
+#endif
diff --git a/src/bossa/Flasher.cpp b/src/bossa/Flasher.cpp
index 0a6ec978..4b611874 100644
--- a/src/bossa/Flasher.cpp
+++ b/src/bossa/Flasher.cpp
@@ -28,6 +28,10 @@
///////////////////////////////////////////////////////////////////////////////
#include "Flasher.h"
+#include <RepRapFirmware.h>
+
+#if SUPPORT_PANELDUE_FLASH
+
#include <Platform/RepRap.h>
#include <Platform/Platform.h>
#include <General/Vector.hpp>
@@ -199,4 +203,6 @@ void Flasher::lock(/* string& regionArg, */ bool enable) THROWS(GCodeException)
#endif
}
+#endif
+
// End