File tree 2 files changed +16
-1
lines changed 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 46
46
- type : input
47
47
attributes :
48
48
label : TinyUSB Library version
49
- placeholder : " Release version or github latest "
49
+ placeholder : " Release version or commit SHA "
50
50
validations :
51
51
required : true
52
52
Original file line number Diff line number Diff line change @@ -80,6 +80,21 @@ class Adafruit_USBD_Device {
80
80
// Clear/Reset configuration descriptor
81
81
void clearConfiguration (void );
82
82
83
+ // Set configuration attribute
84
+ void setConfigurationAttribute (uint8_t attribute) {
85
+ _desc_cfg[offsetof (tusb_desc_configuration_t , bmAttributes)] = attribute;
86
+ }
87
+
88
+ // Set max power consumption in mA (absolute max is 510ma)
89
+ bool setConfigurationMaxPower (uint16_t power_ma) {
90
+ if (power_ma > 255 * 2u ) {
91
+ return false ;
92
+ }
93
+ _desc_cfg[offsetof (tusb_desc_configuration_t , bMaxPower)] =
94
+ (uint8_t )(power_ma / 2 );
95
+ return true ;
96
+ }
97
+
83
98
// Provide user buffer for configuration descriptor, if total length > 256
84
99
void setConfigurationBuffer (uint8_t *buf, uint32_t buflen);
85
100
You can’t perform that action at this time.
0 commit comments