diff --git a/src/drivers/rc_input/RCInput.cpp b/src/drivers/rc_input/RCInput.cpp index 4d1d023896..f13ede5679 100644 --- a/src/drivers/rc_input/RCInput.cpp +++ b/src/drivers/rc_input/RCInput.cpp @@ -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':