- /* 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) {
- fprintf(stderr, "unable to enable bitbang mode: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
- return ret;
- }
- if ((ret = ftdi_usb_purge_buffers(&ftdic)) != 0) {
- fprintf(stderr, "unable to purge buffers: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
- return ret;
- }
- /* Wait for the FTDI2232 to settle */
- usleep(2);