| 1 | package Hex::Record::Parser; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use parent 'Exporter'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | parse_intel_hex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | parse_srec_hex); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | our $VERSION = '0.05'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use Hex::Record; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | sub parse_intel_hex { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 6 | ▶ | my ($hex_string) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_intel_hex: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | my $addr_high_dec = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | my @parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | for my $line (split m{\n\r?}, $hex_string) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 33 | ▶ | $line =~ m{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | : # intel hex start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | [[:xdigit:]]{2} # bytecount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | ([[:xdigit:]]{4}) # addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | ([[:xdigit:]]{2}) # type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | ([[:xdigit:]] * ) # databytes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | [[:xdigit:]]{2} # checksum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | }ix or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 33 | my $intel_type_dec = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 33 | my @bytes_hex = unpack('(A2)*', $3); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | # data line? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 33 | ▶ | if ($intel_type_dec == 0){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 24 | push @parts, { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | start => $addr_high_dec + hex($1), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | bytes => \@bytes_hex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | # extended linear address type? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | elsif ($intel_type_dec == 4){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 3 | $addr_high_dec = hex( join '', @bytes_hex ) << 16; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | # extended segment address type? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | elsif ($intel_type_dec == 2){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 3 | $addr_high_dec = hex( join '', @bytes_hex ) << 4; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 6 | return _get_merged_parts(\@parts); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | sub parse_srec_hex { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 6 | ▶ | my ($hex_string) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_srec_hex: called CC=8 SCAR=21.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 6 | my %address_length_of_srec_type = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 => '4', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 => '4', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 2 => '6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 3 => '8', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 4 => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 5 => '4', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 6 => '6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 7 => '8', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 8 => '6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 9 => '4', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 6 | my @parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 6 | for my $line (split m{\n\r?}, $hex_string) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 18 | ▶ | next unless substr( $line, 0, 1 ) =~ m{s}i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 18 | my $type = substr $line, 1, 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 18 | my $addr_length = $address_length_of_srec_type{$type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 18 | ▶ | $line =~ m{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | s #srec hex start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | ([[:xdigit:]]{1}) #type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | [[:xdigit:]]{2} #bytecount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | ([[:xdigit:]]{$addr_length}) #addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | ([[:xdigit:]] * ) #databytes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | [[:xdigit:]]{2} #checksum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | }ix or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | #data line? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 18 | ▶ | if ($1 == 0 || $1 == 1 || $1 == 2 || $1 == 3){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition77%7/9
$1 == 0 or $1 == 1 or $1 == 2 or $1 == 3
$1 == 0 or $1 == 1 or $1 == 2
$1 == 0 or $1 == 1
MC/DC0%0/4
$1 == 0 or $1 == 1 or $1 == 2 or $1 == 3
$1 == 0
$1 == 1
$1 == 2
$1 == 3
Truth table60%3/5
A or B or C or D
A= $1 == 0B= $1 == 1C= $1 == 2D= $1 == 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 18 | push @parts, { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | start => hex $2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | bytes => [ unpack '(A2)*', $3 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | #sort the bytes of the record | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 6 | return _get_merged_parts(\@parts); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | sub _get_merged_parts { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 12 | ▶ | my ($parts_ref) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_merged_parts: called CC=7 SCAR=19.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 12 | ▶ | return unless @$parts_ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 12 | @$parts_ref = sort { $a->{start} <=> $b->{start} } @$parts_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | # set first part | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 12 | my @merged_parts = shift @$parts_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 12 | my $merged_parts_end_addr = $merged_parts[-1]->{start} + @{ $merged_parts[-1]->{bytes} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 12 | for my $part_ref (@$parts_ref) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 30 | my $part_start_addr = $part_ref->{start}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 30 | my $part_byte_count = @{ $part_ref->{bytes} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 30 | my $part_end_addr = $part_start_addr + $part_byte_count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # overwrite? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 30 | ▶ | if ($part_start_addr < $merged_parts_end_addr){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | # remove parts completly inlcuded | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 6 | my $warning = "colliding parts: "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 6 | ▶ | while ($part_start_addr < $merged_parts[-1]->{start}){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | my $removed_part = pop @merged_parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | $warning .= $removed_part->{start} . ' .. ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | . ($removed_part->{start} + @{$removed_part->{bytes}}) . ', '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | $warning .= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | $merged_parts[-1]->{start} . ' .. ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 6 | . ( $merged_parts[-1]->{start} + @{$merged_parts[-1]->{bytes}} ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | . ' with part: ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | . $part_start_addr . ' .. ' . $part_end_addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | . " ... overwriting"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 6 | carp $warning; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 6 | my $part_offset = $part_start_addr - $merged_parts[-1]->{start}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 6 | @{$merged_parts[-1]->{bytes}}[$part_offset .. $part_offset + $part_byte_count - 1] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 6 | = @{$part_ref->{bytes}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | #append? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | elsif ($part_start_addr == $merged_parts_end_addr){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 14 | push @{$merged_parts[-1]->{bytes}}, @{$part_ref->{bytes}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | #new part! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 10 | push @merged_parts, $part_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | #set new addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 30 | ▶ | $merged_parts_end_addr = $part_end_addr if $part_end_addr > $merged_parts_end_addr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 12 | return \@merged_parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | Hex::Record::Parser - parse intel and srec hex records | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | use Hex::Record::Parser qw(parse_intel_hex parse_srec_hex); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # for intel hex record | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | my $hex_parts_ref = parse_intel_hex($intel_hex_record_as_string); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | # for srec hex record | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | my $hex_parts_ref = parse_srec_hex($srec_hex_record_as_string); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | # the sctucture returned by the parser will look like this | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | # the part start addresses (0x100, 0xFFFFF in example) are sorted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | my $hex_parts_ref = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | start => 0x100, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | bytes => [qw(11 22 33 44 55 66)], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | start => 0xFFFFF, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | bytes => [qw(77 88 99 AA BB CC)], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | # create hex records, to manipulate and dump hex data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | use Hex::Record; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | my $hex_record = Hex::Record->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | parts => $hex_parts_ref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | parse intel/srec hex files. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | =head1 LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | This is released under the Artistic License. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | spebern <bernhard@specht.net> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||