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>2021-11-18 16:06:48 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-11-18 16:06:48 +0300
commitcd162aab06bf3cb9df361eb59973125e1c9b42dc (patch)
treeea8b1ca8af2a83c93d10e4aed876995331989e95
parentbe212de630ce67e283d7ab78cda796165e2b7d43 (diff)
File GCodeResult.h moved to CANlib and #included in RepRapFirmware.h
-rw-r--r--src/GCodes/GCodeResult.h54
-rw-r--r--src/Movement/StepperDrivers/TMC22xx.h1
-rw-r--r--src/Movement/StepperDrivers/TMC51xx.h1
-rw-r--r--src/RepRapFirmware.h12
4 files changed, 9 insertions, 59 deletions
diff --git a/src/GCodes/GCodeResult.h b/src/GCodes/GCodeResult.h
deleted file mode 100644
index a55caac2..00000000
--- a/src/GCodes/GCodeResult.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * GCodeResult.h
- *
- * Created on: 1 Oct 2017
- * Author: David
- */
-
-#ifndef SRC_GCODES_GCODERESULT_H_
-#define SRC_GCODES_GCODERESULT_H_
-
-#include <cctype>
-#include <Platform/MessageType.h>
-
-// Enumeration to specify the result of attempting to process a GCode command
-// These are ordered such that errors > warnings > ok
-// *** Do not change the order! These must be the same for the main board and all CAN expansion boards! ***
-enum class GCodeResult : uint8_t
-{
- notFinished, // we haven't finished processing this command
- ok, // we have finished processing this code
- warning,
- warningNotSupported,
- error,
- errorNotSupported,
- notSupportedInCurrentMode,
- badOrMissingParameter,
- remoteInternalError
-};
-
-// Convert a true/false error/no-error indication to a GCodeResult
-inline GCodeResult GetGCodeResultFromError(bool err) noexcept
-{
- return (err) ? GCodeResult::error : GCodeResult::ok;
-}
-
-// Convert a true/false success/failure indication to a GCodeResult
-inline GCodeResult GetGCodeResultFromSuccess(bool ok) noexcept
-{
- return (ok) ? GCodeResult::ok : GCodeResult::error;
-}
-
-// Convert a true/false finished/not-finished indication to a GCodeResult
-inline GCodeResult GetGCodeResultFromFinished(bool finished) noexcept
-{
- return (finished) ? GCodeResult::ok : GCodeResult::notFinished;
-}
-
-// Convert an error or warning result into a suitable generic message type. Should only be called with GCodeResult::warning or GCodeResult::error.
-inline MessageType GetGenericMessageType(GCodeResult rslt)
-{
- return (rslt == GCodeResult::warning) ? WarningMessage : ErrorMessage;
-}
-
-#endif /* SRC_GCODES_GCODERESULT_H_ */
diff --git a/src/Movement/StepperDrivers/TMC22xx.h b/src/Movement/StepperDrivers/TMC22xx.h
index cc88c5f3..28008602 100644
--- a/src/Movement/StepperDrivers/TMC22xx.h
+++ b/src/Movement/StepperDrivers/TMC22xx.h
@@ -13,7 +13,6 @@
#if SUPPORT_TMC22xx
#include "DriverMode.h"
-#include <GCodes/GCodeResult.h>
namespace SmartDrivers
{
diff --git a/src/Movement/StepperDrivers/TMC51xx.h b/src/Movement/StepperDrivers/TMC51xx.h
index 6ae3040c..54d7531e 100644
--- a/src/Movement/StepperDrivers/TMC51xx.h
+++ b/src/Movement/StepperDrivers/TMC51xx.h
@@ -12,7 +12,6 @@
#if SUPPORT_TMC51xx
-#include <GCodes/GCodeResult.h>
#include "DriverMode.h"
namespace SmartDrivers
diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h
index 798c66d2..0351298c 100644
--- a/src/RepRapFirmware.h
+++ b/src/RepRapFirmware.h
@@ -51,11 +51,17 @@ const char *_ecv_array SafeStrptime(const char *_ecv_array buf, const char *_ecv
#endif
#include <CoreIO.h>
-# include <Devices.h>
+#include <Devices.h>
// The following are needed by many other files, so include them here
-# include <Platform/MessageType.h>
-# include <GCodes/GCodeResult.h>
+#include <Platform/MessageType.h>
+#include <GCodeResult.h>
+
+// Convert an error or warning result into a suitable generic message type. Should only be called with GCodeResult::warning or GCodeResult::error.
+inline MessageType GetGenericMessageType(GCodeResult rslt)
+{
+ return (rslt == GCodeResult::warning) ? WarningMessage : ErrorMessage;
+}
#define SPEED_CRITICAL __attribute__((optimize("O2")))