attiny: remove dummy UART

I think it's better not to provide a UART0 global at all than one that
does nothing.
This commit is contained in:
Ayke van Laethem
2021-03-05 19:04:42 +01:00
committed by Ron Evans
parent c60c36f0a8
commit 42088f938e
7 changed files with 23 additions and 33 deletions
+6
View File
@@ -114,6 +114,12 @@ func (i2c I2C) readByte() byte {
return byte(avr.TWDR.Get())
}
// UART
var (
// UART0 is the hardware serial port on the AVR.
UART0 = UART{Buffer: NewRingBuffer()}
)
// UART on the AVR.
type UART struct {
Buffer *RingBuffer
-17
View File
@@ -2,23 +2,6 @@
package machine
// UART on the AVR is a dummy implementation. UART has not been implemented for ATtiny
// devices.
type UART struct {
Buffer *RingBuffer
}
// Configure is a dummy implementation. UART has not been implemented for ATtiny
// devices.
func (uart UART) Configure(config UARTConfig) {
}
// WriteByte is a dummy implementation. UART has not been implemented for ATtiny
// devices.
func (uart UART) WriteByte(c byte) error {
return nil
}
// Tx is a dummy implementation. I2C has not been implemented for ATtiny
// devices.
func (i2c I2C) Tx(addr uint16, w, r []byte) error {
-6
View File
@@ -148,9 +148,3 @@ type I2C struct {
// I2C0 is the only I2C interface on most AVRs.
var I2C0 = I2C{}
// UART
var (
// UART0 is the hardware serial port on the AVR.
UART0 = UART{Buffer: NewRingBuffer()}
)
+1 -1
View File
@@ -1,4 +1,4 @@
// +build avr esp nrf sam sifive stm32 k210 nxp
// +build atmega esp nrf sam sifive stm32 k210 nxp
package machine