return ret;
}
+ if ((ret = ftdi_set_interface(&ftdic, iface)) != 0) {
+ fprintf(stderr, "unable to set interface: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
+ return ret;
+ }
+
if ((ret = ftdi_usb_open(&ftdic, vid, pid)) != 0) {
fprintf(stderr, "unable to open ftdi device: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
return ret;
return ret;
}
- if ((ret = ftdi_set_interface(&ftdic, iface)) != 0) {
- fprintf(stderr, "unable to set interface: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
- return ret;
- }
-
if ((ret = ftdi_write_data_set_chunksize(&ftdic, USBBUFSIZE)) != 0) {
fprintf(stderr, "unable to set write chunksize: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
return ret;