mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
rc_input: Add SINGLEWIRE_MANUAL_DUPLEX for manually changing TXDIR
Fixes telemetry on fmu-v6xrt
This commit is contained in:
parent
9e6dcb1f60
commit
beccd10f66
@ -451,10 +451,12 @@
|
||||
#define HRT_PPM_CHANNEL /* GPIO_EMC_B1_09 GPIO_GPT5_CAPTURE1_1 */ 1 /* use capture/compare channel 1 */
|
||||
#define GPIO_PPM_IN /* GPIO_EMC_B1_09 GPT1_CAPTURE2 */ (GPIO_GPT5_CAPTURE1_1 | GENERAL_INPUT_IOMUX)
|
||||
|
||||
#define RC_SERIAL_PORT "/dev/ttyS4"
|
||||
#define RC_SERIAL_SINGLEWIRE 1 // Suport Single wire wiring
|
||||
#define RC_SERIAL_SWAP_RXTX 1 // Set Swap (but not supported in HW) to use Single wire
|
||||
#define RC_SERIAL_SWAP_USING_SINGLEWIRE 1 // Set to use Single wire swap as HW does not support swap
|
||||
#define RC_SERIAL_PORT "/dev/ttyS4"
|
||||
#define RC_SERIAL_SINGLEWIRE 1 // Suport Single wire wiring
|
||||
#define RC_SERIAL_SWAP_RXTX 1 // Set Swap (but not supported in HW) to use Single wire
|
||||
#define RC_SERIAL_SWAP_USING_SINGLEWIRE 1 // Set to use Single wire swap as HW does not support swap
|
||||
#define RC_SERIAL_SINGLEWIRE_MANUAL_DUPLEX 1 // Set to use ioctl's to manually swap duplex
|
||||
#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT
|
||||
|
||||
/* FLEXSPI4 */
|
||||
|
||||
|
||||
@ -734,7 +734,15 @@ void RCInput::Run()
|
||||
}
|
||||
|
||||
if (_crsf_telemetry) {
|
||||
#if defined(RC_SERIAL_SINGLEWIRE_MANUAL_DUPLEX)
|
||||
ioctl(_rcs_fd, TIOCSSINGLEWIRE, SER_SINGLEWIRE_ENABLED | SER_SINGLEWIRE_DIR_TX);
|
||||
#endif
|
||||
_crsf_telemetry->update(cycle_timestamp);
|
||||
#if defined(RC_SERIAL_SINGLEWIRE_MANUAL_DUPLEX)
|
||||
tcflush(_rcs_fd, TCIOFLUSH);
|
||||
tcdrain(_rcs_fd); // Ensure TX FIFO is empty before swapping
|
||||
ioctl(_rcs_fd, TIOCSSINGLEWIRE, SER_SINGLEWIRE_ENABLED | SER_SINGLEWIRE_DIR_RX);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -787,7 +795,15 @@ void RCInput::Run()
|
||||
}
|
||||
|
||||
if (_ghst_telemetry) {
|
||||
#if defined(RC_SERIAL_SINGLEWIRE_MANUAL_DUPLEX)
|
||||
ioctl(_rcs_fd, TIOCSSINGLEWIRE, SER_SINGLEWIRE_ENABLED | SER_SINGLEWIRE_DIR_TX);
|
||||
#endif
|
||||
_ghst_telemetry->update(cycle_timestamp);
|
||||
#if defined(RC_SERIAL_SINGLEWIRE_MANUAL_DUPLEX)
|
||||
tcflush(_rcs_fd, TCIOFLUSH);
|
||||
tcdrain(_rcs_fd); // Ensure TX FIFO is empty before swapping
|
||||
ioctl(_rcs_fd, TIOCSSINGLEWIRE, SER_SINGLEWIRE_ENABLED | SER_SINGLEWIRE_DIR_RX);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user