mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
machine/stm32: use HasBits() method to simplify bit comparisons
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
@@ -209,7 +209,7 @@ func (uart UART) Configure(config UARTConfig) {
|
||||
func (uart UART) WriteByte(c byte) error {
|
||||
stm32.USART2.DR.Set(uint32(c))
|
||||
|
||||
for (stm32.USART2.SR.Get() & stm32.USART_SR_TXE) == 0 {
|
||||
for !stm32.USART2.SR.HasBits(stm32.USART_SR_TXE) {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user