Skip to content

Commit 1557f9c

Browse files
committed
activate custom send_ISR also for 1B write
- activate custom send_ISR also for 1B write - previous solution only worked for >=2B writes
1 parent 8b14299 commit 1557f9c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: cores/arduino/UARTClass.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ size_t UARTClass::write( const uint8_t uc_data )
168168
{
169169
// Bypass buffering and send character directly
170170
_pUart->UART_THR = uc_data;
171+
172+
// if custom routine attached, activate TXBUFE interrupt -> delay call until transmission finished
173+
// must be done here explicitely because UART_TXRDY interrupt is not activated here
174+
if (_isrTx != NULL) {
175+
_pUart->UART_IER = UART_IER_TXEMPTY;
176+
}
171177
}
178+
172179
return 1;
173180
}
174181

0 commit comments

Comments
 (0)