Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gap_nrf528xx-central.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package bluetooth
import (
"device/arm"
"errors"
"runtime"
"runtime/volatile"
"time"
"unsafe"
Expand Down Expand Up @@ -58,8 +59,8 @@ func (a *Adapter) Scan(callback func(*Adapter, ScanResult)) error {
for {
// Wait for the next advertisement packet to arrive.
// TODO: use some sort of condition variable once the scheduler supports
// them.
arm.Asm("wfe")
// them. Using Gosched() here as a stopgap to let other goroutines run.
runtime.Gosched()
if gotScanReport.Get() == 0 {
// Spurious event. Continue waiting.
continue
Expand Down
Loading