RC_Channel: removed pwm_out variable from RC_Channel

saves 16 bytes
This commit is contained in:
Andrew Tridgell 2013-03-29 19:32:52 +11:00
parent 60ae67992d
commit 8e4a003d8d
2 changed files with 3 additions and 4 deletions

View File

@ -176,15 +176,15 @@ void
RC_Channel::calc_pwm(void)
{
if(_type == RC_CHANNEL_TYPE_RANGE) {
pwm_out = range_to_pwm();
int16_t pwm_out = range_to_pwm();
radio_out = (_reverse >= 0) ? (radio_min + pwm_out) : (radio_max - pwm_out);
}else if(_type == RC_CHANNEL_TYPE_ANGLE_RAW) {
pwm_out = (float)servo_out * 0.1f;
int16_t pwm_out = (float)servo_out * 0.1f;
radio_out = (pwm_out * _reverse) + radio_trim;
}else{ // RC_CHANNEL_TYPE_ANGLE
pwm_out = angle_to_pwm();
int16_t pwm_out = angle_to_pwm();
radio_out = pwm_out + radio_trim;
}

View File

@ -75,7 +75,6 @@ public:
void calc_pwm(void);
// PWM is without the offset from radio_min
int16_t pwm_out;
int16_t radio_out;
AP_Int16 radio_min;