From: Jan "Yenya" Kasprzak Date: Fri, 11 Feb 2011 23:26:42 +0000 (+0100) Subject: Attempt to handle timing more exactly. X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=slotcarman.git;a=commitdiff_plain;h=4b09c7514e031aed3598d632c936641a0b7e6831 Attempt to handle timing more exactly. --- 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]) ); }