Slight changes
This commit is contained in:
parent
7ba9065895
commit
d353dd3022
|
@ -105,7 +105,7 @@ uint32 usart_tx(usart_dev *dev, const uint8 *buf, uint32 len) {
|
|||
else
|
||||
break;
|
||||
}
|
||||
if (rb_full_count(dev->wb) > 0) {
|
||||
if (!rb_is_empty(dev->wb)) {
|
||||
regs->CR1 |= USART_CR1_TXEIE;
|
||||
}
|
||||
return txed;
|
||||
|
|
|
@ -55,8 +55,9 @@ static inline __always_inline void usart_irq(ring_buffer *rb, ring_buffer *wb, u
|
|||
}
|
||||
/* TXE signifies readiness to send a byte to DR. */
|
||||
if ((regs->CR1 & USART_CR1_TXEIE) && (regs->SR & USART_SR_TXE)) {
|
||||
if (!rb_is_empty(wb))
|
||||
regs->DR=rb_remove(wb);
|
||||
if (rb_is_empty(wb))
|
||||
else
|
||||
regs->CR1 &= ~((uint32)USART_CR1_TXEIE); // disable TXEIE
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue