From 8207b22cc13e7893ae1cb43f4aef4a7632cac5b3 Mon Sep 17 00:00:00 2001 From: Christian Hammacher Date: Thu, 28 Oct 2021 13:58:15 +0200 Subject: SBC improvements for 3.4-b6 Refactored various parts of the SBC interface Renamed Linux to SBC in various places CAN updater checks if file is present on SBC before update SBC task is only woken up when SPI transfers finish Bug fix: Codes that were sent back to the SBC (e.g. from USB) caused temp reports to be printed Bug fix: SBC reconnects could take longer than expected --- src/Platform/MessageType.h | 2 +- src/Platform/OutputMemory.cpp | 2 +- src/Platform/OutputMemory.h | 4 +-- src/Platform/Platform.cpp | 58 ++++++++++++++++----------------- src/Platform/Platform.h | 14 ++++---- src/Platform/RepRap.cpp | 74 +++++++++++++++++++++---------------------- src/Platform/RepRap.h | 16 +++++----- src/Platform/TaskPriorities.h | 2 +- 8 files changed, 86 insertions(+), 86 deletions(-) (limited to 'src/Platform') diff --git a/src/Platform/MessageType.h b/src/Platform/MessageType.h index d1062542..4823dbb7 100644 --- a/src/Platform/MessageType.h +++ b/src/Platform/MessageType.h @@ -10,7 +10,7 @@ #include -// Supported message destinations. This is now a bitmap. Note that this type is used by the Linux service as well +// Supported message destinations. This is now a bitmap. Note that this type is used by the SBC service as well enum MessageType : uint32_t { // Destinations (bytes 1-2) diff --git a/src/Platform/OutputMemory.cpp b/src/Platform/OutputMemory.cpp index 39ffda41..801427a5 100644 --- a/src/Platform/OutputMemory.cpp +++ b/src/Platform/OutputMemory.cpp @@ -540,7 +540,7 @@ MessageType OutputStack::GetFirstItemType() const volatile noexcept return (count == 0) ? MessageType::NoDestinationMessage : types[0]; } -#if HAS_LINUX_INTERFACE +#if HAS_SBC_INTERFACE // Update the first item of the stack void OutputStack::SetFirstItem(OutputBuffer *buffer) volatile noexcept diff --git a/src/Platform/OutputMemory.h b/src/Platform/OutputMemory.h index 3b15855c..b86bb84f 100644 --- a/src/Platform/OutputMemory.h +++ b/src/Platform/OutputMemory.h @@ -11,7 +11,7 @@ #include #include -#if HAS_LINUX_INTERFACE +#if HAS_SBC_INTERFACE const size_t OUTPUT_STACK_DEPTH = 64; // Number of OutputBuffer chains that can be pushed onto one stack instance #else const size_t OUTPUT_STACK_DEPTH = 4; // Number of OutputBuffer chains that can be pushed onto one stack instance @@ -144,7 +144,7 @@ public: // Returns the first item's type from the stack or NoDestinationMessage if none is available MessageType GetFirstItemType() const volatile noexcept; -#if HAS_LINUX_INTERFACE +#if HAS_SBC_INTERFACE // Set the first item of the stack. If it's NULL, then the first item will be removed void SetFirstItem(OutputBuffer *buffer) volatile noexcept; #endif diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 5be4b3c9..be34c04a 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -86,9 +86,9 @@ using AnalogIn::AdcBits; // for compatibility with CoreNG, which doesn't have # include "PortControl.h" #endif -#if HAS_LINUX_INTERFACE -# include "Linux/LinuxInterface.h" -# include "Linux/DataTransfer.h" +#if HAS_SBC_INTERFACE +# include "SBC/SbcInterface.h" +# include "SBC/DataTransfer.h" #endif #if HAS_NETWORKING @@ -227,7 +227,7 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = { "firmwareFileName", OBJECT_MODEL_FUNC_NOSELF(IAP_FIRMWARE_FILE), ObjectModelEntryFlags::none }, { "firmwareName", OBJECT_MODEL_FUNC_NOSELF(FIRMWARE_NAME), ObjectModelEntryFlags::none }, { "firmwareVersion", OBJECT_MODEL_FUNC_NOSELF(VERSION), ObjectModelEntryFlags::none }, -#if HAS_LINUX_INTERFACE +#if HAS_SBC_INTERFACE { "iapFileNameSBC", OBJECT_MODEL_FUNC_NOSELF(IAP_UPDATE_FILE_SBC), ObjectModelEntryFlags::none }, #endif #if HAS_MASS_STORAGE @@ -342,7 +342,7 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = constexpr uint8_t Platform::objectModelTableDescriptor[] = { 10, // number of sections - 9 + SUPPORT_ACCELEROMETERS + HAS_LINUX_INTERFACE + HAS_MASS_STORAGE + HAS_VOLTAGE_MONITOR + HAS_12V_MONITOR + HAS_CPU_TEMP_SENSOR + SUPPORT_CAN_EXPANSION + SUPPORT_12864_LCD + MCU_HAS_UNIQUE_ID, // section 0: boards[0] + 9 + SUPPORT_ACCELEROMETERS + HAS_SBC_INTERFACE + HAS_MASS_STORAGE + HAS_VOLTAGE_MONITOR + HAS_12V_MONITOR + HAS_CPU_TEMP_SENSOR + SUPPORT_CAN_EXPANSION + SUPPORT_12864_LCD + MCU_HAS_UNIQUE_ID, // section 0: boards[0] #if HAS_CPU_TEMP_SENSOR 3, // section 1: mcuTemp #else @@ -413,7 +413,7 @@ Platform::Platform() noexcept : #if HAS_AUX_DEVICES panelDueUpdater(nullptr), #endif -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES sysDir(nullptr), #endif tickState(0), debugCode(0), @@ -500,7 +500,7 @@ void Platform::Init() noexcept pinMode(SdCardDetectPins[i], INPUT_PULLUP); } -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES MassStorage::Init(); #endif @@ -1022,7 +1022,7 @@ void Platform::Spin() noexcept #endif -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES MassStorage::Spin(); #endif @@ -1472,8 +1472,8 @@ bool Platform::IsPowerOk() const noexcept { // FIXME Implement auto-save for the SBC return ( !autoSaveEnabled -#if HAS_LINUX_INTERFACE - || reprap.UsingLinuxInterface() +#if HAS_SBC_INTERFACE + || reprap.UsingSbcInterface() #endif ) || currentVin > autoPauseReading; @@ -2254,17 +2254,17 @@ GCodeResult Platform::DiagnosticTest(GCodeBuffer& gb, const StringRef& reply, Ou case (unsigned int)DiagnosticTestType::PrintObjectAddresses: MessageF(MessageType::GenericMessage, "Platform %08" PRIx32 "-%08" PRIx32 -#if HAS_LINUX_INTERFACE - "\nLinuxInterface %08" PRIx32 "-%08" PRIx32 +#if HAS_SBC_INTERFACE + "\nSbcInterface %08" PRIx32 "-%08" PRIx32 #endif "\nNetwork %08" PRIx32 "-%08" PRIx32 "\nGCodes %08" PRIx32 "-%08" PRIx32 "\nMove %08" PRIx32 "-%08" PRIx32 "\nHeat %08" PRIx32 "-%08" PRIx32 , reinterpret_cast(this), reinterpret_cast(this) + sizeof(Platform) - 1 -#if HAS_LINUX_INTERFACE - , reinterpret_cast(&reprap.GetLinuxInterface()) - , (reinterpret_cast(&reprap.GetLinuxInterface()) == 0) ? 0 : reinterpret_cast(&reprap.GetLinuxInterface()) + sizeof(LinuxInterface) +#if HAS_SBC_INTERFACE + , reinterpret_cast(&reprap.GetSbcInterface()) + , (reinterpret_cast(&reprap.GetSbcInterface()) == 0) ? 0 : reinterpret_cast(&reprap.GetSbcInterface()) + sizeof(SbcInterface) #endif , reinterpret_cast(&reprap.GetNetwork()), reinterpret_cast(&reprap.GetNetwork()) + sizeof(Network) - 1 , reinterpret_cast(&reprap.GetGCodes()), reinterpret_cast(&reprap.GetGCodes()) + sizeof(GCodes) - 1 @@ -2443,7 +2443,7 @@ int Platform::GetAveragingFilterIndex(const IoPort& port) const noexcept return -1; } -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE // Write the platform parameters to file bool Platform::WritePlatformParameters(FileStore *f, bool includingG31) const noexcept @@ -3367,8 +3367,8 @@ void Platform::Message(const MessageType type, OutputBuffer *buffer) noexcept { ++numDestinations; } -#if HAS_LINUX_INTERFACE - if (reprap.UsingLinuxInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) +#if HAS_SBC_INTERFACE + if (reprap.UsingSbcInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) { ++numDestinations; } @@ -3413,10 +3413,10 @@ void Platform::Message(const MessageType type, OutputBuffer *buffer) noexcept AppendUsbReply(buffer); } -#if HAS_LINUX_INTERFACE - if (reprap.UsingLinuxInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) +#if HAS_SBC_INTERFACE + if (reprap.UsingSbcInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) { - reprap.GetLinuxInterface().HandleGCodeReply(type, buffer); + reprap.GetSbcInterface().HandleGCodeReply(type, buffer); } #endif } @@ -3425,11 +3425,11 @@ void Platform::Message(const MessageType type, OutputBuffer *buffer) noexcept void Platform::MessageF(MessageType type, const char *fmt, va_list vargs) noexcept { String formatString; -#if HAS_LINUX_INTERFACE - if (reprap.UsingLinuxInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) +#if HAS_SBC_INTERFACE + if (reprap.UsingSbcInterface() && ((type & GenericMessage) == GenericMessage || (type & BinaryCodeReplyFlag) != 0)) { formatString.vprintf(fmt, vargs); - reprap.GetLinuxInterface().HandleGCodeReply(type, formatString.c_str()); + reprap.GetSbcInterface().HandleGCodeReply(type, formatString.c_str()); if ((type & BinaryCodeReplyFlag) != 0) { return; @@ -3465,11 +3465,11 @@ void Platform::MessageF(MessageType type, const char *fmt, ...) noexcept void Platform::Message(MessageType type, const char *message) noexcept { -#if HAS_LINUX_INTERFACE - if (reprap.UsingLinuxInterface() && +#if HAS_SBC_INTERFACE + if (reprap.UsingSbcInterface() && ((type & BinaryCodeReplyFlag) != 0 || (type & GenericMessage) == GenericMessage || (type & LogOff) != LogOff)) { - reprap.GetLinuxInterface().HandleGCodeReply(type, message); + reprap.GetSbcInterface().HandleGCodeReply(type, message); if ((type & BinaryCodeReplyFlag) != 0) { return; @@ -3979,7 +3979,7 @@ bool Platform::IsDuetWiFi() const noexcept #endif -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool Platform::Delete(const char* folder, const char *filename) const noexcept { @@ -3995,7 +3995,7 @@ bool Platform::DeleteSysFile(const char *filename) const noexcept #endif -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES // Open a file FileStore* Platform::OpenFile(const char* folder, const char* fileName, OpenMode mode, uint32_t preAllocSize) const noexcept diff --git a/src/Platform/Platform.h b/src/Platform/Platform.h index b6383a8b..a2246047 100644 --- a/src/Platform/Platform.h +++ b/src/Platform/Platform.h @@ -398,10 +398,10 @@ public: #endif // File functions -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES FileStore* OpenFile(const char* folder, const char* fileName, OpenMode mode, uint32_t preAllocSize = 0) const noexcept; bool FileExists(const char* folder, const char *filename) const noexcept; -# if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +# if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool Delete(const char* folder, const char *filename) const noexcept; #endif @@ -413,7 +413,7 @@ public: GCodeResult SetSysDir(const char* dir, const StringRef& reply) noexcept; // Set the system files path bool SysFileExists(const char *filename) const noexcept; FileStore* OpenSysFile(const char *filename, OpenMode mode) const noexcept; -# if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +# if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool DeleteSysFile(const char *filename) const noexcept; # endif bool MakeSysFileName(const StringRef& result, const char *filename) const noexcept; @@ -522,7 +522,7 @@ public: const volatile ZProbeAveragingFilter& GetZProbeOnFilter() const noexcept { return zProbeOnFilter; } const volatile ZProbeAveragingFilter& GetZProbeOffFilter() const noexcept{ return zProbeOffFilter; } -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool WritePlatformParameters(FileStore *f, bool includingG31) const noexcept; #endif @@ -799,7 +799,7 @@ private: float axisMinima[MaxAxes]; AxesBitmap axisMinimaProbed, axisMaximaProbed; -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE static bool WriteAxisLimits(FileStore *f, AxesBitmap axesProbed, const float limits[MaxAxes], int sParam) noexcept; #endif @@ -819,7 +819,7 @@ private: #endif // Files -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES const char *sysDir; mutable ReadWriteLock sysDirLock; #endif @@ -891,7 +891,7 @@ private: static bool deliberateError; // true if we deliberately caused an exception for testing purposes. Must be static in case of exception during startup. }; -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE || HAS_EMBEDDED_FILES +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE || HAS_EMBEDDED_FILES // Where the htm etc files are inline const char* Platform::GetWebDir() const noexcept diff --git a/src/Platform/RepRap.cpp b/src/Platform/RepRap.cpp index 8761ac03..57bfca22 100644 --- a/src/Platform/RepRap.cpp +++ b/src/Platform/RepRap.cpp @@ -46,8 +46,8 @@ # include "Display/Display.h" #endif -#if HAS_LINUX_INTERFACE -# include "Linux/LinuxInterface.h" +#if HAS_SBC_INTERFACE +# include "SBC/SbcInterface.h" #endif #ifdef DUET3_ATE @@ -249,7 +249,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = // Within each group, these entries must be in alphabetical order // 0. MachineModel root { "boards", OBJECT_MODEL_FUNC_NOSELF(&boardsArrayDescriptor), ObjectModelEntryFlags::live }, -#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_SBC_INTERFACE { "directories", OBJECT_MODEL_FUNC(self, 1), ObjectModelEntryFlags::none }, #endif { "fans", OBJECT_MODEL_FUNC_NOSELF(&fansArrayDescriptor), ObjectModelEntryFlags::live }, @@ -272,7 +272,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = { "volumes", OBJECT_MODEL_FUNC_NOSELF(&volumesArrayDescriptor), ObjectModelEntryFlags::none }, // 1. MachineModel.directories -#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_SBC_INTERFACE { "filaments", OBJECT_MODEL_FUNC_NOSELF(FILAMENTS_DIRECTORY), ObjectModelEntryFlags::verbose }, { "firmware", OBJECT_MODEL_FUNC_NOSELF(FIRMWARE_DIRECTORY), ObjectModelEntryFlags::verbose }, { "gCodes", OBJECT_MODEL_FUNC(self->platform->GetGCodeDir()), ObjectModelEntryFlags::verbose }, @@ -367,7 +367,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = // 6. MachineModel.seqs { "boards", OBJECT_MODEL_FUNC((int32_t)self->boardsSeq), ObjectModelEntryFlags::live }, -#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_SBC_INTERFACE { "directories", OBJECT_MODEL_FUNC((int32_t)self->directoriesSeq), ObjectModelEntryFlags::live }, #endif { "fans", OBJECT_MODEL_FUNC((int32_t)self->fansSeq), ObjectModelEntryFlags::live }, @@ -398,8 +398,8 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = constexpr uint8_t RepRap::objectModelTableDescriptor[] = { 7, // number of sub-tables - 15 + SUPPORT_SCANNER + (HAS_MASS_STORAGE | HAS_EMBEDDED_FILES | HAS_LINUX_INTERFACE), // root -#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_LINUX_INTERFACE + 15 + SUPPORT_SCANNER + (HAS_MASS_STORAGE | HAS_EMBEDDED_FILES | HAS_SBC_INTERFACE), // root +#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES || HAS_SBC_INTERFACE 8, // directories #else 0, // directories @@ -409,7 +409,7 @@ constexpr uint8_t RepRap::objectModelTableDescriptor[] = 2, // state.beep 6, // state.messageBox 12 + HAS_NETWORKING + SUPPORT_SCANNER + - 2 * HAS_MASS_STORAGE + (HAS_MASS_STORAGE | HAS_EMBEDDED_FILES | HAS_LINUX_INTERFACE) // seqs + 2 * HAS_MASS_STORAGE + (HAS_MASS_STORAGE | HAS_EMBEDDED_FILES | HAS_SBC_INTERFACE) // seqs }; DEFINE_GET_OBJECT_MODEL_TABLE(RepRap) @@ -432,8 +432,8 @@ RepRap::RepRap() noexcept previousToolNumber(-1), diagnosticsDestination(MessageType::NoDestinationMessage), justSentDiagnostics(false), spinningModule(noModule), stopped(false), active(false), processingConfig(true) -#if HAS_LINUX_INTERFACE - , usingLinuxInterface(false) // default to not using the SBC interface until we have checked for config.g on an SD card, +#if HAS_SBC_INTERFACE + , usingSbcInterface(false) // default to not using the SBC interface until we have checked for config.g on an SD card, // because a disconnected SBC interface can generate noise which may trigger interrupts and DMA #endif { @@ -473,8 +473,8 @@ void RepRap::Init() noexcept { OutputBuffer::Init(); platform = new Platform(); -#if HAS_LINUX_INTERFACE - linuxInterface = new LinuxInterface(); // needs to be allocated early on Duet 2 so as to avoid using any of the last 64K of RAM +#if HAS_SBC_INTERFACE + sbcInterface = new SbcInterface(); // needs to be allocated early on Duet 2 so as to avoid using any of the last 64K of RAM #endif network = new Network(*platform); gCodes = new GCodes(*platform); @@ -535,7 +535,7 @@ void RepRap::Init() noexcept #ifdef DUET3_ATE Duet3Ate::Init(); #endif - // linuxInterface is not initialised until we know we are using it, to prevent a disconnected SBC interface generating interrupts and DMA + // sbcInterface is not initialised until we know we are using it, to prevent a disconnected SBC interface generating interrupts and DMA // Set up the timeout of the regular watchdog, and set up the backup watchdog if there is one. #if SAME5x @@ -585,9 +585,9 @@ void RepRap::Init() noexcept platform->MessageF(UsbMessage, "%s\n", VersionText); -#if HAS_LINUX_INTERFACE && !HAS_MASS_STORAGE - usingLinuxInterface = true; - linuxInterface->Init(); +#if HAS_SBC_INTERFACE && !HAS_MASS_STORAGE + usingSbcInterface = true; + sbcInterface->Init(); FileWriteBuffer::UsingSbcMode(); #endif @@ -611,10 +611,10 @@ void RepRap::Init() noexcept platform->Message(AddWarning(UsbMessage), "no configuration file found\n"); } } -# if HAS_LINUX_INTERFACE +# if HAS_SBC_INTERFACE else if (!MassStorage::IsCardDetected(0)) // if we failed to mount the SD card because there was no card in the slot { - usingLinuxInterface = true; + usingSbcInterface = true; FileWriteBuffer::UsingSbcMode(); } # endif @@ -623,17 +623,17 @@ void RepRap::Init() noexcept delay(3000); // Wait a few seconds so users have a chance to see this platform->MessageF(AddWarning(UsbMessage), "%s\n", reply.c_str()); } -# if HAS_LINUX_INTERFACE - linuxInterface->Init(); +# if HAS_SBC_INTERFACE + sbcInterface->Init(); # endif } #endif -#if HAS_LINUX_INTERFACE - if (usingLinuxInterface) +#if HAS_SBC_INTERFACE + if (usingSbcInterface) { // Keep spinning until the SBC connects - while (!linuxInterface->IsConnected()) + while (!sbcInterface->IsConnected()) { Spin(); } @@ -763,13 +763,13 @@ void RepRap::Spin() noexcept display->Spin(); #endif -#if HAS_LINUX_INTERFACE - // Keep the Linux task spinning from the main task in standalone mode to respond to a SBC if necessary - if (!UsingLinuxInterface()) +#if HAS_SBC_INTERFACE + // Keep the SBC task spinning from the main task in standalone mode to respond to a SBC if necessary + if (!UsingSbcInterface()) { ticksInSpinState = 0; - spinningModule = moduleLinuxInterface; - linuxInterface->Spin(); + spinningModule = moduleSbcInterface; + sbcInterface->Spin(); } #endif @@ -874,7 +874,7 @@ void RepRap::Diagnostics(MessageType mtype) noexcept #ifdef __LPC17xx__ " at %uMhz" // clock speed #endif -#if HAS_LINUX_INTERFACE || SUPPORT_REMOTE_COMMANDS +#if HAS_SBC_INTERFACE || SUPPORT_REMOTE_COMMANDS " (%s mode)" // standalone, SBC or expansion mode #endif "\n", @@ -892,13 +892,13 @@ void RepRap::Diagnostics(MessageType mtype) noexcept #ifdef __LPC17xx__ , (unsigned int)(SystemCoreClock/1000000) #endif -#if HAS_LINUX_INTERFACE || SUPPORT_REMOTE_COMMANDS +#if HAS_SBC_INTERFACE || SUPPORT_REMOTE_COMMANDS , # if SUPPORT_REMOTE_COMMANDS (CanInterface::InExpansionMode()) ? "expansion" : # endif -# if HAS_LINUX_INTERFACE - (UsingLinuxInterface()) ? "SBC" : +# if HAS_SBC_INTERFACE + (UsingSbcInterface()) ? "SBC" : # endif "standalone" #endif @@ -935,10 +935,10 @@ void RepRap::Diagnostics(MessageType mtype) noexcept #if SUPPORT_CAN_EXPANSION CanInterface::Diagnostics(mtype); #endif -#if HAS_LINUX_INTERFACE - if (usingLinuxInterface) +#if HAS_SBC_INTERFACE + if (usingSbcInterface) { - linuxInterface->Diagnostics(mtype); + sbcInterface->Diagnostics(mtype); } else #endif @@ -2511,7 +2511,7 @@ void RepRap::ClearAlert() noexcept size_t RepRap::GetStatusIndex() const noexcept { return (processingConfig) ? 0 // Reading the configuration file -#if HAS_LINUX_INTERFACE && SUPPORT_CAN_EXPANSION +#if HAS_SBC_INTERFACE && SUPPORT_CAN_EXPANSION : (gCodes->IsFlashing() || expansion->IsFlashing()) ? 1 // Flashing a new firmware binary #else : (gCodes->IsFlashing()) ? 1 // Flashing a new firmware binary @@ -2654,7 +2654,7 @@ GCodeResult RepRap::ClearTemperatureFault(int8_t wasDudHeater, const StringRef& return rslt; } -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE // Save some resume information, returning true if successful // We assume that the tool configuration doesn't change, only the temperatures and the mix diff --git a/src/Platform/RepRap.h b/src/Platform/RepRap.h index e3c11e28..a136f253 100644 --- a/src/Platform/RepRap.h +++ b/src/Platform/RepRap.h @@ -126,9 +126,9 @@ public: const char *GetLatestMessage(uint16_t& sequence) const noexcept; const MessageBox& GetMessageBox() const noexcept { return mbox; } #endif -#if HAS_LINUX_INTERFACE - bool UsingLinuxInterface() const noexcept { return usingLinuxInterface; } - LinuxInterface& GetLinuxInterface() const noexcept { return *linuxInterface; } +#if HAS_SBC_INTERFACE + bool UsingSbcInterface() const noexcept { return usingSbcInterface; } + SbcInterface& GetSbcInterface() const noexcept { return *sbcInterface; } #endif #if SUPPORT_CAN_EXPANSION ExpansionManager& GetExpansion() const noexcept { return *expansion; } @@ -161,7 +161,7 @@ public: void SetAlert(const char *msg, const char *title, int mode, float timeout, AxesBitmap controls) noexcept; void ClearAlert() noexcept; -#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool WriteToolSettings(FileStore *f) noexcept; // save some information for the resume file bool WriteToolParameters(FileStore *f, const bool forceWriteOffsets) noexcept; // save some information in config-override.g #endif @@ -248,8 +248,8 @@ private: Display *display; #endif -#if HAS_LINUX_INTERFACE - LinuxInterface *linuxInterface; +#if HAS_SBC_INTERFACE + SbcInterface *sbcInterface; #endif #if SUPPORT_ROLAND @@ -304,8 +304,8 @@ private: bool stopped; bool active; bool processingConfig; -#if HAS_LINUX_INTERFACE - bool usingLinuxInterface; +#if HAS_SBC_INTERFACE + bool usingSbcInterface; #endif }; diff --git a/src/Platform/TaskPriorities.h b/src/Platform/TaskPriorities.h index b3023c3f..7a876799 100644 --- a/src/Platform/TaskPriorities.h +++ b/src/Platform/TaskPriorities.h @@ -13,7 +13,7 @@ namespace TaskPriority { constexpr unsigned int IdlePriority = 0; constexpr unsigned int SpinPriority = 1; // priority for tasks that rarely block -#if HAS_LINUX_INTERFACE +#if HAS_SBC_INTERFACE constexpr unsigned int SbcPriority = 2; // priority for SBC task #endif #if defined(LPC_NETWORKING) -- cgit v1.2.3