From 8650109879b9f9a18d627c8977e73dafb2ac8acb Mon Sep 17 00:00:00 2001 From: optixx Date: Thu, 17 Sep 2009 20:25:08 +0200 Subject: [PATCH] support files with copy header --- avr/usbload/main.c | 2 +- scripts/crc_xmodem.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/avr/usbload/main.c b/avr/usbload/main.c index 2b0bdde..f00fa9b 100644 --- a/avr/usbload/main.c +++ b/avr/usbload/main.c @@ -357,7 +357,7 @@ int main(void) #endif #if DO_CRC_CHECK - info_P(PSTR("-->CRC Checkn")); + info_P(PSTR("-->CRC Check\n")); crc_check_bulk_memory(0x000000, req_bank_size * req_bank_cnt, req_bank_size); #endif diff --git a/scripts/crc_xmodem.py b/scripts/crc_xmodem.py index af764bd..dac1108 100644 --- a/scripts/crc_xmodem.py +++ b/scripts/crc_xmodem.py @@ -41,9 +41,16 @@ def test_algo(): def main(): #import cProfile #cProfile.run('test_performance()') + if sys.argv[1].endswith(".smc"): + copy_header= True size = os.stat(sys.argv[1])[6] fd = open(sys.argv[1]) + + if copy_header: + fd.seek(512) + size = size - 512 + addr = 0x0000 step = 2**15 result = []