From 4b09c7514e031aed3598d632c936641a0b7e6831 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Sat, 12 Feb 2011 00:26:42 +0100 Subject: [PATCH] Attempt to handle timing more exactly. --- SCX/Parser.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SCX/Parser.pm b/SCX/Parser.pm index b71f26b..080e8f2 100644 --- a/SCX/Parser.pm +++ b/SCX/Parser.pm @@ -185,9 +185,12 @@ sub car_lap_time_packet { || $bytes[5] & 0x01; $self->car_lap_time($bytes[0], - 256*$bytes[1] + $bytes[2] + ($bytes[3] & 0x01 ? 1 : 0), + 256*$bytes[1] + $bytes[2] + + ($bytes[3] & 0x02 ? 256 : 0) + + ($bytes[3] & 0x01 ? 1 : 0), sprintf('%.3f', 0.01024 * (256*$bytes[4] + $bytes[5] - + ($bytes[3] & 0x08 ? 1 : 0))), + + ($bytes[3] & 0x08 ? 256 : 0) + + ($bytes[3] & 0x04 ? 1 : 0))), sprintf('%04b', $bytes[3]) ); } -- 2.43.5