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-05-02 17:13:46 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-05-02 17:13:46 +0300
commitf00d3a5490d27183fd2c7752fa63469783d05dc0 (patch)
tree0bdd4474070656b3452f0d4cebf868729813976f /src/GCodes/TriggerItem.h
parent4c0d60f194195db1046b58d1d0edbc0a29a04449 (diff)
Changes for eCv
Diffstat (limited to 'src/GCodes/TriggerItem.h')
-rw-r--r--src/GCodes/TriggerItem.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/GCodes/TriggerItem.h b/src/GCodes/TriggerItem.h
new file mode 100644
index 00000000..4adc2dba
--- /dev/null
+++ b/src/GCodes/TriggerItem.h
@@ -0,0 +1,41 @@
+/*
+ * Trigger.h
+ *
+ * Created on: 6 Jun 2019
+ * Author: David
+ */
+
+#ifndef SRC_GCODES_TRIGGERITEM_H_
+#define SRC_GCODES_TRIGGERITEM_H_
+
+#include <RepRapFirmware.h>
+#include <Hardware/IoPorts.h>
+
+class TriggerItem
+{
+public:
+ TriggerItem() noexcept;
+
+ void Init() noexcept;
+
+ // Return true if this trigger is unused, i.e. it doesn't watch any pins
+ bool IsUnused() const noexcept;
+
+ // Check whether this trigger is active and update the input states
+ bool Check() noexcept;
+
+ // Handle M581 for this trigger
+ GCodeResult Configure(unsigned int number, GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException);
+
+ // Handle M582 for this trigger
+ bool CheckLevel() noexcept;
+
+private:
+ static void AppendInputNames(AxesBitmap endstops, InputPortsBitmap inputs, const StringRef& reply) noexcept;
+
+ AxesBitmap highLevelEndstops, lowLevelEndstops, endstopStates;
+ InputPortsBitmap highLevelInputs, lowLevelInputs, inputStates;
+ int8_t condition;
+};
+
+#endif /* SRC_GCODES_TRIGGERITEM_H_ */