File tree Expand file tree Collapse file tree
generic_stm32f103c/wirish
generic_stm32f103r/wirish
generic_stm32f103v/wirish
generic_stm32f103z/wirish Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,15 +74,16 @@ namespace wirish {
7474 }
7575
7676 __weak void board_setup_usb (void ) {
77- #ifdef SERIAL_USB
78- // Reset the USB interface on generic boards - developed by Victor PV
77+ #ifdef SERIAL_USB
7978
79+ #ifdef GENERIC_BOOTLOADER
80+ // Reset the USB interface on generic boards - developed by Victor PV
8081 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
8182 gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
8283
8384 for (volatile unsigned int i=0 ;i<256 ;i++);// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
8485 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
85-
86+ # endif
8687 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
8788#endif
8889 }
Original file line number Diff line number Diff line change @@ -76,11 +76,14 @@ namespace wirish {
7676 __weak void board_setup_usb (void ) {
7777#ifdef SERIAL_USB
7878
79+ #ifdef GENERIC_BOOTLOADER
7980 // Reset the USB interface on generic boards - developed by Victor PV
8081 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
8182 gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
83+
8284 for (volatile unsigned int i=0 ;i<256 ;i++);// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
8385 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
86+ #endif
8487
8588 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
8689#endif
Original file line number Diff line number Diff line change @@ -77,12 +77,14 @@ namespace wirish {
7777#ifdef SERIAL_USB
7878
7979
80+ #ifdef GENERIC_BOOTLOADER
8081 // Reset the USB interface on generic boards - developed by Victor PV
8182 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
8283 gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
84+
8385 for (volatile unsigned int i=0 ;i<256 ;i++);// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
8486 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
85-
87+ # endif
8688 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
8789#endif
8890 }
Original file line number Diff line number Diff line change @@ -77,15 +77,18 @@ namespace wirish {
7777
7878
7979
80- #ifdef SERIAL_USB
80+ #ifdef SERIAL_USB
81+ #ifdef GENERIC_BOOTLOADER
8182 // Reset the USB interface on generic boards - developed by Victor PV
8283 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_OUTPUT_PP);
8384 gpio_write_bit (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit ,0 );
85+
8486 for (volatile unsigned int i=0 ;i<256 ;i++);// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
8587 gpio_set_mode (PIN_MAP[PA12].gpio_device , PIN_MAP[PA12].gpio_bit , GPIO_INPUT_FLOATING);
88+ #endif
8689
8790 Serial.begin ();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
88- #endif
91+ #endif
8992 }
9093
9194 __weak void series_init (void ) {
You can’t perform that action at this time.
0 commit comments