2022-12-22 03:44 AM
Hi,
In the osal.c line 389 "osalThreadGetMicroseconds" function uses "osalSysTime_ST2US" macro to convert ticks to microseconds.
The macro uses osalsystime_t variable type that is 32-bit length.
return ((uint32_t)((((osalsystime_t)ticks) * 1000000UL) / osal_ticks_per_sec));
After 4294 microseconds, the value of the calculation overflows 32-bit and gives a wrong time. (4295 x 1000000 = 0x100007FC0 )
I change to type to uint64_t and it's working now.
return ((uint32_t)((((uint64_t)ticks) * 1000000UL) / osal_ticks_per_sec));
2023-01-03 08:54 AM
Hello,
thank you for your remark.
We will fix in next release.
Best regards.