From e0457f21de70dbabf5eecfd42bda52e1daf0704d Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Sat, 23 Feb 2013 15:04:17 -0800 Subject: [PATCH] AP_HAL_PX4: fix off-by-one error in RCOutput channel sending --- libraries/AP_HAL_PX4/RCOutput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_PX4/RCOutput.cpp b/libraries/AP_HAL_PX4/RCOutput.cpp index 58105c6c64..ec978112f3 100644 --- a/libraries/AP_HAL_PX4/RCOutput.cpp +++ b/libraries/AP_HAL_PX4/RCOutput.cpp @@ -70,8 +70,8 @@ void PX4RCOutput::write(uint8_t ch, uint16_t period_us) if (ch >= PX4_NUM_OUTPUT_CHANNELS) { return; } - if (ch > _max_channel) { - _max_channel = ch; + if (ch >= _max_channel) { + _max_channel = ch + 1; } if (period_us != _period[ch]) { _period[ch] = period_us;