File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,17 @@ int FTDIpp_MPSSE::setClkFreq(uint32_t clkHZ)
377377 float real_freq = 0 ;
378378 uint16_t presc;
379379
380+ #if (FTDI_VERSION < 105)
381+ ftdi_usb_purge_buffers (_ftdi);
382+ #else
383+ if ((ret = ftdi_tcioflush (_ftdi)) < 0 ) {
384+ printError (" selfClkFreq: fail to flush buffers: " +
385+ string (ftdi_get_error_string (_ftdi)));
386+ return ret;
387+ }
388+
389+ #endif
390+
380391 _clkHZ = clkHZ;
381392
382393 /* FT2232C has no divide by 5 instruction
@@ -446,17 +457,6 @@ int FTDIpp_MPSSE::setClkFreq(uint32_t clkHZ)
446457 return ret;
447458 }
448459
449- #if (FTDI_VERSION < 105)
450- ftdi_usb_purge_buffers (_ftdi);
451- #else
452- if ((ret = ftdi_tcioflush (_ftdi)) < 0 ) {
453- printError (" selfClkFreq: fail to flush buffers: " +
454- string (ftdi_get_error_string (_ftdi)));
455- return ret;
456- }
457-
458- #endif
459-
460460 _clkHZ = real_freq;
461461
462462 return real_freq;
You can’t perform that action at this time.
0 commit comments