mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 12:53:23 +00:00
uart: use machine.Serial as the default output
This commit is contained in:
@@ -30,7 +30,7 @@ var (
|
|||||||
tx = machine.PA22
|
tx = machine.PA22
|
||||||
rx = machine.PA23
|
rx = machine.PA23
|
||||||
|
|
||||||
console = machine.UART0
|
console = machine.Serial
|
||||||
|
|
||||||
adaptor *espat.Device
|
adaptor *espat.Device
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ var (
|
|||||||
tx = machine.PA22
|
tx = machine.PA22
|
||||||
rx = machine.PA23
|
rx = machine.PA23
|
||||||
|
|
||||||
console = machine.UART0
|
console = machine.Serial
|
||||||
|
|
||||||
adaptor *espat.Device
|
adaptor *espat.Device
|
||||||
topic = "tinygo"
|
topic = "tinygo"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ var (
|
|||||||
tx = machine.PA22
|
tx = machine.PA22
|
||||||
rx = machine.PA23
|
rx = machine.PA23
|
||||||
|
|
||||||
console = machine.UART0
|
console = machine.Serial
|
||||||
|
|
||||||
adaptor *espat.Device
|
adaptor *espat.Device
|
||||||
cl mqtt.Client
|
cl mqtt.Client
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var (
|
|||||||
input [consoleBufLen]byte
|
input [consoleBufLen]byte
|
||||||
store [storageBufLen]byte
|
store [storageBufLen]byte
|
||||||
|
|
||||||
console = machine.UART0
|
console = machine.Serial
|
||||||
|
|
||||||
dev *flash.Device
|
dev *flash.Device
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
println("GPS UART Example")
|
println("GPS UART Example")
|
||||||
machine.UART1.Configure(machine.UARTConfig{BaudRate: 9600})
|
machine.UART1.Configure(machine.UARTConfig{BaudRate: 9600})
|
||||||
ublox := gps.NewUART(&machine.UART1)
|
ublox := gps.NewUART(machine.UART1)
|
||||||
parser := gps.NewParser()
|
parser := gps.NewParser()
|
||||||
var fix gps.Fix
|
var fix gps.Fix
|
||||||
for {
|
for {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ func printMacAddress() {
|
|||||||
|
|
||||||
// Wait for user to open serial console
|
// Wait for user to open serial console
|
||||||
func waitSerial() {
|
func waitSerial() {
|
||||||
for !machine.UART0.DTR() {
|
for !machine.Serial.DTR() {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ func main() {
|
|||||||
|
|
||||||
// Wait for user to open serial console
|
// Wait for user to open serial console
|
||||||
func waitSerial() {
|
func waitSerial() {
|
||||||
for !machine.UART0.DTR() {
|
for !machine.Serial.DTR() {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ func main() {
|
|||||||
|
|
||||||
// Wait for user to open serial console
|
// Wait for user to open serial console
|
||||||
func waitSerial() {
|
func waitSerial() {
|
||||||
for !machine.UART0.DTR() {
|
for !machine.Serial.DTR() {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ func main() {
|
|||||||
|
|
||||||
// Wait for user to open serial console
|
// Wait for user to open serial console
|
||||||
func waitSerial() {
|
func waitSerial() {
|
||||||
for !machine.UART0.DTR() {
|
for !machine.Serial.DTR() {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user