Merge pull request #4218 from ReneHerthel/atmega2560_uart_fix

Bugfix for the UART device of atmega2560
This commit is contained in:
Peter Kietzmann 2015-11-04 08:00:07 +01:00
commit d3558d26b2
2 changed files with 10 additions and 10 deletions

View File

@ -131,11 +131,11 @@ extern "C" {
* @name UART configuration * @name UART configuration
* @{ * @{
*/ */
#define UART_NUMOF (1U) #define UART_NUMOF (4U)
#define UART_0_EN 1 #define UART_0_EN 1
#define UART_1_EN 0 #define UART_1_EN 1
#define UART_2_EN 0 #define UART_2_EN 1
#define UART_3_EN 0 #define UART_3_EN 1
/* UART 0 registers */ /* UART 0 registers */
#define UART0_CTRL_STAT_A UCSR0A #define UART0_CTRL_STAT_A UCSR0A

View File

@ -198,7 +198,7 @@ ISR(USART0_RX_vect, ISR_BLOCK)
ISR(USART1_RX_vect, ISR_BLOCK) ISR(USART1_RX_vect, ISR_BLOCK)
{ {
__enter_isr(); __enter_isr();
config[UART_1].rx_cb(config[UART_1].arg, UART0_DATA_REGISTER); config[UART_1].rx_cb(config[UART_1].arg, UART1_DATA_REGISTER);
if (sched_context_switch_request) { if (sched_context_switch_request) {
thread_yield(); thread_yield();
@ -207,11 +207,11 @@ ISR(USART1_RX_vect, ISR_BLOCK)
} }
#endif /* UART_1_EN */ #endif /* UART_1_EN */
#if UART_1_EN #if UART_2_EN
ISR(USART2_RX_vect, ISR_BLOCK) ISR(USART2_RX_vect, ISR_BLOCK)
{ {
__enter_isr(); __enter_isr();
config[UART_2].rx_cb(config[UART_2].arg, UART0_DATA_REGISTER); config[UART_2].rx_cb(config[UART_2].arg, UART2_DATA_REGISTER);
if (sched_context_switch_request) { if (sched_context_switch_request) {
thread_yield(); thread_yield();
@ -220,11 +220,11 @@ ISR(USART2_RX_vect, ISR_BLOCK)
} }
#endif /* UART_2_EN */ #endif /* UART_2_EN */
#if UART_2_EN #if UART_3_EN
ISR(USART2_RX_vect, ISR_BLOCK) ISR(USART3_RX_vect, ISR_BLOCK)
{ {
__enter_isr(); __enter_isr();
config[UART_3].rx_cb(config[UART_3].arg, UART0_DATA_REGISTER); config[UART_3].rx_cb(config[UART_3].arg, UART3_DATA_REGISTER);
if (sched_context_switch_request) { if (sched_context_switch_request) {
thread_yield(); thread_yield();