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
path: root/STM32
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2020-12-13 21:56:13 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2020-12-13 21:56:13 +0300
commit15a63219a1db3d771dd9f700316f225972f26794 (patch)
treedbace38f4279648a736fc58c2c3649eb5ca739d3 /STM32
parentb09278f4d5482e1c5618f844456a264cbc06468a (diff)
Tweak to set max USB current to 500ma
Diffstat (limited to 'STM32')
-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();