fix use of deprecated libftdi functions

This commit is contained in:
Triss 2021-06-26 01:15:47 +02:00
parent 78cf266f90
commit acad3c2123
6 changed files with 7 additions and 7 deletions

View File

@ -625,7 +625,7 @@ static int sigma_fpga_init_bitbang_once(struct dev_context *devc)
if (ret != SR_OK)
return ret;
g_usleep(10 * 1000);
ftdi_usb_purge_buffers(&devc->ftdi.ctx);
ftdi_tcioflush(&devc->ftdi.ctx);
/*
* Wait until the FPGA asserts INIT_B. Check in a maximum number
@ -889,7 +889,7 @@ static int upload_firmware(struct sr_context *ctx, struct dev_context *devc,
ftdi_get_error_string(&devc->ftdi.ctx));
return SR_ERR;
}
ftdi_usb_purge_buffers(&devc->ftdi.ctx);
ftdi_tcioflush(&devc->ftdi.ctx);
while (sigma_read_raw(devc, &pins, sizeof(pins)) > 0)
;

View File

@ -243,7 +243,7 @@ static int dev_open(struct sr_dev_inst *sdi)
goto err_ftdi_free;
}
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
if ((ret = ftdi_tcioflush(devc->ftdic)) < 0) {
sr_err("Failed to purge FTDI buffers (%d): %s.",
ret, ftdi_get_error_string(devc->ftdic));
goto err_ftdi_free;

View File

@ -202,7 +202,7 @@ static int close_usb_reset_sequencer(struct dev_context *devc)
sr_dbg("Purging buffers, resetting+closing FTDI device.");
/* Log errors, but ignore them (i.e., don't abort). */
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0)
if ((ret = ftdi_tcioflush(devc->ftdic)) < 0)
sr_err("Failed to purge FTDI buffers (%d): %s.",
ret, ftdi_get_error_string(devc->ftdic));
if ((ret = ftdi_usb_reset(devc->ftdic)) < 0)

View File

@ -325,7 +325,7 @@ static int dev_open(struct sr_dev_inst *sdi)
goto err_ftdi_free;
}
ret = ftdi_usb_purge_buffers(devc->ftdic);
ret = ftdi_tcioflush(devc->ftdic);
if (ret < 0) {
sr_err("Failed to purge FTDI RX/TX buffers (%d): %s.",
ret, ftdi_get_error_string(devc->ftdic));

View File

@ -141,7 +141,7 @@ static int dev_open(struct sr_dev_inst *sdi)
return SR_ERR;
}
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
if ((ret = ftdi_tcioflush(devc->ftdic)) < 0) {
sr_err("Failed to purge FTDI RX/TX buffers (%d): %s.",
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;

View File

@ -90,7 +90,7 @@ SR_PRIV int p_ols_open(struct dev_context *devc)
return SR_ERR;
}
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
if ((ret = ftdi_tcioflush(devc->ftdic)) < 0) {
sr_err("Failed to purge FTDI RX/TX buffers (%d): %s.",
ret, ftdi_get_error_string(devc->ftdic));
goto err_open_close_ftdic;