[En-Nut-Discussion] Nut/OS for AT90CAN128 processor

Harald Kipp harald.kipp at egnite.de
Tue Feb 8 09:56:18 CET 2005


Hello Henrik,


>As most of these ifdefs deal with checking for the presence of the
>second UART, one could also check against UDR1 to check if a second UART
>is available for the device. Same issue with the ifdefs to compile the
>additional interrupts for the ATMEGA128. One could check for the
>presence of the SIG_... (e.g. SIG_EEPROM_READY) definition to compile
>them in instead of the MCU definition.

IMHO it's a good idea to check for UDR1 instead of __AVR_something__.
An alternative way I can think of is using include/arch/avr.h for

#ifdef __AVR_ATmega128__
#define __HAS_AVR_USART0__
#define __HAS_AVR_USART1__
...
#endif

and use __HAS_AVR_USART1__ instead of UDR1.

This would give additional control of what parts to include for
which chip without being completely dependant from the avr-libc
includes.

Remember, that someone else suggested this after Matthias added
the UNIX emulation.

Harald




More information about the En-Nut-Discussion mailing list