forked from Archive/PX4-Autopilot
Enable flaps in manual override
This commit is contained in:
parent
3eb68bc660
commit
0d917576d4
|
@ -1265,11 +1265,18 @@ PX4IO::io_set_rc_config()
|
|||
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||
input_map[ichan - 1] = 3;
|
||||
|
||||
param_get(param_find("RC_MAP_MODE_SW"), &ichan);
|
||||
param_get(param_find("RC_MAP_FLAPS"), &ichan);
|
||||
|
||||
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||
input_map[ichan - 1] = 4;
|
||||
|
||||
param_get(param_find("RC_MAP_MODE_SW"), &ichan);
|
||||
|
||||
if ((ichan >= 0) && (ichan < (int)_max_rc_input)) {
|
||||
/* use out of normal bounds index to indicate special channel */
|
||||
input_map[ichan - 1] = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate all possible RC inputs.
|
||||
*/
|
||||
|
|
|
@ -60,6 +60,8 @@ static perf_counter_t c_gather_ppm;
|
|||
|
||||
static int _dsm_fd;
|
||||
|
||||
static uint16_t rc_value_override = 0;
|
||||
|
||||
bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated)
|
||||
{
|
||||
perf_begin(c_gather_dsm);
|
||||
|
@ -313,8 +315,14 @@ controls_tick() {
|
|||
}
|
||||
}
|
||||
|
||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
||||
assigned_channels |= (1 << mapped);
|
||||
/* pick out override channel, indicated by mapping 8 (9 th channel, virtual) */
|
||||
if (mapped == 8) {
|
||||
rc_value_override = SIGNED_TO_REG(scaled);
|
||||
} else {
|
||||
/* normal channel */
|
||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
||||
assigned_channels |= (1 << mapped);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -409,7 +417,7 @@ controls_tick() {
|
|||
* requested override.
|
||||
*
|
||||
*/
|
||||
if ((r_status_flags & PX4IO_P_STATUS_FLAGS_RC_OK) && (REG_TO_SIGNED(r_rc_values[4]) < RC_CHANNEL_LOW_THRESH))
|
||||
if ((r_status_flags & PX4IO_P_STATUS_FLAGS_RC_OK) && (REG_TO_SIGNED(rc_value_override) < RC_CHANNEL_LOW_THRESH))
|
||||
override = true;
|
||||
|
||||
if (override) {
|
||||
|
|
Loading…
Reference in New Issue