mirror of https://github.com/ARMmbed/mbed-os.git
going back to the previously successful logic to create a 64-bit timestamp.
parent
543e8c89d0
commit
1108cf9526
|
@ -228,9 +228,12 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
|
|||
* additional 32 bits. RTC_UNITS_TO_MICROSECONDS() converts this into
|
||||
* microsecond units (in 64-bits).
|
||||
*/
|
||||
const uint64_t currentTime64 = RTC_UNITS_TO_MICROSECONDS(rtc1_getCounter64());
|
||||
const uint64_t timestamp64 = currentTime64 + (timestamp_t)(timestamp - (timestamp_t)currentTime64);
|
||||
uint32_t newCallbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp64);
|
||||
const uint64_t currentTime64 = RTC_UNITS_TO_MICROSECONDS(rtc1_getCounter64());
|
||||
uint64_t timestamp64 = (currentTime64 & ~(uint64_t)0xFFFFFFFFULL) + timestamp;
|
||||
if (((uint32_t)currentTime64 > 0x80000000) && (timestamp < 0x80000000)) {
|
||||
timestamp64 += (uint64_t)0x100000000ULL;
|
||||
}
|
||||
uint32_t newCallbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp64);
|
||||
|
||||
/* Check for repeat setup of an existing callback. This is actually not
|
||||
* important; the following code should work even without this check. */
|
||||
|
|
Loading…
Reference in New Issue