AP_ServoRelayEvents: fixed disabling repeated events on set_servo()

This commit is contained in:
Andrew Tridgell 2014-02-06 10:03:26 +11:00
parent 058e058487
commit 264c092aa6
1 changed files with 5 additions and 5 deletions

View File

@ -25,19 +25,19 @@
extern const AP_HAL::HAL& hal;
bool AP_ServoRelayEvents::do_set_servo(uint8_t channel, uint16_t pwm)
bool AP_ServoRelayEvents::do_set_servo(uint8_t _channel, uint16_t pwm)
{
if (!(mask & 1U<<(channel-1))) {
if (!(mask & 1U<<(_channel-1))) {
// not allowed
return false;
}
if (type == EVENT_TYPE_SERVO &&
channel == channel) {
channel == _channel) {
// cancel previous repeat
repeat = 0;
}
hal.rcout->enable_ch(channel-1);
hal.rcout->write(channel-1, pwm);
hal.rcout->enable_ch(_channel-1);
hal.rcout->write(_channel-1, pwm);
return true;
}