From e6c8653302131108291752c13ba1acd55679a914 Mon Sep 17 00:00:00 2001 From: LukeMike Date: Wed, 10 Aug 2016 15:37:34 +0200 Subject: [PATCH] AP_IRLock_PX4: enabled sensor driver startup on bus2 if don't start on bus1 --- libraries/AP_IRLock/AP_IRLock_PX4.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/AP_IRLock/AP_IRLock_PX4.cpp b/libraries/AP_IRLock/AP_IRLock_PX4.cpp index ee3e44ecd8..fda41b6db0 100644 --- a/libraries/AP_IRLock/AP_IRLock_PX4.cpp +++ b/libraries/AP_IRLock/AP_IRLock_PX4.cpp @@ -41,10 +41,19 @@ void AP_IRLock_PX4::init() { if (!AP_BoardConfig::px4_start_driver(irlock_main, "irlock", "start")) { hal.console->printf("irlock driver start failed\n"); +#if CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN + if (!AP_BoardConfig::px4_start_driver(irlock_main, "irlock", "start -b 2")) { + hal.console->printf("irlock driver start failed (bus2)\n"); + } else { + // give it time to initialise + hal.scheduler->delay(500); + } +#endif } else { // give it time to initialise hal.scheduler->delay(500); } + _fd = open(IRLOCK0_DEVICE_PATH, O_RDONLY); if (_fd < 0) { hal.console->printf("Unable to open " IRLOCK0_DEVICE_PATH "\n");