diff --git a/src/runtime/runtime_nrf.go b/src/runtime/runtime_nrf.go index 1cccce978..8ec084045 100644 --- a/src/runtime/runtime_nrf.go +++ b/src/runtime/runtime_nrf.go @@ -75,7 +75,7 @@ var ( // handling the overflow event. func ticks() timeUnit { rtcCounter := uint32(nrf.RTC0.COUNTER) - offset := (rtcCounter - rtcLastCounter) % 0xffffff // change since last measurement + offset := (rtcCounter - rtcLastCounter) & 0xffffff // change since last measurement rtcLastCounter = rtcCounter timestamp += timeUnit(offset) // TODO: not precise return timestamp