Set the USB MaxPower value in the config descriptor to 500mA.

cert
Rob Riggs 2018-10-29 16:55:56 -05:00
rodzic 1373e62ba0
commit 11200f234b
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -102,7 +102,11 @@ USBD_HandleTypeDef hUsbDeviceFS;
void MX_USB_DEVICE_Init(void)
{
/* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */
// Set the MaxPower value to 500mA -- the amount of power needed to
// charge the battery.
uint16_t length;
uint8_t* cfg = USBD_CDC.GetFSConfigDescriptor(&length);
cfg[8] = 0xFA;
/* USER CODE END USB_DEVICE_Init_PreTreatment */
/* Init Device Library, add supported class and start the library. */