diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-05-13 23:25:18 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-05-13 23:25:18 +0200 |
commit | 9a07788d58dd6f1ca6657e18048bf88eae5f6e10 (patch) | |
tree | ddc5daec11e22b644721f1b245f126a5cb2be5d4 /src/drivers | |
parent | ff518e72d4f8628a44ff5d4106cf56ace6ec97f7 (diff) | |
download | px4-firmware-9a07788d58dd6f1ca6657e18048bf88eae5f6e10.tar.gz px4-firmware-9a07788d58dd6f1ca6657e18048bf88eae5f6e10.tar.bz2 px4-firmware-9a07788d58dd6f1ca6657e18048bf88eae5f6e10.zip |
Hotfix: Off-by-one fix in overflow check
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/ardrone_interface/ardrone_motor_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/ardrone_interface/ardrone_motor_control.c b/src/drivers/ardrone_interface/ardrone_motor_control.c index f15c74a22..ecd31a073 100644 --- a/src/drivers/ardrone_interface/ardrone_motor_control.c +++ b/src/drivers/ardrone_interface/ardrone_motor_control.c @@ -482,10 +482,10 @@ void ardrone_mixing_and_output(int ardrone_write, const struct actuator_controls motor_pwm[3] = (motor_pwm[3] > 0) ? motor_pwm[3] : 10; /* Failsafe logic - should never be necessary */ - motor_pwm[0] = (motor_pwm[0] <= 512) ? motor_pwm[0] : 512; - motor_pwm[1] = (motor_pwm[1] <= 512) ? motor_pwm[1] : 512; - motor_pwm[2] = (motor_pwm[2] <= 512) ? motor_pwm[2] : 512; - motor_pwm[3] = (motor_pwm[3] <= 512) ? motor_pwm[3] : 512; + motor_pwm[0] = (motor_pwm[0] <= 511) ? motor_pwm[0] : 511; + motor_pwm[1] = (motor_pwm[1] <= 511) ? motor_pwm[1] : 511; + motor_pwm[2] = (motor_pwm[2] <= 511) ? motor_pwm[2] : 511; + motor_pwm[3] = (motor_pwm[3] <= 511) ? motor_pwm[3] : 511; /* send motors via UART */ ardrone_write_motor_commands(ardrone_write, motor_pwm[0], motor_pwm[1], motor_pwm[2], motor_pwm[3]); |