#include "bitq.h"
/* PRESTO access library includes */
-#include <ftdi.h>
+#include "libftdi_helper.h"
/* -------------------------------------------------------------------------- */
return ERROR_JTAG_DEVICE_ERROR;
}
- if (ftdi_usb_purge_buffers(&presto->ftdic) < 0) {
- LOG_ERROR("unable to purge PRESTO buffers");
+ if (ftdi_tcioflush(&presto->ftdic) < 0) {
+ LOG_ERROR("unable to flush PRESTO buffers");
return ERROR_JTAG_DEVICE_ERROR;
}
if (presto_read(&presto_data, 1) != ERROR_OK) {
LOG_DEBUG("no response from PRESTO, retrying");
- if (ftdi_usb_purge_buffers(&presto->ftdic) < 0)
+ if (ftdi_tcioflush(&presto->ftdic) < 0)
return ERROR_JTAG_DEVICE_ERROR;
presto_data = 0xD0;
COMMAND_HANDLER(presto_handle_serial_command)
{
if (CMD_ARGC == 1) {
- if (presto_serial)
- free(presto_serial);
+ free(presto_serial);
presto_serial = strdup(CMD_ARGV[0]);
} else
return ERROR_COMMAND_SYNTAX_ERROR;
presto_close();
LOG_INFO("PRESTO closed");
- if (presto_serial) {
- free(presto_serial);
- presto_serial = NULL;
- }
+ free(presto_serial);
+ presto_serial = NULL;
return ERROR_OK;
}