From 8e4a003d8dca3ee1bc3ae301d96c3cce53af40cf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Mar 2013 19:32:52 +1100 Subject: [PATCH] RC_Channel: removed pwm_out variable from RC_Channel saves 16 bytes --- libraries/RC_Channel/RC_Channel.cpp | 6 +++--- libraries/RC_Channel/RC_Channel.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index cc591e5c24..b17c67690d 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -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; } diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index f2120b93d8..f25a7d36c1 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -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;