Browse Source

i2c-stub-from-dump: Be more tolerant on input dump format

Allow for uppercase hexadecimal digits, "|" instead of ":" as the address
separator, and an optional space before said separator. i2cdump doesn't
use any of these but other dump tools do, so this improves
compatibility.


git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6013 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.1.1
Jean Delvare 14 years ago
parent
commit
50eccc620f
  1. 3
      CHANGES
  2. 4
      stub/i2c-stub-from-dump

3
CHANGES

@ -1,6 +1,9 @@
i2c-tools CHANGES
-----------------
SVN HEAD
i2c-stub-from-dump: Be more tolerant on input dump format
3.1.0 (2011-12-04)
decode-dimms: Decode module configuration type of DDR SDRAM
Decode refresh rate of DDR SDRAM

4
stub/i2c-stub-from-dump

@ -127,7 +127,7 @@ sub process_dump
open(DUMP, $dump) || die "Can't open $dump: $!\n";
OUTER_LOOP:
while (<DUMP>) {
if (m/^([0-9a-f]0):(( [0-9a-fX]{2}){16})/) {
if (m/^([0-9a-f]0) ?[:|](( [0-9a-fX]{2}){16})/i) {
# Byte dump
my $offset = hex($1);
my @values = split(/ /, $2);
@ -142,7 +142,7 @@ sub process_dump
}
$bytes++;
}
} elsif (m/^([0-9a-f][08]):(( [0-9a-fX]{4}){8})/) {
} elsif (m/^([0-9a-f][08]) ?[:|](( [0-9a-fX]{4}){8})/i) {
# Word dump
my $offset = hex($1);
my @values = split(/ /, $2);

Loading…
Cancel
Save