mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
HAL_PX4: cope with no px4io on FMUv2
don't open px4fmu twice
This commit is contained in:
parent
5ac62c27e2
commit
2a44e6a7d7
@ -55,10 +55,14 @@ void PX4RCOutput::init()
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_ARCH_BOARD_PX4FMU_V4)
|
||||
struct stat st;
|
||||
// don't try and open px4fmu unless there is a px4io. Otherwise we
|
||||
// can end up opening the same device twice
|
||||
if (stat("/dev/px4io", &st) == 0) {
|
||||
_alt_fd = open("/dev/px4fmu", O_RDWR);
|
||||
if (_alt_fd == -1) {
|
||||
hal.console->printf("RCOutput: failed to open /dev/px4fmu");
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user