mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 21:43:40 +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
@@ -314,7 +314,7 @@ func (uart *UART) Configure(config UARTConfig) {
|
||||
uart.Bus.CLKDIV.Set(peripheralClock / config.BaudRate)
|
||||
}
|
||||
|
||||
func (uart *UART) WriteByte(b byte) error {
|
||||
func (uart *UART) writeByte(b byte) error {
|
||||
for (uart.Bus.STATUS.Get()>>16)&0xff >= 128 {
|
||||
// Read UART_TXFIFO_CNT from the status register, which indicates how
|
||||
// many bytes there are in the transmit buffer. Wait until there are
|
||||
@@ -324,6 +324,8 @@ func (uart *UART) WriteByte(b byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (uart *UART) flush() {}
|
||||
|
||||
// Serial Peripheral Interface on the ESP32.
|
||||
type SPI struct {
|
||||
Bus *esp.SPI_Type
|
||||
|
||||
Reference in New Issue
Block a user