HAL_PX4: cope with no px4io on FMUv2

don't open px4fmu twice
This commit is contained in:
Andrew Tridgell 2016-10-23 17:15:32 +11:00
parent 5ac62c27e2
commit 2a44e6a7d7

View File

@ -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