Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WritePins always fails #38

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 2 comments
Open

WritePins always fails #38

GoogleCodeExporter opened this issue Mar 25, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Any call to WritePins fails

What is the expected output? What do you see instead?
Get an MPSSE_FAIL for return value instead of MPSSE_OK

What version of the product are you using? On what operating system?
latest SVN version.

Please provide any additional information below.
I looked at this and found, much to my chagrin, that when I'd given you this 
function, I was only checking for ftdi_write_data to return 0.  The latest 
libftdi version doesn't do that.  It actually returns the number of bytes 
written, in which case the following:
if(ftdi_write_data(&mpsse->ftdi, &data, 1) == 0)

will always fail, even if there is a success.  It probably should read:
if(ftdi_write_data(&mpsse->ftdi, &data, 1) > 0)

I guess it could even read:
if(ftdi_write_data(&mpsse->ftdi, &data, 1) >= 0)

I would send a patch instead, but I made the change without creating a git 
repository.  Since it was a trivial change, it is no big deal.  I'm guessing 
not too many people use this function.  I don't know if, given some of the 
library additions, there is now a better, or different way to achieve what this 
achieved.

Thanks for taking a look.

Original issue reported on code.google.com by [email protected] on 29 Nov 2013 at 4:05

@GoogleCodeExporter
Copy link
Author

Oh, I suppose it could even check for the number of bytes returned, but then it 
wouldn't be backward compatible with older versions of libftdi, if you care 
about that.

Original comment by [email protected] on 29 Nov 2013 at 4:07

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thanks, will fix!

Original comment by [email protected] on 2 Jan 2014 at 2:46

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant