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
path: root/src/GPIO
diff options
context:
space:
mode:
authorChristian Hammacher <bmasterc@gmail.com>2020-03-11 17:54:12 +0300
committerChristian Hammacher <bmasterc@gmail.com>2020-03-11 17:54:12 +0300
commitab57b7730c34b5d16502b072ecbfebb55dbeaa43 (patch)
tree2b506ce7fbcf9723f88cd475786a13be7b2cd6de /src/GPIO
parent226c386479345204aecbc2f340bb3a126311260d (diff)
Added some more missing OM fields
Diffstat (limited to 'src/GPIO')
-rw-r--r--src/GPIO/GpioPorts.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/GPIO/GpioPorts.cpp b/src/GPIO/GpioPorts.cpp
index 89440a23..e4940741 100644
--- a/src/GPIO/GpioPorts.cpp
+++ b/src/GPIO/GpioPorts.cpp
@@ -23,13 +23,14 @@
// Macro to build a standard lambda function that includes the necessary type conversions
#define OBJECT_MODEL_FUNC(...) OBJECT_MODEL_FUNC_BODY(GpInputPort, __VA_ARGS__)
+#define OBJECT_MODEL_FUNC_IF(_condition,...) OBJECT_MODEL_FUNC_IF_BODY(GpInputPort, _condition,__VA_ARGS__)
constexpr ObjectModelTableEntry GpInputPort::objectModelTable[] =
{
// Within each group, these entries must be in alphabetical order
// 0. sensors members
{ "configured", OBJECT_MODEL_FUNC(!self->IsUnused()), ObjectModelEntryFlags::none },
- { "value", OBJECT_MODEL_FUNC(self->GetState()), ObjectModelEntryFlags::live },
+ { "value", OBJECT_MODEL_FUNC_IF(!self->IsUnused(), self->GetState()), ObjectModelEntryFlags::live },
};
constexpr uint8_t GpInputPort::objectModelTableDescriptor[] = { 1, 2 };