mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-20 21:01:25 +03:00
Fix for some strange behaviours during board reset
This commit is contained in:
@ -637,6 +637,12 @@ void USB_::attach()
|
|||||||
PLLCSR = 0x12; // Need 16 MHz xtal
|
PLLCSR = 0x12; // Need 16 MHz xtal
|
||||||
while (!(PLLCSR & (1<<PLOCK))) // wait for lock pll
|
while (!(PLLCSR & (1<<PLOCK))) // wait for lock pll
|
||||||
;
|
;
|
||||||
|
|
||||||
|
// Some tests on specific versions of macosx (10.7.3), reported some
|
||||||
|
// strange behaviuors when the board is reset using the serial
|
||||||
|
// port touch at 1200 bps. This delay fixes this behaviour.
|
||||||
|
delay(1);
|
||||||
|
|
||||||
USBCON = ((1<<USBE)|(1<<OTGPADE)); // start USB clock
|
USBCON = ((1<<USBE)|(1<<OTGPADE)); // start USB clock
|
||||||
UDIEN = (1<<EORSTE)|(1<<SOFE); // Enable interrupts for EOR (End of Reset) and SOF (start of frame)
|
UDIEN = (1<<EORSTE)|(1<<SOFE); // Enable interrupts for EOR (End of Reset) and SOF (start of frame)
|
||||||
UDCON = 0; // enable attach resistor
|
UDCON = 0; // enable attach resistor
|
||||||
|
Reference in New Issue
Block a user