mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 06:33:33 +08:00
Rename the FMU->IO output controls to reflect the fact that they are controls, not servo values.
This commit is contained in:
+2
-2
@@ -171,8 +171,8 @@ comms_handle_command(const void *buffer, size_t length)
|
|||||||
irqstate_t flags = irqsave();
|
irqstate_t flags = irqsave();
|
||||||
|
|
||||||
/* fetch new PWM output values */
|
/* fetch new PWM output values */
|
||||||
for (unsigned i = 0; i < PX4IO_OUTPUT_CHANNELS; i++)
|
for (unsigned i = 0; i < PX4IO_CONTROL_CHANNELS; i++)
|
||||||
system_state.fmu_channel_data[i] = cmd->servo_command[i];
|
system_state.fmu_channel_data[i] = cmd->output_control[i];
|
||||||
|
|
||||||
/* if the IO is armed and the FMU gets disarmed, the IO must also disarm */
|
/* if the IO is armed and the FMU gets disarmed, the IO must also disarm */
|
||||||
if (system_state.arm_ok && !cmd->arm_ok) {
|
if (system_state.arm_ok && !cmd->arm_ok) {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ mixer_tick(void)
|
|||||||
*/
|
*/
|
||||||
if (system_state.mixer_use_fmu) {
|
if (system_state.mixer_use_fmu) {
|
||||||
/* we have recent control data from the FMU */
|
/* we have recent control data from the FMU */
|
||||||
control_count = PX4IO_OUTPUT_CHANNELS;
|
control_count = PX4IO_CONTROL_CHANNELS;
|
||||||
control_values = &system_state.fmu_channel_data[0];
|
control_values = &system_state.fmu_channel_data[0];
|
||||||
|
|
||||||
/* check that we are receiving fresh data from the FMU */
|
/* check that we are receiving fresh data from the FMU */
|
||||||
@@ -170,7 +170,6 @@ mixer_callback(uintptr_t handle,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* scale from current PWM units (1000-2000) to mixer input values */
|
/* scale from current PWM units (1000-2000) to mixer input values */
|
||||||
/* XXX this presents some ugly problems w.r.t failsafe and R/C input scaling that have to be addressed */
|
|
||||||
control = ((float)control_values[control_index] - 1500.0f) / 500.0f;
|
control = ((float)control_values[control_index] - 1500.0f) / 500.0f;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define PX4IO_OUTPUT_CHANNELS 8
|
#define PX4IO_CONTROL_CHANNELS 8
|
||||||
#define PX4IO_INPUT_CHANNELS 12
|
#define PX4IO_INPUT_CHANNELS 12
|
||||||
#define PX4IO_RELAY_CHANNELS 4
|
#define PX4IO_RELAY_CHANNELS 4
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ struct px4io_command {
|
|||||||
uint16_t f2i_magic;
|
uint16_t f2i_magic;
|
||||||
#define F2I_MAGIC 0x636d
|
#define F2I_MAGIC 0x636d
|
||||||
|
|
||||||
uint16_t servo_command[PX4IO_OUTPUT_CHANNELS];
|
uint16_t output_control[PX4IO_CONTROL_CHANNELS];
|
||||||
bool relay_state[PX4IO_RELAY_CHANNELS];
|
bool relay_state[PX4IO_RELAY_CHANNELS];
|
||||||
bool arm_ok;
|
bool arm_ok;
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -81,7 +81,7 @@ struct sys_state_s {
|
|||||||
/*
|
/*
|
||||||
* Control signals from FMU.
|
* Control signals from FMU.
|
||||||
*/
|
*/
|
||||||
uint16_t fmu_channel_data[PX4IO_OUTPUT_CHANNELS];
|
uint16_t fmu_channel_data[PX4IO_CONTROL_CHANNELS];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mixed servo outputs
|
* Mixed servo outputs
|
||||||
|
|||||||
Reference in New Issue
Block a user