From: theStack Date: Sat, 12 Dec 2009 04:00:08 +0000 (+0100) Subject: impl. CALL and CHECKSUM bootloader cmds, untested X-Git-Tag: v0.1~55 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=pyfrprog.git;a=commitdiff_plain;h=562594c85205ccdd8f9eaa1c76e57b4d7dce39b3 impl. CALL and CHECKSUM bootloader cmds, untested --- diff --git a/frprog.py b/frprog.py index 6cdff79..66e6d47 100755 --- a/frprog.py +++ b/frprog.py @@ -32,7 +32,6 @@ def recvByte(): def recvChecksum(): global last_checksum - # get checksum last_checksum = recvByte() last_checksum |= (recvByte() << 8) @@ -72,6 +71,32 @@ def cmdWRITE(address, size, data): # get checksum recvChecksum() +# TODO: test this function! +def cmdCALL(address): + # send CALL command + sendByte(0x01) + if (recvByte() != 0xF1): + raise Exception + sendByte(0x04) + if (recvByte() != 0x84): + raise Exception + # tell desired address + sendDWord(address) + # wait for return parameter - not needed here! + #return recvByte() + +# TODO: test this function! +def cmdCHECKSUM(): + # call CHECKSUM command + sendByte(0x01) + if (recvByte() != 0xF1): + raise Exception + sendByte(0x05) + if (recvByte() != 0x84): + raise Exception + # get checksum + recvChecksum() + def cmdBAUDRATE(baudrate): global last_checksum