summaryrefslogtreecommitdiff
path: root/wrapper/wrapper.cpp
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2020-09-29 23:11:11 -0700
committerGitHub <[email protected]>2020-09-29 23:11:11 -0700
commitf62dc2ef8866d106fe67d29a0685677ae4c05d67 (patch)
tree83d9403b035f37d8d79f8be49795821a11973829 /wrapper/wrapper.cpp
parentMerge pull request #30 from a1xd/fix-1.0.0 (diff)
parentforbid 0 accel with naturalgain (diff)
downloadrawaccel-f62dc2ef8866d106fe67d29a0685677ae4c05d67.tar.xz
rawaccel-f62dc2ef8866d106fe67d29a0685677ae4c05d67.zip
Merge pull request #31 from a1xd/fix-1.0.0
forbid 0 accel with naturalgain
Diffstat (limited to 'wrapper/wrapper.cpp')
-rw-r--r--wrapper/wrapper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index a23205f..a8fc0fb 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -137,6 +137,8 @@ error_list_t^ get_accel_errors(AccelMode mode, AccelArgs^ args)
if (args->acceleration > 10 && is_mode(am::natural, am::naturalgain))
error_list->Add("acceleration can not be greater than 10");
+ else if (args->acceleration == 0 && is_mode(am::naturalgain))
+ error_list->Add("acceleration must be positive");
else if (args->acceleration < 0) {
bool additive = m < am::power;
if (additive) error_list->Add("acceleration can not be negative, use a negative weight to compensate");