mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 17:23:34 +08:00
pwm_out_sim, simulator_mavlink: fixed code style
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -196,7 +196,7 @@ PWMSim::PWMSim() :
|
|||||||
{
|
{
|
||||||
memset(_controls, 0, sizeof(_controls));
|
memset(_controls, 0, sizeof(_controls));
|
||||||
|
|
||||||
for(unsigned i = 0; i < _max_actuators; i++) {
|
for (unsigned i = 0; i < _max_actuators; i++) {
|
||||||
_pwm_min[i] = PWM_SIM_PWM_MIN_MAGIC;
|
_pwm_min[i] = PWM_SIM_PWM_MIN_MAGIC;
|
||||||
_pwm_max[i] = PWM_SIM_PWM_MAX_MAGIC;
|
_pwm_max[i] = PWM_SIM_PWM_MAX_MAGIC;
|
||||||
}
|
}
|
||||||
@@ -641,21 +641,27 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
case PWM_SERVO_SET_MIN_PWM: {
|
case PWM_SERVO_SET_MIN_PWM: {
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||||
for(unsigned i = 0; i < pwm->channel_count; i++) {
|
|
||||||
|
|
||||||
if (i <= _max_actuators)
|
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||||
|
|
||||||
|
if (i <= _max_actuators) {
|
||||||
_pwm_min[i] = pwm->values[i];
|
_pwm_min[i] = pwm->values[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PWM_SERVO_SET_MAX_PWM: {
|
case PWM_SERVO_SET_MAX_PWM: {
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||||
for(unsigned i = 0; i < pwm->channel_count; i++) {
|
|
||||||
|
|
||||||
if (i <= _max_actuators)
|
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||||
|
|
||||||
|
if (i <= _max_actuators) {
|
||||||
_pwm_max[i] = pwm->values[i];
|
_pwm_max[i] = pwm->values[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void Simulator::pack_actuator_message(mavlink_hil_actuator_controls_t &msg, unsi
|
|||||||
unsigned n;
|
unsigned n;
|
||||||
|
|
||||||
switch (_system_type) {
|
switch (_system_type) {
|
||||||
case MAV_TYPE_VTOL_DUOROTOR:
|
case MAV_TYPE_VTOL_DUOROTOR:
|
||||||
n = 2;
|
n = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user