]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tools/tinyos/misc/tos-build-deluge-image
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tools / tinyos / misc / tos-build-deluge-image
index 3095167aeeed9ad4c37b26a5700c52c0c9ec4691..0dddf828cc76d74acf23a145d628e63e7dd99d8c 100755 (executable)
@@ -130,10 +130,11 @@ except:
 all = []
 section = []
 end_addr = None
+offset = 0
 for line in image.split():
     #print "DEBUG:", line
     length = int(line[1:3], 16)
-    addr = int(line[3:7], 16)
+    addr = int(line[3:7], 16) + offset
     rectype = int(line[7:9], 16)
     data = []
     if len(line) > 11:
@@ -155,6 +156,8 @@ for line in image.split():
             start_addr = addr
         section += data
         end_addr = addr + length
+    elif rectype == 0x02:
+        offset = int(line[9:9+4], 16) << 4
     elif rectype == 0x01:
         all.append((start_addr, section))
         section = []