# HG changeset patch # User Thinker K.F. Li # Date 1235457203 -28800 # Node ID 520f45b72ba79692dd94a314ac65cf62111172d9 # Parent cc106f278d7db19d227fbb2ffc330604a6779cc2 Add debug_frame flag to enable print-out frame when received diff -r cc106f278d7d -r 520f45b72ba7 py_avrjtag/jtagdev.py --- a/py_avrjtag/jtagdev.py Tue Feb 24 13:32:04 2009 +0800 +++ b/py_avrjtag/jtagdev.py Tue Feb 24 14:33:23 2009 +0800 @@ -1,6 +1,8 @@ import tms_ptns import cmd_proto +debug_frame = 0 + class jtagdev(object): ST_RESET = 0 ST_IDLE = 1 @@ -55,6 +57,9 @@ if not frame: return None + if debug_frame: + print repr(frame) + pass cmd = cmd_proto.cmd() r = cmd.from_frame(frame) @@ -117,6 +122,17 @@ self.state = self.ST_EXIT1_IR pass + def shift_IR_n_out(self, data, nbits): + self.seq = (self.seq + 1) % 256 + + if self.state != self.ST_SHIFT_IR: + raise RuntimeError, 'Invalid state' + + self._send_nbits_data_cmd(cmd_proto.CPCMD_SHIFT_TDI_TDO, + nbits, data) + self.state = self.ST_EXIT1_IR + pass + def shift_DR(self, data, nbits): self.seq = (self.seq + 1) % 256