SiLabs Pearl: Keep UART enabled during single byte transfers

We need to explicitly enable the transmitter on Pearl when using the
serial_putc function, to match the disable in the asynch abort.
pull/1501/head
Mikko Polojarvi 2015-11-26 13:16:11 +02:00 committed by Steven Cooreman
parent 15b4341162
commit e865f1fe6f
1 changed files with 8 additions and 0 deletions

View File

@ -1072,6 +1072,14 @@ int serial_getc(serial_t *obj)
*/
void serial_putc(serial_t *obj, int c)
{
#ifdef _SILICON_LABS_32B_PLATFORM_2
if(LEUART_REF_VALID(obj->serial.periph.leuart)) {
LEUART_Enable(obj->serial.periph.leuart, leuartEnable);
} else {
USART_Enable(obj->serial.periph.uart, usartEnable);
}
#endif
/* Emlib USART_Tx blocks until buffer is writable (non-full), so we don't
* need to use serial_writable(). */
if(LEUART_REF_VALID(obj->serial.periph.leuart)) {