Ignore:
Timestamp:
Sep 27, 2010, 3:50:00 PM (9 years ago)
Author:
mulligan
Message:

Fixed checksum calculation check. Requires a *half add* (i.e. ignore
carry when summing), not a full add. This is not obvious from the Keil
website describing the calculation. Tested on example programs on Keil
website, and it works fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/IntelHex.ml

    r134 r135  
    198198      [] -> (cry, bs)
    199199    | hd::tl ->
    200         aux (full_add hd bs cry) tl
     200        aux (half_add hd bs) tl
    201201  in
    202202    aux (false, (vect_of_int 0 `Eight)) r
     
    227227
    228228(* DPM: Debug
    229    let Some entry = intel_hex_format_of_string ":00000001FF";;
     229   let tot = complement <*> snd $ add_bytes [vect_of_int 2 `Eight; vect_of_int 0 `Eight; vect_of_int 0 `Eight; vect_of_int 4 `Eight; vect_of_int 255 `Eight; vect_of_int 255 `Eight];;
     230   let Some entry = intel_hex_format_of_string ":02000004FFFFFC";;
    230231   checksum_valid $ List.hd entry;;
    231232*)
Note: See TracChangeset for help on using the changeset viewer.