RC: set dead zone only if parameter has not been set by user

This commit is contained in:
Randy Mackay 2013-07-11 23:08:16 +09:00
parent f300df5fd1
commit 47437b9ddf
2 changed files with 5 additions and 3 deletions

View File

@ -95,9 +95,11 @@ RC_Channel::set_angle(int16_t angle)
} }
void void
RC_Channel::set_dead_zone(int16_t dzone) RC_Channel::set_default_dead_zone(int16_t dzone)
{ {
_dead_zone.set_and_save(abs(dzone >>1)); if (!_dead_zone.load()) {
_dead_zone.set(abs(dzone));
}
} }
void void

View File

@ -49,7 +49,7 @@ public:
void set_angle(int16_t angle); void set_angle(int16_t angle);
void set_reverse(bool reverse); void set_reverse(bool reverse);
bool get_reverse(void); bool get_reverse(void);
void set_dead_zone(int16_t dzone); void set_default_dead_zone(int16_t dzone);
// read input from APM_RC - create a control_in value // read input from APM_RC - create a control_in value
void set_pwm(int16_t pwm); void set_pwm(int16_t pwm);