diff options
author | Karel Kočí <cynerd@email.cz> | 2015-10-08 20:59:26 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-10-08 20:59:26 +0200 |
commit | acdd758e56e28f22846e7d34d87f5533c8682574 (patch) | |
tree | d8fda0b554e99d6ace98a9300ecb5835b5bf50e0 /src/usart_baundrate_helper.h | |
parent | 0b534d81ac39eb5bbf2b9a0691519f6f7f0eaa13 (diff) | |
download | avr-ioe-acdd758e56e28f22846e7d34d87f5533c8682574.tar.gz avr-ioe-acdd758e56e28f22846e7d34d87f5533c8682574.tar.bz2 avr-ioe-acdd758e56e28f22846e7d34d87f5533c8682574.zip |
Add implementation of USART and more ground changes
Diffstat (limited to 'src/usart_baundrate_helper.h')
-rw-r--r-- | src/usart_baundrate_helper.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/usart_baundrate_helper.h b/src/usart_baundrate_helper.h new file mode 100644 index 0000000..0271bdd --- /dev/null +++ b/src/usart_baundrate_helper.h @@ -0,0 +1,12 @@ +#include <util/setbaud.h> +UBRR0H = UBRRH_VALUE; +UBRR0L = UBRRL_VALUE; +#if USE_2X +UCSR0A |= _BV(U2X0); +#else +UCSR0A &= ~_BV(U2X0); +#endif +#undef BAUD +#undef UBRRH_VALUE +#undef UBRRL_VALUE +#undef USE_2X |