fix use of deprecated libftdi functions
This commit is contained in:
parent
78cf266f90
commit
acad3c2123
|
@ -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)
|
||||
;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue