File tree Expand file tree Collapse file tree
generic_stm32f103c/wirish
generic_stm32f103r/wirish
generic_stm32f103z/wirish Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,17 @@ namespace wirish {
7575
7676 __weak void board_setup_usb (void ) {
7777#ifdef SERIAL_USB
78+ // Attempt to reset the USB interface - developed by Victor PV
79+
80+ gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
81+ gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
82+
83+
84+ for (volatile unsigned int i=0 ;i<5000000 ;i++)
85+ {
86+ asm (" nop" );
87+ }
88+ gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
7889 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
7990#endif
8091 }
Original file line number Diff line number Diff line change @@ -75,6 +75,17 @@ namespace wirish {
7575
7676 __weak void board_setup_usb (void ) {
7777#ifdef SERIAL_USB
78+ // Attempt to reset the USB interface - developed by Victor PV
79+
80+ gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
81+ gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
82+
83+
84+ for (volatile unsigned int i=0 ;i<5000000 ;i++)
85+ {
86+ asm (" nop" );
87+ }
88+ gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
7889 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
7990#endif
8091 }
Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ namespace wirish {
7878
7979
8080 #ifdef SERIAL_USB
81- /*
8281 // Attempt to reset the USB interface - developed by Victor PV
8382
8483 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
@@ -90,7 +89,6 @@ namespace wirish {
9089 asm (" nop" );
9190 }
9291 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
93- */
9492 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
9593 #endif
9694 }
You can’t perform that action at this time.
0 commit comments