X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fjtag%2Fdrivers%2Fopenjtag.c;h=6940c8870619a8f09352a4ad8d814a4b20c7c133;hb=5bb0f6befb3c3f06903cee93f14bdd917abf21e7;hp=7eab5c1302bced6ca26b81e07f281fd20532960d;hpb=6ecccc88955ead6283bfa9da123e120a73d4cab8;p=fw%2Fopenocd diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index 7eab5c130..6940c8870 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -82,7 +82,7 @@ typedef enum openjtag_tap_state { } openjtag_tap_state_t; /* OPENJTAG access library includes */ -#include +#include "libftdi_helper.h" /* OpenJTAG vid/pid */ static uint16_t openjtag_vid = 0x0403; @@ -436,8 +436,8 @@ static int openjtag_init_standard(void) return ERROR_JTAG_DEVICE_ERROR; } - if (ftdi_usb_purge_buffers(&ftdic) < 0) { - LOG_ERROR("ftdi_purge_buffers: %s", ftdic.error_str); + if (ftdi_tcioflush(&ftdic) < 0) { + LOG_ERROR("ftdi flush: %s", ftdic.error_str); return ERROR_JTAG_INIT_FAILED; } @@ -591,8 +591,7 @@ static int openjtag_execute_tap_queue(void) #endif jtag_read_buffer(buffer, openjtag_scan_result_buffer[res_count].command); - if (openjtag_scan_result_buffer[res_count].buffer) - free(openjtag_scan_result_buffer[res_count].buffer); + free(openjtag_scan_result_buffer[res_count].buffer); res_count++; }