Skip to content

Commit 143a7b5

Browse files
committed
Support custom USB reenumeration.
1 parent 49eb0b8 commit 143a7b5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-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

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

98+
extern "C"
99+
{
100+
void USBD_reenumerate(void)
101+
{
102+
pinMode(PB9, OUTPUT);
103+
digitalWrite(PB9, HIGH);
104+
delay(10);
105+
digitalWrite(PB9, LOW);
106+
delay(10);
107+
digitalWrite(PB9, HIGH);
108+
}
109+
110+
}
98111
/**
99112
* @brief System Clock Configuration
100113
* The system Clock is configured as follow :

0 commit comments

Comments
 (0)