ftdipp_mpsse: add workaround for libftdi < 1.4

This commit is contained in:
Gwenhael Goavec-Merou
2019-11-19 12:02:12 +01:00
parent ec8d890d27
commit 0a604baaae
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -81,7 +81,11 @@ void FTDIpp_MPSSE::open_device(unsigned int baudrate)
if (_bus == -1 or _addr == -1)
ret = ftdi_usb_open_desc(_ftdi, _vid, _pid, NULL, NULL);
else
#if (OLD_FTDI_VERSION == 1)
ret = ftdi_usb_open_desc(_ftdi, _vid, _pid, _product, NULL);
#else
ret = ftdi_usb_open_bus_addr(_ftdi, _bus, _addr);
#endif
if (ret < 0) {
fprintf(stderr, "unable to open ftdi device: %d (%s)\n",
ret, ftdi_get_error_string(_ftdi));