summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-01 09:20:19 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-01 09:20:19 +0200
commit023490db6ac86ee3f82b1b89e279d0b2ccae5fd3 (patch)
tree758cef58d4a33ef3221f766f34404830f94f6b06 /src/device
parenta624cd3593b73e2503b67c4fdb4007340271ce42 (diff)
Adds invert option, updates usage.
Diffstat (limited to 'src/device')
-rw-r--r--src/device/axis/axis_filter.c5
-rw-r--r--src/device/axis/axis_option.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/device/axis/axis_filter.c b/src/device/axis/axis_filter.c
index 6258ad9..d7840ca 100644
--- a/src/device/axis/axis_filter.c
+++ b/src/device/axis/axis_filter.c
@@ -122,6 +122,11 @@ int relabsd_axis_filter_new_value
return 0;
}
+ if (axis->flags[RELABSD_INVERT])
+ {
+ *value = -(*value);
+ }
+
if (axis->flags[RELABSD_NOT_ABS])
{
return 1;
diff --git a/src/device/axis/axis_option.c b/src/device/axis/axis_option.c
index 7796eb7..e8d06f5 100644
--- a/src/device/axis/axis_option.c
+++ b/src/device/axis/axis_option.c
@@ -57,10 +57,14 @@ int relabsd_axis_enable_option_from_name
);
}
}
- else if (RELABSD_IS_PREFIX("notabs", option_name))
+ else if (RELABSD_IS_PREFIX("not_abs", option_name))
{
axis->flags[RELABSD_NOT_ABS] = 1;
}
+ else if (RELABSD_IS_PREFIX("invert", option_name))
+ {
+ axis->flags[RELABSD_INVERT] = 1;
+ }
else if (RELABSD_IS_PREFIX("convert_to=", option_name))
{
axis->convert_to =