This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

k_uptime_get return a signed value

Hello,

I would like to use k_uptime_get, however this is returning an int64_t where I would expect an uint64_t.

While looking in the function, I see that k_uptime_get calls k_ticks_to_ms_floor64(k_uptime_ticks()); which should be returning an uint64_t.

What is the reason for this cast?

How is this counter computed? Is it reading a hardware register? Can this counter return to 0 in some cases (apart from a reboot)?

Thanks!

Related