We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a2c0294 + 5d33fe1 commit df84eb1Copy full SHA for df84eb1
features/unsupported/USBHost/targets/TARGET_STM/USBHALHost_STM.h
@@ -122,10 +122,14 @@ static gpio_t gpio_powerpin;
122
123
void usb_vbus(uint8_t state)
124
{
125
- if (state == 0) {
126
- gpio_write(&gpio_powerpin, USB_POWER_OFF);
+ if (gpio_powerpin.reg_set && gpio_powerpin.reg_clr) {
+ if (state == 0) {
127
+ gpio_write(&gpio_powerpin, USB_POWER_OFF);
128
+ } else {
129
+ gpio_write(&gpio_powerpin, USB_POWER_ON);
130
+ }
131
} else {
- gpio_write(&gpio_powerpin, USB_POWER_ON);
132
+ /* The board does not have GPIO pin to control usb supply */
133
}
134
wait(0.2);
135
0 commit comments