Reputation: 13
I am using rp2040 and rp2040_hal and it uses fugit. I am using a function timer.get_conter()
which returns a Instant of Fugit and I want to convert that Instant to a microseconds passed since start of micro-controller. Is there a way in fugit itself to achieve that?
Upvotes: 0
Views: 299
Reputation: 6165
From the documentation you linked to it seems that you should do the following things:
Duration
between two Instant
s (for example using Instant::checked_duration_since
ticks
in this duration using Duration::ticks
duration in seconds = NOM / DENOM * ticks
1_000_000
Upvotes: 0