mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-24 04:42:51 -04:00
fixed an issue in the intel-hex import, closes #1451
This commit is contained in:
parent
d828d71eef
commit
535812dacb
@ -2,6 +2,8 @@ Release Notes
|
||||
|
||||
HEAD, planned as v0.32
|
||||
- Fixed some bugs in the creation of circuits.
|
||||
- Fixed an Intel Hex import error that occurred when
|
||||
files contained more than 64 kBytes of data.
|
||||
|
||||
v0.31, released on 3. September 2024
|
||||
- Added a run command to the cli to run circuit headless
|
||||
|
@ -40,18 +40,26 @@ public class IntelHexReader implements ByteArrayReader {
|
||||
case 0:
|
||||
readData(payload, byteArray);
|
||||
break;
|
||||
case 2:
|
||||
readDataSegment(payload);
|
||||
case 1:
|
||||
// eof
|
||||
break;
|
||||
case 2:
|
||||
readDataSegment(payload, 4);
|
||||
break;
|
||||
case 4:
|
||||
readDataSegment(payload, 16);
|
||||
break;
|
||||
default:
|
||||
throw new IOException("Intel-Hex Record Type " + data[3] + " not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readDataSegment(int len) throws IOException {
|
||||
private void readDataSegment(int len, int shift) throws IOException {
|
||||
if (len != 2)
|
||||
throw new IOException("invalid segment address");
|
||||
segment = ((data[4] << 8) + data[5]) << 4;
|
||||
segment = ((data[4] << 8) + data[5]) << shift;
|
||||
}
|
||||
|
||||
private void readData(int len, ByteArray byteArray) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user