mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_RSSI: fixed build warnings
This commit is contained in:
parent
9e17275488
commit
672b4be3d2
@ -190,11 +190,11 @@ float AP_RSSI::read_pin_rssi()
|
|||||||
// read the RSSI value from a PWM value on a RC channel
|
// read the RSSI value from a PWM value on a RC channel
|
||||||
float AP_RSSI::read_channel_rssi()
|
float AP_RSSI::read_channel_rssi()
|
||||||
{
|
{
|
||||||
RC_Channel *ch = rc().channel(rssi_channel-1);
|
RC_Channel *c = rc().channel(rssi_channel-1);
|
||||||
if (ch == nullptr) {
|
if (c == nullptr) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
uint16_t rssi_channel_value = ch->get_radio_in();
|
uint16_t rssi_channel_value = c->get_radio_in();
|
||||||
float channel_rssi = scale_and_constrain_float_rssi(rssi_channel_value, rssi_channel_low_pwm_value, rssi_channel_high_pwm_value);
|
float channel_rssi = scale_and_constrain_float_rssi(rssi_channel_value, rssi_channel_low_pwm_value, rssi_channel_high_pwm_value);
|
||||||
return channel_rssi;
|
return channel_rssi;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user