From 8b7b5f0db90019efa2447c75bb7aaaaf65d1bf61 Mon Sep 17 00:00:00 2001 From: Stone white Date: Sat, 4 May 2019 03:00:21 -0700 Subject: [PATCH] AP_OpticalFlow: Make PX4FLOW work on all external I2C buses --- libraries/AP_OpticalFlow/AP_OpticalFlow_PX4Flow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4Flow.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4Flow.cpp index 5d7cc190bb..32246249ac 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4Flow.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4Flow.cpp @@ -60,7 +60,7 @@ bool AP_OpticalFlow_PX4Flow::scan_buses(void) uint8_t retry_attempt = 0; while (!success && retry_attempt < PX4FLOW_INIT_RETRIES) { - for (uint8_t bus = 0; bus < 3; bus++) { + FOREACH_I2C_EXTERNAL(bus) { #ifdef HAL_OPTFLOW_PX4FLOW_I2C_BUS // only one bus from HAL if (bus != HAL_OPTFLOW_PX4FLOW_I2C_BUS) {