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

CDC doesn't implement the periodic status reporting #1

Open
mithro opened this issue Jul 27, 2015 · 0 comments
Open

CDC doesn't implement the periodic status reporting #1

mithro opened this issue Jul 27, 2015 · 0 comments

Comments

@mithro
Copy link
Owner

mithro commented Jul 27, 2015

The CDC protocol requires that you continually report the status of the CDC device using an interrupt endpoint. The current firmware doesn't do this.

This is what the TD_poll code is doing in the HDMI2USB Cypress firmware at https://github.com/timvideos/HDMI2USB/blob/master/cypress/app.c#L549

void TD_Poll(void)             // Called repeatedly while the device is idle
{


if (!(EP1INCS & 0x02))      // check if EP1IN is available
  {
    EP1INBUF[0] = 0x0A;       // if it is available, then fill the first 10 bytes of the buffer with 
    EP1INBUF[1] = 0x20;       // appropriate data. 
    EP1INBUF[2] = 0x00;
    EP1INBUF[3] = 0x00;
    EP1INBUF[4] = 0x00;
    EP1INBUF[5] = 0x00;
    EP1INBUF[6] = 0x00;
    EP1INBUF[7] = 0x02;
    EP1INBUF[8] = 0x00;
    EP1INBUF[9] = 0x00;
    EP1INBC = 10;            // manually commit once the buffer is filled
  }


}

See also the cdc.h file at https://github.com/mithro/fx2lib/blob/master/examples/cdc/common/cdc.h#L119-L143

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