1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Tri-state USART TX output if load due to powered down peripheral is detected (#12760)

Tri-state USART TX output if loaded due to powered down peripheral being detected
This commit is contained in:
Steve Evans 2023-05-10 02:53:35 +01:00 committed by GitHub
parent cbaf9b0265
commit 4dc04d6a33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 239 additions and 28 deletions

View file

@ -267,6 +267,12 @@ static void uartWrite(serialPort_t *instance, uint8_t ch)
{
uartPort_t *uartPort = (uartPort_t *)instance;
// Check if the TX line is being pulled low by an unpowered peripheral
if (uartPort->checkUsartTxOutput && !uartPort->checkUsartTxOutput(uartPort)) {
// TX line is being pulled low, so don't transmit
return;
}
uartPort->port.txBuffer[uartPort->port.txBufferHead] = ch;
if (uartPort->port.txBufferHead + 1 >= uartPort->port.txBufferSize) {