Skip to content

Commit

Permalink
Merge pull request #58 from umi-eng/timestamp-accessibility
Browse files Browse the repository at this point in the history
Allow timestamp to be accessed from all modes
  • Loading branch information
richardeoin authored Jan 31, 2025
2 parents 38372c8 + 72e73bb commit 454e804
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

* Update MSRV to 1.60
* Allow timestamp to be accessed in all modes

## [v0.2.1] 2024-09-04

Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,12 @@ where
) -> Self {
Self::create_can(t.0.config, t.0.instance)
}

/// Returns the current FdCan timestamp counter
#[inline]
pub fn timestamp(&self) -> u16 {
self.control.timestamp()
}
}

impl<I> FdCan<I, PoweredDownMode>
Expand Down Expand Up @@ -882,12 +888,6 @@ where
.bit(filter.reject_remote_extended_frames)
});
}

/// Returns the current FdCan timestamp counter
#[inline]
pub fn timestamp(&self) -> u16 {
self.control.timestamp()
}
}

impl<I> FdCan<I, InternalLoopbackMode>
Expand Down

0 comments on commit 454e804

Please sign in to comment.