drivers/rc_input: don't allow starting on the px4io serial port

This commit is contained in:
Daniel Agar 2022-09-14 19:16:23 -04:00
parent 9245d71397
commit 54b5d4c5b8

View File

@ -128,6 +128,15 @@ RCInput::task_spawn(int argc, char *argv[])
device_name = RC_SERIAL_PORT;
#endif // RC_SERIAL_PORT
#if defined(RC_SERIAL_PORT) && defined(PX4IO_SERIAL_DEVICE)
// if RC_SERIAL_PORT == PX4IO_SERIAL_DEVICE then don't use it by default if the px4io is running
if ((strcmp(RC_SERIAL_PORT, PX4IO_SERIAL_DEVICE) == 0) && (access("/dev/px4io", R_OK) == 0)) {
device_name = nullptr;
}
#endif // RC_SERIAL_PORT && PX4IO_SERIAL_DEVICE
while ((ch = px4_getopt(argc, argv, "d:", &myoptind, &myoptarg)) != EOF) {
switch (ch) {
case 'd':