1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge remote branch 'ricklon/platforms' into new-extension

This commit is contained in:
David A. Mellis
2011-06-25 11:08:42 -04:00
16 changed files with 1134 additions and 71 deletions

View File

@ -278,6 +278,8 @@ void HardwareSerial::begin(unsigned long baud)
use_u2x = false;
}
#endif
try_again:
if (use_u2x) {
*_ucsra = 1 << _u2x;
@ -286,6 +288,12 @@ void HardwareSerial::begin(unsigned long baud)
*_ucsra = 0;
baud_setting = (F_CPU / 8 / baud - 1) / 2;
}
if ((baud_setting > 4095) && use_u2x)
{
use_u2x = false;
goto try_again;
}
// assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register)
*_ubrrh = baud_setting >> 8;