machine/stm32: use HasBits() method to simplify bit comparisons

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans
2019-05-27 15:37:57 +02:00
committed by Ayke
parent 31189deb3b
commit be491abc46
4 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -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
}