mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 02:41:36 +08:00
Enable flaps in manual override
This commit is contained in:
@@ -1265,11 +1265,18 @@ PX4IO::io_set_rc_config()
|
|||||||
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||||
input_map[ichan - 1] = 3;
|
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))
|
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||||
input_map[ichan - 1] = 4;
|
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.
|
* Iterate all possible RC inputs.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ static perf_counter_t c_gather_ppm;
|
|||||||
|
|
||||||
static int _dsm_fd;
|
static int _dsm_fd;
|
||||||
|
|
||||||
|
static uint16_t rc_value_override = 0;
|
||||||
|
|
||||||
bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated)
|
bool dsm_port_input(uint16_t *rssi, bool *dsm_updated, bool *st24_updated)
|
||||||
{
|
{
|
||||||
perf_begin(c_gather_dsm);
|
perf_begin(c_gather_dsm);
|
||||||
@@ -313,8 +315,14 @@ controls_tick() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
/* pick out override channel, indicated by mapping 8 (9 th channel, virtual) */
|
||||||
assigned_channels |= (1 << mapped);
|
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.
|
* 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;
|
override = true;
|
||||||
|
|
||||||
if (override) {
|
if (override) {
|
||||||
|
|||||||
Reference in New Issue
Block a user