diff py_avrjtag/cmd_proto.py @ 8:074e860d7d31

jtagdev is a desktop client to communicate with jtag device through Arduino.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 22 Feb 2009 22:30:20 +0800
parents 61f27549de57
children cc106f278d7d
line wrap: on
line diff
--- a/py_avrjtag/cmd_proto.py	Sun Feb 22 14:20:57 2009 +0800
+++ b/py_avrjtag/cmd_proto.py	Sun Feb 22 22:30:20 2009 +0800
@@ -66,3 +66,6 @@
             (self.__class__.__name__, self.seq, self.code, repr(self.data))
     pass
 
+def prepend_nbits(nbits, data):
+    r = chr(nbits & 0xff) + chr(nbits >> 8) + data
+    return r