AP_HAL_PX4: fix off-by-one error in RCOutput channel sending

This commit is contained in:
Pat Hickey 2013-02-23 15:04:17 -08:00
parent 4c3ee76900
commit e0457f21de

View File

@ -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;