Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/famicom-dumper-writer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'STM32/USB_DEVICE/Target/usbd_conf.c')
-rw-r--r--STM32/USB_DEVICE/Target/usbd_conf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/STM32/USB_DEVICE/Target/usbd_conf.c b/STM32/USB_DEVICE/Target/usbd_conf.c
index 449dcaf..dd29c12 100644
--- a/STM32/USB_DEVICE/Target/usbd_conf.c
+++ b/STM32/USB_DEVICE/Target/usbd_conf.c
@@ -72,7 +72,9 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
if(pcdHandle->Instance==USB)
{
/* USER CODE BEGIN USB_MspInit 0 */
-
+ // Tweak to set max current to 500ma
+ uint16_t length;
+ *(USBD_CDC.GetFSConfigDescriptor(&length) + 8) = (500 / 2);
/* USER CODE END USB_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_USB_CLK_ENABLE();