mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 21:20:11 +00:00
[nrf52840] fix TimeToTicks function in the alarm port (#2986)
This commit is contained in:
@@ -164,7 +164,7 @@ static inline uint64_t TimeToTicks(uint64_t aTime, AlarmIndex aIndex)
|
|||||||
aTime *= US_PER_MS;
|
aTime *= US_PER_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NRF_802154_US_TO_RTC_TICKS(aTime) & RTC_CC_COMPARE_Msk;
|
return NRF_802154_US_TO_RTC_TICKS(aTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint64_t TicksToTime(uint64_t aTicks, AlarmIndex aIndex)
|
static inline uint64_t TicksToTime(uint64_t aTicks, AlarmIndex aIndex)
|
||||||
@@ -358,7 +358,7 @@ static void TimerStartAt(uint32_t aT0, uint32_t aDt, AlarmIndex aIndex, const ui
|
|||||||
nrf_rtc_event_enable(RTC_INSTANCE, sChannelData[aIndex].mCompareEventMask);
|
nrf_rtc_event_enable(RTC_INSTANCE, sChannelData[aIndex].mCompareEventMask);
|
||||||
|
|
||||||
targetTime = ConvertT0AndDtTo64BitTime(aT0, aDt, aNow);
|
targetTime = ConvertT0AndDtTo64BitTime(aT0, aDt, aNow);
|
||||||
targetCounter = TimeToTicks(targetTime, aIndex);
|
targetCounter = TimeToTicks(targetTime, aIndex) & RTC_CC_COMPARE_Msk;
|
||||||
|
|
||||||
sTimerData[aIndex].mTargetTime = RoundUpTimeToTimerTicksMultiply(targetTime, aIndex);
|
sTimerData[aIndex].mTargetTime = RoundUpTimeToTimerTicksMultiply(targetTime, aIndex);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user