Skip to content

Commit b407337

Browse files
committed
Fix for some strange behaviours during board reset
1 parent 1566006 commit b407337

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cores/arduino/USBCore.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,12 @@ void USB_::attach()
637637
PLLCSR = 0x12; // Need 16 MHz xtal
638638
while (!(PLLCSR & (1<<PLOCK))) // wait for lock pll
639639
;
640+
641+
// Some tests on specific versions of macosx (10.7.3), reported some
642+
// strange behaviuors when the board is reset using the serial
643+
// port touch at 1200 bps. This delay fixes this behaviour.
644+
delay(1);
645+
640646
USBCON = ((1<<USBE)|(1<<OTGPADE)); // start USB clock
641647
UDIEN = (1<<EORSTE)|(1<<SOFE); // Enable interrupts for EOR (End of Reset) and SOF (start of frame)
642648
UDCON = 0; // enable attach resistor
@@ -659,4 +665,4 @@ void USB_::poll()
659665
{
660666
}
661667

662-
#endif /* if defined(USBCON) */
668+
#endif /* if defined(USBCON) */

0 commit comments

Comments
 (0)