diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-12-13 21:56:13 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-12-13 21:56:13 +0300 |
commit | 15a63219a1db3d771dd9f700316f225972f26794 (patch) | |
tree | dbace38f4279648a736fc58c2c3649eb5ca739d3 /STM32 | |
parent | b09278f4d5482e1c5618f844456a264cbc06468a (diff) |
Tweak to set max USB current to 500ma
Diffstat (limited to 'STM32')
-rw-r--r-- | STM32/USB_DEVICE/Target/usbd_conf.c | 4 |
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();
|