Fix #446 - bug in multipart ihex
authorvintagepc <53943260+vintagepc@users.noreply.github.com>
Sun, 18 Apr 2021 21:46:57 +0000 (17:46 -0400)
committervintagepc <53943260+vintagepc@users.noreply.github.com>
Sun, 18 Apr 2021 21:46:57 +0000 (17:46 -0400)
simavr/sim/sim_hex.c

index 18047c2..05fd65d 100644 (file)
@@ -132,7 +132,8 @@ read_ihex_chunks(
                        case 0: // normal data
                                addr = segment | (bline[1] << 8) | bline[2];
                                break;
-                       case 1: // end of file
+                       case 1: // end of file - reset segment
+                               segment = 0;
                                continue;
                        case 2: // extended address 2 bytes
                                segment = ((bline[4] << 8) | bline[5]) << 4;