1 #ifndef CONFIG_DEFINITIONS_H
2 #define CONFIG_DEFINITIONS_H
58 /* USART configuration */
59 #ifdef BLUETOOTH_ENABLE
60 # ifdef __AVR_ATmega32U4__
61 # define SERIAL_UART_BAUD 9600
62 # define SERIAL_UART_DATA UDR1
63 # define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
64 # define SERIAL_UART_RXD_VECT USART1_RX_vect
65 # define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
66 # define SERIAL_UART_INIT() do { \
68 UBRR1L = SERIAL_UART_UBRR; \
70 UBRR1H = SERIAL_UART_UBRR >> 8; \
72 UCSR1B = _BV(TXEN1); \
74 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
78 # error "USART configuration is needed."