From 2ddd0f6c26205cd52078702edb90927cd786d84f Mon Sep 17 00:00:00 2001 From: Avery Black Date: Thu, 17 Oct 2024 19:25:24 -0700 Subject: [PATCH] Use I2C interrupt timestamp if possible --- VoodooRMI/Transports/I2C/RMII2C.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/VoodooRMI/Transports/I2C/RMII2C.cpp b/VoodooRMI/Transports/I2C/RMII2C.cpp index 2481376..6a0129c 100644 --- a/VoodooRMI/Transports/I2C/RMII2C.cpp +++ b/VoodooRMI/Transports/I2C/RMII2C.cpp @@ -395,7 +395,12 @@ void RMII2C::interruptOccured(OSObject *owner, IOInterruptEventSource *src, int return; } - handleAttention(mach_absolute_time(), &inputBuffer[3], size - 3); + AbsoluteTime timestamp = mach_absolute_time(); + if (src != nullptr) { + timestamp = src->getPimaryInterruptTimestamp(); + } + + handleAttention(timestamp, &inputBuffer[3], size - 3); } void RMII2C::simulateInterrupt(OSObject* owner, IOTimerEventSource* timer) {