aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/px4io/px4io.cpp
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2013-10-07 18:03:05 +0200
committerJulian Oes <julian@oes.ch>2013-10-07 18:03:05 +0200
commit19879432ad6cf709af25192401829719defd2983 (patch)
tree567bda3cb54df9c177ac1d2e47ece0c30ba03bce /src/drivers/px4io/px4io.cpp
parent03edf901617c5f5785ef7d78d8fa74e2bfdd45fc (diff)
downloadpx4-firmware-19879432ad6cf709af25192401829719defd2983.tar.gz
px4-firmware-19879432ad6cf709af25192401829719defd2983.tar.bz2
px4-firmware-19879432ad6cf709af25192401829719defd2983.zip
Trying to get rid of magic PWM numbers
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r--src/drivers/px4io/px4io.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp
index ea3a73822..f9dc3773e 100644
--- a/src/drivers/px4io/px4io.cpp
+++ b/src/drivers/px4io/px4io.cpp
@@ -1818,7 +1818,7 @@ PX4IO::ioctl(file * /*filep*/, int cmd, unsigned long arg)
/* TODO: we could go lower for e.g. TurboPWM */
unsigned channel = cmd - PWM_SERVO_SET(0);
- if ((channel >= _max_actuators) || (arg < 900) || (arg > 2100)) {
+ if ((channel >= _max_actuators) || (arg < PWM_MIN) || (arg > PWM_MAX)) {
ret = -EINVAL;
} else {
/* send a direct PWM value */
@@ -2402,8 +2402,8 @@ px4io_main(int argc, char *argv[])
/* set channel to commandline argument or to 900 for non-provided channels */
if (argc > i + 2) {
failsafe[i] = atoi(argv[i+2]);
- if (failsafe[i] < 800 || failsafe[i] > 2200) {
- errx(1, "value out of range of 800 < value < 2200. Aborting.");
+ if (failsafe[i] < PWM_MIN || failsafe[i] > PWM_AX) {
+ errx(1, "value out of range of %d < value < %d. Aborting.", PWM_MIN, PWM_MAX);
}
} else {
/* a zero value will result in stopping to output any pulse */