From 0d256da3b59a2e33890b79eaebc77f08092d3fad Mon Sep 17 00:00:00 2001 From: pacolate12 <56329725+pacolate12@users.noreply.github.com> Date: Wed, 16 Mar 2022 14:48:33 -0400 Subject: [PATCH] AP_UAVCAN: correct array inxexing Allows the code to be run on hardware --- libraries/AP_UAVCAN/AP_UAVCAN.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_UAVCAN/AP_UAVCAN.cpp b/libraries/AP_UAVCAN/AP_UAVCAN.cpp index 2653d928967..6be6d77039e 100644 --- a/libraries/AP_UAVCAN/AP_UAVCAN.cpp +++ b/libraries/AP_UAVCAN/AP_UAVCAN.cpp @@ -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;