154 return (((int32_t)(
high_in) * (int32_t)(r_in - radio_trim_low)) / (int32_t)(
radio_max - radio_trim_low));
187 int16_t radio_trim_high = _trim + _dead_zone;
188 int16_t radio_trim_low = _trim - _dead_zone;
190 int16_t reverse_mul = (
reversed?-1:1);
192 return reverse_mul * ((int32_t)
high_in * (int32_t)(
radio_in - radio_trim_high)) / (int32_t)(
radio_max - radio_trim_high);
194 return reverse_mul * ((int32_t)
high_in * (int32_t)(
radio_in - radio_trim_low)) / (int32_t)(radio_trim_low -
radio_min);
234 int16_t radio_trim_low =
radio_min + _dead_zone;
236 if (r_in > radio_trim_low) {
237 return (((int32_t)(
high_in) * (int32_t)(r_in - radio_trim_low)) / (int32_t)(
radio_max - radio_trim_low));
267 int16_t reverse_mul = (
reversed?-1:1);
288 int16_t reverse_mul = (
reversed?-1:1);
289 if (radio_in < dz_min && dz_min >
radio_min) {
290 ret = reverse_mul * (float)(
radio_in - dz_min) / (float)(dz_min - radio_min);
int16_t pwm_to_angle_dz(uint16_t dead_zone)
void set_range(uint16_t high)
int16_t get_control_mid() const
int16_t constrain_int16(const int16_t amt, const int16_t low, const int16_t high)
void recompute_pwm_no_deadzone()
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
void set_pwm(int16_t pwm)
#define AP_GROUPINFO(name, idx, clazz, element, def)
void set_angle(uint16_t angle)
#define RC_CHANNEL_TYPE_ANGLE
bool is_bounded_int32(int32_t value, int32_t lower_bound, int32_t upper_bound)
RC_Channel manager, with EEPROM-backed storage of constants.
static const struct AP_Param::GroupInfo var_info[]
Object managing one RC channel.
bool min_max_configured() const
int16_t get_control_in_zero_dz(void)
float constrain_float(const float amt, const float low, const float high)
bool get_reverse(void) const
int16_t pwm_to_range_dz(uint16_t dead_zone)
int16_t pwm_to_angle_dz_trim(uint16_t dead_zone, uint16_t trim)
static uint32_t configured_mask
void set_default_dead_zone(int16_t dzone)
static void setup_object_defaults(const void *object_pointer, const struct GroupInfo *group_info)
#define RC_CHANNEL_TYPE_RANGE