pwm_out_sim, simulator_mavlink: fixed code style

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman 2018-02-22 20:20:00 +01:00 committed by Daniel Agar
parent 10bf6a4b59
commit 2549b702f0
2 changed files with 12 additions and 6 deletions

View File

@ -196,7 +196,7 @@ PWMSim::PWMSim() :
{
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_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: {
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];
}
}
break;
}
case PWM_SERVO_SET_MAX_PWM: {
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];
}
}
break;
}

View File

@ -102,7 +102,7 @@ void Simulator::pack_actuator_message(mavlink_hil_actuator_controls_t &msg, unsi
unsigned n;
switch (_system_type) {
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_DUOROTOR:
n = 2;
break;