Skip to content

Commit e3b6aea

Browse files
bors[bot]mpi3d
andauthored
Merge #70
70: Fix LineEvent timestamp doc r=eldruin a=mpi3d Fix documentation on `LineEvent::timestamp()`. According to the Linux documentation, the timestamp is `CLOCK_MONOTONIC` by default: [gpio.h#L286](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/gpio.h#n286). Please see [#68 comment](#68 (comment)). Co-authored-by: Matthieu CHARETTE <[email protected]>
2 parents 2c7ef82 + e88cca3 commit e3b6aea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,10 @@ impl LineEvent {
920920
/// in an interrupt handler so it should be very accurate.
921921
///
922922
/// The nanosecond timestamp value should are captured
923-
/// using the `CLOCK_REALTIME` offsets in the kernel and
924-
/// should be compared against `CLOCK_REALTIME` values.
923+
/// using the `CLOCK_MONOTONIC` offsets in the kernel and
924+
/// should be compared against `CLOCK_MONOTONIC` values.
925+
/// Note that kernel versions prior to 5.7 used
926+
/// `CLOCK_REALTIME` offsets instead.
925927
pub fn timestamp(&self) -> u64 {
926928
self.0.timestamp
927929
}

0 commit comments

Comments
 (0)