Skip to content

Commit 9daf720

Browse files
deadprogramaykevl
authored andcommitted
examples: discover should only wait on startup on baremetal, since macOS does not like that
Signed-off-by: deadprogram <[email protected]>
1 parent a266295 commit 9daf720

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

examples/discover/main.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
package main
1818

1919
import (
20-
"time"
21-
2220
"tinygo.org/x/bluetooth"
2321
)
2422

2523
var adapter = bluetooth.DefaultAdapter
2624

2725
func main() {
28-
time.Sleep(3 * time.Second)
26+
wait()
2927

3028
println("enabling")
3129

examples/discover/mcu.go

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ func connectAddress() string {
1313
return deviceAddress
1414
}
1515

16+
// wait on baremetal, proceed immediately on desktop OS.
17+
func wait() {
18+
time.Sleep(3 * time.Second)
19+
}
20+
1621
// done just blocks forever, allows USB CDC reset for flashing new software.
1722
func done() {
1823
println("Done.")

examples/discover/os.go

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ func connectAddress() string {
1616
return address
1717
}
1818

19+
// wait on baremetal, proceed immediately on desktop OS.
20+
func wait() {
21+
}
22+
1923
// done just prints a message and allows program to exit.
2024
func done() {
2125
println("Done.")

0 commit comments

Comments
 (0)