AP_IRLock_PX4: enabled sensor driver startup on bus2 if don't start on bus1

This commit is contained in:
LukeMike 2016-08-10 15:37:34 +02:00 committed by Andrew Tridgell
parent 316e5acaec
commit e6c8653302

View File

@ -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");