mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-06-03 01:15:11 +02:00
[HACK] Get the interface count right, I guess
This commit is contained in:
parent
696b0ca9c0
commit
37f932208b
1 changed files with 3 additions and 1 deletions
|
@ -138,8 +138,9 @@ static void write_configuration_descriptor(int wLength)
|
|||
{
|
||||
usb_interface_t const * const *interfaces = usb_configure_interfaces();
|
||||
size_t total_length = sizeof(usb_dc_configuration_t);
|
||||
size_t interface_count = 0;
|
||||
|
||||
for(int i = 0; interfaces[i]; i++)
|
||||
for(int i = 0; interfaces[i]; i++, interface_count++)
|
||||
for(int k = 0; interfaces[i]->dc[k]; k++)
|
||||
{
|
||||
uint8_t const *dc = interfaces[i]->dc[k];
|
||||
|
@ -149,6 +150,7 @@ static void write_configuration_descriptor(int wLength)
|
|||
|
||||
/* Write the configuration descriptor */
|
||||
dc_configuration.wTotalLength = htole16(total_length);
|
||||
dc_configuration.bNumInterfaces = interface_count; /* Small hack to get it to work, need to test */
|
||||
dcp_write(&dc_configuration, dc_configuration.bLength);
|
||||
/* For the first call, the host usually wants only this */
|
||||
if(wLength <= dc_configuration.bLength) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue