[En-Nut-Discussion] Preprocessor and Port Definitions

Harald Kipp harald.kipp at egnite.de
Mon Jan 24 16:08:55 CET 2005


Hi Alexander,

> > The alternatives I can think of are
> >
> > 1. Let the configurator define AVRPORTA instead of PORTA
> >    #if RTL_RESET_AVRPORT == AVRPORTA
> >    #define RTL_RESET_PORT PORTA
> >    #define RTL_RESET_DDR DDRA
> >
> > 2. Using our own avr/io.h with the traditional definitions.
> > This would force programmers to use
> >    outb(PORT, val);
> > instead of
> >    PORT = val;
> >
> > I vote for version 1. Is there another way I missed?
> >
> > Harald
> >
>Well, does the version 1 mean that I will have to revise my program and
>replace the all the deprecated sbi-s and outb-s commands with the new ones?
>If yes, and if I am doomed to do it, maybe it's better to join avr-libc
>solution?
>Alexander

Not at all. In your application you can use whatever
you prefer. In its latest releases avr-libc removed
sbi-s and outb-s, but they are still available in
Nut/OS and will be available in the future. I'd
recommend to stick with outb() etc.

The Nut/OS libs however will (should!) exclusively
use outb() etc. and avoid any direct i/o register
assignment.

Harald




More information about the En-Nut-Discussion mailing list