Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/AP_Motors/AP_MotorsMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void AP_MotorsMatrix::output_to_motors()

// convert output to PWM and send to each motor
for (i = 0; i < AP_MOTORS_MAX_NUM_MOTORS; i++) {
if (motor_enabled[i]) {
if (motor_enabled_mask(i)) {
rc_write(i, output_to_pwm(_actuator[i]));
}
}
Expand Down
12 changes: 9 additions & 3 deletions libraries/AP_Motors/AP_MotorsTri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,15 @@ void AP_MotorsTri::output_to_motors()
break;
}

rc_write(AP_MOTORS_MOT_1, output_to_pwm(_actuator[AP_MOTORS_MOT_1]));
rc_write(AP_MOTORS_MOT_2, output_to_pwm(_actuator[AP_MOTORS_MOT_2]));
rc_write(AP_MOTORS_MOT_4, output_to_pwm(_actuator[AP_MOTORS_MOT_4]));
if (motor_enabled_mask(AP_MOTORS_MOT_1)) {
rc_write(AP_MOTORS_MOT_1, output_to_pwm(_actuator[AP_MOTORS_MOT_1]));
}
if (motor_enabled_mask(AP_MOTORS_MOT_2)) {
rc_write(AP_MOTORS_MOT_2, output_to_pwm(_actuator[AP_MOTORS_MOT_2]));
}
if (motor_enabled_mask(AP_MOTORS_MOT_4)) {
rc_write(AP_MOTORS_MOT_4, output_to_pwm(_actuator[AP_MOTORS_MOT_4]));
}
}

// get_motor_mask - returns a bitmask of which outputs are being used for motors or servos (1 means being used)
Expand Down
Loading