mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Graft of 'serial_rx_telemetry_on_same_port' into development for flight testing by @blckmn.
This commit is contained in:
parent
47d0705994
commit
fefbc4d4bf
11 changed files with 156 additions and 28 deletions
|
@ -35,6 +35,10 @@
|
|||
#include "drivers/serial_uart.h"
|
||||
#include "io/serial.h"
|
||||
|
||||
#ifdef TELEMETRY
|
||||
#include "telemetry/telemetry.h"
|
||||
#endif
|
||||
|
||||
#include "rx/rx.h"
|
||||
#include "rx/ibus.h"
|
||||
|
||||
|
@ -64,7 +68,19 @@ bool ibusInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRa
|
|||
return false;
|
||||
}
|
||||
|
||||
serialPort_t *ibusPort = openSerialPort(portConfig->identifier, FUNCTION_RX_SERIAL, ibusDataReceive, IBUS_BAUDRATE, MODE_RX, SERIAL_NOT_INVERTED);
|
||||
#ifdef TELEMETRY
|
||||
bool portShared = telemetryCheckRxPortShared(portConfig);
|
||||
#else
|
||||
bool portShared = false;
|
||||
#endif
|
||||
|
||||
serialPort_t *ibusPort = openSerialPort(portConfig->identifier, FUNCTION_RX_SERIAL, ibusDataReceive, IBUS_BAUDRATE, portShared ? MODE_RXTX : MODE_RX, SERIAL_NOT_INVERTED);
|
||||
|
||||
#ifdef TELEMETRY
|
||||
if (portShared) {
|
||||
telemetrySharedPort = ibusPort;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ibusPort != NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue