aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-04-25 11:30:13 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-04-25 11:54:11 -0400
commit70ea0806d96df5a8ea83793da46f2676d9695e69 (patch)
tree9e62ee6dd27eba02e87efe7caec87cb317b9f789
parent3dadcd3614037b04d8c5fd66e2121fa22ac0694b (diff)
downloadkutter-70ea0806d96df5a8ea83793da46f2676d9695e69.tar.gz
kutter-70ea0806d96df5a8ea83793da46f2676d9695e69.tar.xz
kutter-70ea0806d96df5a8ea83793da46f2676d9695e69.zip
linux: Raise an error if configuring a pullup when that is not supported
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/linux/gpio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/linux/gpio.c b/src/linux/gpio.c
index ccc66a7f..15ed3bae 100644
--- a/src/linux/gpio.c
+++ b/src/linux/gpio.c
@@ -153,6 +153,9 @@ gpio_in_reset(struct gpio_in g, int8_t pull_up)
} else if (pull_up < 0) {
req.flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN;
}
+#else
+ if (pull_up)
+ shutdown("Linux gpio interface does not support pullup/pulldown");
#endif
req.lineoffsets[0] = g.line->offset;
strncpy(req.consumer_label, GPIO_CONSUMER, sizeof(req.consumer_label) - 1);