mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 06:08:31 +03:00
Fixed change usb config bug
In the standard atmel lib only one configuration was possible. On a GETDESCRIPTOR request the board would always return the full buffer with both configurations. The USB driver requests each configuration one after another, using the configuration index number. The atmel lib did not support more than one USB configuration.
This commit is contained in:
@@ -183,7 +183,7 @@ static uint8_t HIDDTransferDriver_GetDescriptor(uint8_t type,
|
||||
else {
|
||||
|
||||
pConfiguration =
|
||||
pHidd->pUsbd->pDescriptors->pFsConfiguration;
|
||||
pHidd->pUsbd->pDescriptors->pFsConfiguration[0];
|
||||
}
|
||||
|
||||
/* Parse the device configuration to get the HID descriptor */
|
||||
@@ -280,7 +280,7 @@ void HIDDTransferDriver_ConfigurationChangedHandler(uint8_t cfgnum)
|
||||
if (USBD_HAL_IsHighSpeed() && pDescriptors->pHsConfiguration)
|
||||
pDesc = (USBConfigurationDescriptor*)pDescriptors->pHsConfiguration;
|
||||
else
|
||||
pDesc = (USBConfigurationDescriptor*)pDescriptors->pFsConfiguration;
|
||||
pDesc = (USBConfigurationDescriptor*)pDescriptors->pFsConfiguration[0];
|
||||
HIDDFunction_ParseInterface(pHidd,
|
||||
(USBGenericDescriptor*)pDesc,
|
||||
pDesc->wTotalLength);
|
||||
|
||||
Reference in New Issue
Block a user