cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-2 timestamp registration

KGryn.1
Associate II

Hello,

I would like to ask for an advice related to the timestamp registration:

uint32_t timestamp_A = HAL_VTimerGetCurrentTime_sysT32();

and after some time we check the elapsed time using:

int32_t diff_ms = HAL_VTimerDiff_ms_sysT32(HAL_VTimerGetCurrentTime_sysT32(), timestamp_A);

I am trying to detect and handle accordingly the case where sysT32 variable overflow occurs. I see that overflow occurs after about 1.5 hours.

I checked some differences:

0u - UINT32_MAX (returns 0)

UINT32_MAX-0u (returns -1)

HAL_VTimerDiff_ms_sysT32() suggests that uint32_t sysTime has some ranges other than uint32 size.

Is there any mechanism to handle sysT32 variable overflow detection?

Do I understand correctly that I should rather start new VTimer and detect the overflow inside VTimerTimeoutCallback()? And this way I can read the elapsed time before overflow with HAL_VTimerExpiry_sysT32()?

Regards

0 REPLIES 0