Changeset 131 for Deliverables/D4.1/IntelHex.ml
 Timestamp:
 Sep 27, 2010, 1:25:06 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/IntelHex.ml
r130 r131 78 78  4 > ExtendedLinear 79 79  _ > assert false 80 ;; 81 82 let int_of_intel_hex_type = 83 function 84 Data > 0 85  End > 1 86  ExtendedSeg > 2 87  ExtendedLinear > 4 80 88 ;; 81 89 … … 183 191 in 184 192 aux strs 193 194 let add_bytes v = 195 let r = List.rev v in 196 let rec aux (cry, bs) = 197 function 198 [] > (cry, bs) 199  hd::tl > 200 aux (full_add hd bs cry) tl 201 in 202 aux (false, (vect_of_int 0 `Eight)) r 203 204 let checksum_valid hex_entry = 205 if List.length hex_entry.data_field mod 2 <> 0 then 206 false 207 else 208 let chk_1, chk_2 = hex_entry.data_checksum in 209 let _, cs_total = half_add chk_1 chk_2 in 210 let len_1, len_2 = hex_entry.record_length in 211 let _, ln_total = half_add len_1 len_2 in 212 let adr_1, adr_2, adr_3, adr_4 = hex_entry.record_addr in 213 let _, ad_total1 = half_add adr_1 adr_2 in 214 let _, ad_total2 = half_add adr_3 adr_4 in 215 let _, dt_total = add_bytes hex_entry.data_field in 216 let _, total = add_bytes [cs_total; ln_total; ad_total1; ad_total2; dt_total] in 217 cs_total = total
Note: See TracChangeset
for help on using the changeset viewer.