Skip to content

Commit 3cad30d

Browse files
authored
Merge pull request arduino#170 from kaysievers/tinyusb-config-power
tinyusb: Allow configuration of power setting
2 parents c842d61 + b369396 commit 3cad30d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#define USB_PRODUCT "Unknown"
3535
#endif
3636

37+
#ifndef USB_CONFIG_POWER
38+
#define USB_CONFIG_POWER 100
39+
#endif
40+
3741
extern uint8_t load_serial_number(uint16_t* serial_str);
3842

3943
Adafruit_USBD_Device USBDevice;
@@ -76,7 +80,7 @@ Adafruit_USBD_Device::Adafruit_USBD_Device(void)
7680
.bConfigurationValue = 1,
7781
.iConfiguration = 0x00,
7882
.bmAttributes = TU_BIT(7) | TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP,
79-
.bMaxPower = TUSB_DESC_CONFIG_POWER_MA(100)
83+
.bMaxPower = TUSB_DESC_CONFIG_POWER_MA(USB_CONFIG_POWER)
8084
};
8185

8286
memcpy(_desc_cfg, &dev_cfg, sizeof(tusb_desc_configuration_t));

0 commit comments

Comments
 (0)