# HG changeset patch # User Thinker K.F. Li # Date 1235282150 -28800 # Node ID eb14cac68cbbed67701bfd5b9a145d793de6dbab # Parent 6b1594fb668f35e81addcb5a4b36faba465758ec Transite TAP controller to shift state. - shift commands will transite state machine of TAP controller to shift state before starting shifting. diff -r 6b1594fb668f -r eb14cac68cbb src/jtag.c --- a/src/jtag.c Sun Feb 22 12:54:45 2009 +0800 +++ b/src/jtag.c Sun Feb 22 13:55:50 2009 +0800 @@ -30,6 +30,11 @@ } while(0) #define GET_TDO() (JTAG_PIN & _BV(JTAG_TDO)) +/*! + * Before shifting registers, TAP controller must move to last state before + * shift state. The state machine transite to shift state when shifting + * starts. + */ void jtag_tms(char *buf, int nbits) { int i; int nbytes, byte; @@ -88,6 +93,11 @@ int byteoff, bitoff; int bit; + /* Transite to shift state. + * \sa jtag_tms() + */ + pin_lo(JTAG_PORT, JTAG_TMS); + nbytes = nbits / 8; for(i = 0; i < nbytes; i++) { byte = buf[i]; @@ -143,6 +153,11 @@ int byteoff, bitoff; int bit; + /* Transite to shift state. + * \sa jtag_tms() + */ + pin_lo(JTAG_PORT, JTAG_TMS); + nbytes = nbits / 8; for(i = 0; i < nbytes; i++) { byte = ibuf[i];