1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00
This commit is contained in:
jflyper 2017-08-31 14:48:00 +09:00
parent 652d9adba8
commit 5715bda906

View file

@ -255,8 +255,9 @@ serialPort_t *openSoftSerial(softSerialPortIndex_e portIndex, serialReceiveCallb
// If RX and TX pins are both assigned, we CAN use either with a timer.
// However, for consistency with hardware UARTs, we only use TX pin,
// and this pin must have a timer, and it should not be N-Channel.
if (!(timerTx && !(timerTx->output & TIMER_OUTPUT_N_CHANNEL)))
if (!(timerTx && !(timerTx->output & TIMER_OUTPUT_N_CHANNEL))) {
return NULL;
}
softSerial->timerHardware = timerTx;
softSerial->txIO = txIO;
@ -265,8 +266,9 @@ serialPort_t *openSoftSerial(softSerialPortIndex_e portIndex, serialReceiveCallb
} else {
if (mode & MODE_RX) {
// Need a pin & a timer on RX. Channel should not be N-Channel.
if (!(timerRx && !(timerRx->output & TIMER_OUTPUT_N_CHANNEL)))
if (!(timerRx && !(timerRx->output & TIMER_OUTPUT_N_CHANNEL))) {
return NULL;
}
softSerial->rxIO = rxIO;
softSerial->timerHardware = timerRx;