From f9b3e670a100ffb7d0218e6cc961c85a23a3e52e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 24 Jun 2014 18:42:59 -0300 Subject: [PATCH] parse_dib0700.pl: Make the delays multiple of 10ms That makes it more real to what the Kernel would provide. Signed-off-by: Mauro Carvalho Chehab --- contrib/dib0700/parse_dib0700.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/dib0700/parse_dib0700.pl b/contrib/dib0700/parse_dib0700.pl index 15acd31..590cdd0 100755 --- a/contrib/dib0700/parse_dib0700.pl +++ b/contrib/dib0700/parse_dib0700.pl @@ -14,6 +14,8 @@ use strict; +my $min_delay = 10; + my %req_map = ( 0x0 => "REQUEST_SET_USB_XFER_LEN", 0x2 => "REQUEST_I2C_READ", @@ -110,7 +112,7 @@ while (<>) { $delay = 0; if (m/(IN|OUT): (\d+) ms \d+ ms/) { - $delay = $2 if ($2 > 1); + $delay = $min_delay * int(($2 + $min_delay / 2) / $min_delay); } if ($req eq "REQUEST_I2C_READ") { -- 2.7.4