Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def timestamp_cycles(self):
- """Returns the current timestamp in PRU cycles (integer)"""
- self._last_timestamp_cycles += ( self.pruss.ecap.counter - self._last_timestamp_cycles ) & 0xffffffff
- return self._last_timestamp_cycles
- def timestamp_ns(self):
- """Returns the current timestamp in nanoseconds (integer)"""
- return self.timestamp_cycles() * 5
- def timestamp_seconds(self):
- """Returns the current timestamp in seconds (floating-point)"""
- return self.timestamp_cycles() / 200e6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement