mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 14:48:40 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 277b3f71e3 |
@@ -10,7 +10,7 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type io struct {
|
||||
type rpio struct {
|
||||
status volatile.Register32
|
||||
ctrl volatile.Register32
|
||||
}
|
||||
@@ -22,7 +22,7 @@ type irqCtrl struct {
|
||||
}
|
||||
|
||||
type ioBank0Type struct {
|
||||
io [30]io
|
||||
io [30]rpio
|
||||
intR [4]volatile.Register32
|
||||
proc0IRQctrl irqCtrl
|
||||
proc1IRQctrl irqCtrl
|
||||
|
||||
+15
-1
@@ -1,6 +1,9 @@
|
||||
package machine
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
)
|
||||
|
||||
var errNoByte = errors.New("machine: no byte read")
|
||||
|
||||
@@ -44,3 +47,14 @@ func (ns NullSerial) Buffered() int {
|
||||
func (ns NullSerial) Write(p []byte) (n int, err error) {
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
// Read is a no-op; always returns that zero bytes were read with no error
|
||||
func (ns NullSerial) Read(p []byte) (n int, err error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// type check to ensure NullSerial implements interfaces for drivers.UART
|
||||
var (
|
||||
_ io.Reader = NullSerial{}
|
||||
_ io.Writer = NullSerial{}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user