Include VictorPV's usb reset code to all generic board when SERIAL_USB is enabled ( by the defined in boards.txt)
This commit is contained in:
parent
f69d71ba9d
commit
cbc78edce3
|
@ -75,6 +75,17 @@ namespace wirish {
|
|||
|
||||
__weak void board_setup_usb(void) {
|
||||
#ifdef SERIAL_USB
|
||||
//Attempt to reset the USB interface - developed by Victor PV
|
||||
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP);
|
||||
gpio_write_bit(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit,0);
|
||||
|
||||
|
||||
for(volatile unsigned int i=0;i<5000000;i++)
|
||||
{
|
||||
asm("nop");
|
||||
}
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_INPUT_FLOATING);
|
||||
Serial.begin();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -75,6 +75,17 @@ namespace wirish {
|
|||
|
||||
__weak void board_setup_usb(void) {
|
||||
#ifdef SERIAL_USB
|
||||
//Attempt to reset the USB interface - developed by Victor PV
|
||||
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP);
|
||||
gpio_write_bit(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit,0);
|
||||
|
||||
|
||||
for(volatile unsigned int i=0;i<5000000;i++)
|
||||
{
|
||||
asm("nop");
|
||||
}
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_INPUT_FLOATING);
|
||||
Serial.begin();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -78,7 +78,6 @@ namespace wirish {
|
|||
|
||||
|
||||
#ifdef SERIAL_USB
|
||||
/*
|
||||
//Attempt to reset the USB interface - developed by Victor PV
|
||||
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP);
|
||||
|
@ -90,7 +89,6 @@ namespace wirish {
|
|||
asm("nop");
|
||||
}
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_INPUT_FLOATING);
|
||||
*/
|
||||
Serial.begin();// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue