/* Wait for the latency-timer to kick in */
usleep(2);
if ((ret = ftdi_set_bitmode(&ftdic, JTAGKEY_TCK|JTAGKEY_TDI|JTAGKEY_TMS|JTAGKEY_OEn, mode)) != 0) {
/* Wait for the latency-timer to kick in */
usleep(2);
if ((ret = ftdi_set_bitmode(&ftdic, JTAGKEY_TCK|JTAGKEY_TDI|JTAGKEY_TMS|JTAGKEY_OEn, mode)) != 0) {
jtagkey_set_bbmode(BITMODE_SYNCBB);
ftdi_write_data(&ftdic, writebuf, writepos-writebuf);
jtagkey_set_bbmode(BITMODE_SYNCBB);
ftdi_write_data(&ftdic, writebuf, writepos-writebuf);