From a093926b04b6ac177ac93049880892449e378d1f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Mar 2013 22:36:29 +1100 Subject: [PATCH] Revert "RC_Channel: removed pwm_out variable from RC_Channel" This reverts commit 8e4a003d8dca3ee1bc3ae301d96c3cce53af40cf. It is used by MotorsMatrix --- libraries/RC_Channel/RC_Channel.cpp | 6 +++--- libraries/RC_Channel/RC_Channel.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index b17c67690d..cc591e5c24 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) { - int16_t pwm_out = range_to_pwm(); + 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) { - int16_t pwm_out = (float)servo_out * 0.1f; + pwm_out = (float)servo_out * 0.1f; radio_out = (pwm_out * _reverse) + radio_trim; }else{ // RC_CHANNEL_TYPE_ANGLE - int16_t pwm_out = angle_to_pwm(); + 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 f25a7d36c1..f2120b93d8 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -75,6 +75,7 @@ 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;