diff --git a/libraries/AP_HAL_QURT/RCOutput.cpp b/libraries/AP_HAL_QURT/RCOutput.cpp index 70b9ceee81..2728d19b20 100644 --- a/libraries/AP_HAL_QURT/RCOutput.cpp +++ b/libraries/AP_HAL_QURT/RCOutput.cpp @@ -153,7 +153,7 @@ void RCOutput::send_esc_command(void) // We don't set any LEDs data[4] = 0; - for (uint8_t i=0; iget_safety_mask(); } - for (uint8_t i=0; i>4; - if (idx >= ARRAY_SIZE(period)) { + if (idx >= esc_channel_count) { return; } update_rpm(idx, pkt.rpm); diff --git a/libraries/AP_HAL_QURT/RCOutput.h b/libraries/AP_HAL_QURT/RCOutput.h index c2be76ccb7..e3da9b143f 100644 --- a/libraries/AP_HAL_QURT/RCOutput.h +++ b/libraries/AP_HAL_QURT/RCOutput.h @@ -105,9 +105,11 @@ private: int fd = -1; uint16_t enable_mask; - static const uint8_t channel_count = 4; - uint16_t period[channel_count]; - uint16_t pwm_output[channel_count]; + static const uint8_t max_channel_count = 8; + static const uint8_t esc_channel_count = 4; + static const uint8_t io_channel_count = 8; + uint16_t period[max_channel_count]; + uint16_t pwm_output[max_channel_count]; volatile bool need_write; bool corked; HAL_Semaphore mutex;