mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
os, runtime: enable os.Stdin for baremetal target
This commit is contained in:
@@ -126,6 +126,18 @@ func putchar(c byte) {
|
||||
machine.Serial.WriteByte(c)
|
||||
}
|
||||
|
||||
func getchar() byte {
|
||||
for machine.UART1.Buffered() == 0 {
|
||||
Gosched()
|
||||
}
|
||||
v, _ := machine.UART1.ReadByte()
|
||||
return v
|
||||
}
|
||||
|
||||
func buffered() int {
|
||||
return machine.UART1.Buffered()
|
||||
}
|
||||
|
||||
func exit(code int) {
|
||||
abort()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user