forked from djmuhlestein/fx2lib
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
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