Skip to content

Commit f9f4340

Browse files
xC0000005fpistm
authored andcommitted
Support custom Usb reenumerate (#500)
* Support custom USB reenumeration. Co-Authored-By: xC0000005 <[email protected]>
1 parent f0143f9 commit f9f4340

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cores/arduino/stm32/usb/usbd_if.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @retval None
1717
*/
1818

19-
void USBD_reenumerate(void)
19+
WEAK void USBD_reenumerate(void)
2020
{
2121
#ifndef USBD_REENUM_DISABLED
2222
/* Re-enumerate the USB */

variants/MALYANM200_F103CB/variant.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ void initVariant()
9595
digitalWrite(PB9, 1);
9696
}
9797

98+
void USBD_reenumerate(void)
99+
{
100+
pinMode(PB9, OUTPUT);
101+
digitalWrite(PB9, HIGH);
102+
delay(10);
103+
digitalWrite(PB9, LOW);
104+
delay(10);
105+
digitalWrite(PB9, HIGH);
106+
}
107+
98108
/**
99109
* @brief System Clock Configuration
100110
* The system Clock is configured as follow :

0 commit comments

Comments
 (0)