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

Ftdi Support for chips with multiple interfaces (ie. FT4232H, 4 interfaces) #433

Merged

Conversation

Keeper-of-the-Keys
Copy link

This was originally meant a scratch to be redone, as far as I recall the code isn't too terrible, but if you think I need to clean up more and split FtdiInterface into seperate .h and .c files I'll be happy to sit down more on it.

I really wanted to do more work before I sent the pull req but I see I haven't had time to work on it for a while and it's a pity to let it sit.

Keeper-of-the-Keys added 15 commits April 27, 2014 19:35
…ght now it still only uses one port,

in it's current shape the work is mainly meant to be a proof of concept to be cleaned up later.

*libftdi has also been switched to 1.1*
TODO: figure out why 3/4 won't work
Removed ftdi_context from FtdiWidget
Removed several locations that opened ftdi_context ports outside of FtdiInterface (plugin/device inits)
Now all 4 ports work
TODO: register FtdiInterfaces back with FtdiWidget so that destructor can destroy them properly....
…evices instead of specific IDs.

Currently I only know that 0x6001 and 0x6011 are supported so other devices are skipped if you know another ID that works please let us know.
libftdi checks for the following pids: 0x6001, 0x6010, 0x6011, 0x6014 (all vid 0x0403).
…nterfaces now work and no memory leaks from the plugin.

TODO: figure out why reading doesn't allign to start of frame so interface can also be used for DMX in and RDM.
TODO: possibly need to clean up/add/change files depending on upstream comments.
TODO: left in old code that depended on it commented out, should probably clean it up.
@peternewman
Copy link
Member

@Keeper-of-the-Keys please can you resync with trunk/upstream for starters, then ensure Travis is green (it will give a tick next to the commit).

@Keeper-of-the-Keys
Copy link
Author

I am not sure what you mean, it says by be that my master is not ahead or
behind ola... just ftdi_scratch is ahead.

2014-07-15 15:51 GMT+03:00 peternewman notifications@github.com:

@Keeper-of-the-Keys https://github.com/Keeper-of-the-Keys please can
you resync with trunk/upstream for starters, then ensure Travis is green
(it will give a tick next to the commit).


Reply to this email directly or view it on GitHub
#433 (comment)
.

int interfaceCount = m_widget->GetInterfaceCount();
OLA_INFO << "there are " << interfaceCount << " interfaces.";
for (int i = 1; i <= interfaceCount; i++) {
AddPort(new FtdiDmxOutputPort(this,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably indent this by 4 from AddPort, so it perhaps looks like this:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  for (int i = 1; i <= interfaceCount; i++) {
    AddPort(new FtdiDmxOutputPort(
        this,
        new FtdiInterface(m_widget, static_cast<ftdi_interface>(i)),
        i,
        m_frequency));
  }

@peternewman peternewman added this to the 0.9.5 milestone Feb 17, 2015
@peternewman
Copy link
Member

Still to be fixed which I'll do after merge: Keeper-of-the-Keys@18f661d#commitcomment-9643336

peternewman added a commit that referenced this pull request Feb 22, 2015
Ftdi Support for chips with multiple interfaces (ie. FT4232H, 4 interfaces)
@peternewman peternewman merged commit 137d131 into OpenLightingProject:master Feb 22, 2015
peternewman added a commit to peternewman/ola that referenced this pull request Feb 22, 2015
nomis52 added a commit that referenced this pull request Feb 23, 2015
if (m_widget->IsOpen())
m_widget->Close();
DeleteAllPorts();
delete m_widget;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prefer auto_ptr rather than managing pointer ownership manually.

peternewman added a commit to peternewman/ola that referenced this pull request Feb 23, 2015
peternewman added a commit that referenced this pull request Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants