summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/canbus/peakcan/peakcanbackend.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/canbus/peakcan/peakcanbackend.cpp b/src/plugins/canbus/peakcan/peakcanbackend.cpp
index c62fc1b..c245462 100644
--- a/src/plugins/canbus/peakcan/peakcanbackend.cpp
+++ b/src/plugins/canbus/peakcan/peakcanbackend.cpp
@@ -440,7 +440,9 @@ void PeakCanBackendPrivate::canReadNotification()
}
QCanBusFrame frame(message.ID, QByteArray(reinterpret_cast<const char *>(message.DATA), int(message.LEN)));
- frame.setTimeStamp(QCanBusFrame::TimeStamp(timestamp.millis / 1000, timestamp.micros));
+ const quint64 millis = timestamp.millis + 0xFFFFFFFFU * timestamp.millis_overflow;
+ const quint64 micros = 1000 * (millis % 1000) + timestamp.micros;
+ frame.setTimeStamp(QCanBusFrame::TimeStamp(millis / 1000, micros));
frame.setExtendedFrameFormat(message.MSGTYPE & PCAN_MESSAGE_EXTENDED);
frame.setFrameType((message.MSGTYPE & PCAN_MESSAGE_RTR) ? QCanBusFrame::RemoteRequestFrame : QCanBusFrame::DataFrame);