ftdi: fix overflow if last field of a scan is empty
commit6055d952c3efd2e6b12924c5ec42407fff99b453
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Thu, 23 Aug 2012 21:35:48 +0000 (23 23:35 +0200)
committerFreddie Chopin <freddie.chopin@gmail.com>
Wed, 29 Aug 2012 06:31:59 +0000 (29 06:31 +0000)
treefbaa910a62824446f867692736801126c7e65446
parentd9a02fda075c466dd4a37785d886a4b1ee382242
ftdi: fix overflow if last field of a scan is empty

The last bit of a scan is clocked during TAP movement so it's necessary
for the last field to have at least one bit. Strip trailing empty fields
and make sure the TAP is not affected if there's nothing to scan. Clients
probably shouldn't add empty fields so add a debug message to be able to
track and fix them.

Change-Id: I27552568bc11146570b9b99ed8a1ae81b5fb2c50
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/794
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/jtag/drivers/ftdi.c