CompilerError UART-Interrupt solved (AVR)
Posted: Wed May 29, 2013 4:19 pm
Hi all,
there's a compiler error using 'RXINT0' in FC V5 AVR.
If you want to use this interrupt you have to build it with the custom option, the already inlcuded 'RXINT0' does not work because of the
wrong handler-code:
ISR(USART0_RX_vect)
{
FCM_ISR_UART();
}
The right code need to be:
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}
So you need to simply build your custom Interrupt:
Enable Code:
sei();
UCSR0B |= (1 << RXCIE0);
Handler Code:
//Handler code for [RXINT]
#ifndef MX_UART0_RX_HANDLER
#define MX_UART0_RX_HANDLER
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}
#else
#warning The <UART0 RX> interrupt has previously been enabled, so the macro <ISR_UART> may never get called.
#endif
Now assign it to the requird ISR (macro) and than it will work.
Maybe this hopefully will get fixed with the next update.
Have fun,
Niro
PS: this solution is related to my former post 'Problem with UART, porting V4 to V5' http://wwww.matrixmultimedia.com/mmforu ... 46&t=12170
there's a compiler error using 'RXINT0' in FC V5 AVR.
If you want to use this interrupt you have to build it with the custom option, the already inlcuded 'RXINT0' does not work because of the
wrong handler-code:
ISR(USART0_RX_vect)
{
FCM_ISR_UART();
}
The right code need to be:
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}
So you need to simply build your custom Interrupt:
Enable Code:
sei();
UCSR0B |= (1 << RXCIE0);
Handler Code:
//Handler code for [RXINT]
#ifndef MX_UART0_RX_HANDLER
#define MX_UART0_RX_HANDLER
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}
#else
#warning The <UART0 RX> interrupt has previously been enabled, so the macro <ISR_UART> may never get called.
#endif
Now assign it to the requird ISR (macro) and than it will work.
Maybe this hopefully will get fixed with the next update.
Have fun,
Niro
PS: this solution is related to my former post 'Problem with UART, porting V4 to V5' http://wwww.matrixmultimedia.com/mmforu ... 46&t=12170