AP_UAVCAN: correct array inxexing

Allows the code to be run on hardware
This commit is contained in:
pacolate12 2022-03-16 14:48:33 -04:00 committed by Tom Pittenger
parent 8574afb2e1
commit 0d256da3b5

View File

@ -564,9 +564,9 @@ void AP_UAVCAN::SRV_push_servos()
{
WITH_SEMAPHORE(SRV_sem);
for (uint8_t i = 0; i < NUM_SERVO_CHANNELS; i++) {
for (uint8_t i = 0; i < UAVCAN_SRV_NUMBER; i++) {
// Check if this channels has any function assigned
if (SRV_Channels::channel_function(i)) {
if (SRV_Channels::channel_function(i) > SRV_Channel::k_none) {
_SRV_conf[i].pulse = SRV_Channels::srv_channel(i)->get_output_pwm();
_SRV_conf[i].esc_pending = true;
_SRV_conf[i].servo_pending = true;