examples: discover should only wait on startup on baremetal, since macOS does not like that

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2020-09-22 18:15:38 +02:00 committed by Ayke
parent a2662956b8
commit 9daf7205ab
3 changed files with 10 additions and 3 deletions

View file

@ -17,15 +17,13 @@
package main
import (
"time"
"tinygo.org/x/bluetooth"
)
var adapter = bluetooth.DefaultAdapter
func main() {
time.Sleep(3 * time.Second)
wait()
println("enabling")

View file

@ -13,6 +13,11 @@ func connectAddress() string {
return deviceAddress
}
// wait on baremetal, proceed immediately on desktop OS.
func wait() {
time.Sleep(3 * time.Second)
}
// done just blocks forever, allows USB CDC reset for flashing new software.
func done() {
println("Done.")

View file

@ -16,6 +16,10 @@ func connectAddress() string {
return address
}
// wait on baremetal, proceed immediately on desktop OS.
func wait() {
}
// done just prints a message and allows program to exit.
func done() {
println("Done.")