diff --git a/src/runtime/runtime_atsamd21.go b/src/runtime/runtime_atsamd21.go index 1d84a4a9..353ab488 100644 --- a/src/runtime/runtime_atsamd21.go +++ b/src/runtime/runtime_atsamd21.go @@ -308,7 +308,7 @@ func timerSleep(ticks uint32) bool { sam.RTC_MODE0.INTENSET.SetBits(sam.RTC_MODE0_INTENSET_CMP0) wait: - arm.Asm("wfe") + waitForEvents() if timerWakeup.Get() != 0 { return true } diff --git a/src/runtime/runtime_atsamd51.go b/src/runtime/runtime_atsamd51.go index 0a581430..201e2df0 100644 --- a/src/runtime/runtime_atsamd51.go +++ b/src/runtime/runtime_atsamd51.go @@ -292,7 +292,7 @@ func timerSleep(ticks uint32) bool { sam.RTC_MODE0.INTENSET.SetBits(sam.RTC_MODE0_INTENSET_CMP0) wait: - arm.Asm("wfe") + waitForEvents() if timerWakeup.Get() != 0 { return true } diff --git a/src/runtime/runtime_nrf.go b/src/runtime/runtime_nrf.go index 9a0678c6..20f81f1a 100644 --- a/src/runtime/runtime_nrf.go +++ b/src/runtime/runtime_nrf.go @@ -3,7 +3,6 @@ package runtime import ( - "device/arm" "device/nrf" "machine" "runtime/interrupt" @@ -114,6 +113,6 @@ func rtc_sleep(ticks uint32) { } nrf.RTC1.CC[0].Set((nrf.RTC1.COUNTER.Get() + ticks) & 0x00ffffff) for rtc_wakeup.Get() == 0 { - arm.Asm("wfi") + waitForEvents() } }