示例#1
0
        internal string EncodeLineWithFormat(Line l, HexFormat fmt)
        {
            if (l.Type == LineType.Data)
            {
                l.Address = l.Address - _addressOffset; // cuurent offset
            }
            else if (l.Type == LineType.Offset)
            {
                _addressOffset = l.Address;
            }

            char[] a = null;
            switch (fmt)
            {
            case HexFormat.INTEL_HEX:
                a = _ihex.EncodeLine(l);
                break;

            case HexFormat.S_RECORD:
                a = _srec.EncodeLine(l);
                break;
            }
            return((a == null)? "": new String(a) + "\r\n");
        }