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:
parent
cbaf9b0265
commit
4dc04d6a33
11 changed files with 239 additions and 28 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue