mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_IRLock_PX4: enabled sensor driver startup on bus2 if don't start on bus1
This commit is contained in:
parent
316e5acaec
commit
e6c8653302
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user