As Karl Edler wrote:

> The reason why I wanted them unified was so that I could write one
> piece of UART code that would work with all avr micro-controllers.

Well, there are (unfortunately) more stumbling blocks along that road.
That starts with older devices naming their registers just UDR, UCSRA
etc. while newer AVRs always number them (UDR0, UCSR0A) even if there
is only one USART available.

So in the end, you won't get away without an abstraction layer, and
that abstraction layer could then include something like:

#ifndef USART0_RX_vect
#  ifdef USART_RXC_vect
     /* ATmega16/32 etc. */
#    define USART0_RX_vect USART_RXC_vect
#  elif defined(USART_RX_vect)
     /* ATmega165/169 etc. */
#    define USART0_RX_vect USART_RX_vect
#  else
#    error "you lose"
#  endif
#endif

etc. pp.

However, this is beyond the scope of what avr-libc wants to be.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to