mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
machine.UART refactor (#3832)
* add gosched calls to UART * add UART.flush() stubs for all supported architectures * add comment un uart.go on flush functionality * uart.writeByte as base of UART usage * fix NXP having duplicate WriteByte * fix writeByte not returning error on some platforms * add flush method for fe310 device * check for error in WriteByte call to writeByte
This commit is contained in:
committed by
GitHub
parent
c83f712c17
commit
a7b205c26c
@@ -392,13 +392,16 @@ func (uart *UART) handleInterrupt(interrupt.Interrupt) {
|
||||
uart.Receive(c)
|
||||
}
|
||||
|
||||
func (uart *UART) WriteByte(c byte) {
|
||||
func (uart *UART) writeByte(c byte) error {
|
||||
for uart.Bus.TXDATA.Get()&kendryte.UARTHS_TXDATA_FULL != 0 {
|
||||
}
|
||||
|
||||
uart.Bus.TXDATA.Set(uint32(c))
|
||||
return nil
|
||||
}
|
||||
|
||||
func (uart *UART) flush() {}
|
||||
|
||||
type SPI struct {
|
||||
Bus *kendryte.SPI_Type
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user