[nrf52840] fix TimeToTicks function in the alarm port (#2986)

This commit is contained in:
Hubert Miś
2018-08-24 08:44:30 -07:00
committed by Jonathan Hui
parent 20ccd55c16
commit dd3916c404
+2 -2
View File
@@ -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);