xively / xively-client-c

The official and highly portable Xively C Client designed for embedded platforms.
Other
18 stars 22 forks source link

Adjusted current time with elapsed ticks #193

Open bszekely opened 6 years ago

bszekely commented 6 years ago

The fix is calculating in the elapsed ticks at the init time to remove the problematic offset. Details: The HAL tick counter is reflecting the elapsed time since the startup of the MCU. When the xi_bsp_time_init() is called the tick counter is already containing the elapsed time (it is non-zero). This distorts the result of the xi_bsp_time_getcurrenttime_seconds() function as a problematic offset will appear. This is even more significant in case the xi_bsp_time_init() is called repeatedly or with a delay.

atigyi commented 6 years ago

Good catch!