[En-Nut-Discussion] Preprocessor and Port Definitions

Cosmin Buhu lists at byteworks.ro
Fri Jan 21 10:41:01 CET 2005


----- Original Message -----
From: "Harald Kipp" <harald.kipp at egnite.de>
To: <en-nut-discussion at egnite.de>
Sent: Friday, January 21, 2005 11:25 AM
Subject: [En-Nut-Discussion] Preprocessor and Port Definitions


> Hi all,
>
> Some time ago the avr-libc maintainers changed port
> definitions from simple
>    #define PORTA 0x1B
> to
>    #define PORTA _SFR_IO8(0x1B)
> in order to support
>    PORTA = 0;
>
> IMHO this expression is highly non-portable compared to
>    outb(PORTA, 0);
> because on some platforms (Intel x86) ports are not
> memory mapped. However, to some extend I agree with them,
> that port access isn't generally portable. For Nut/OS
> I'd like to stick with outb(), which makes emulation
> much easier. But that's not the point.

<snip>

    Latest AVR libc, 1.2, removed all deprecated macros and functions:
sbi, cbi, inb, outb, inp, outp, inw, outw, BV, PRG_RDB, eeprom_rb,
eeprom_rw, eeprom_wb

Cosmin





More information about the En-Nut-Discussion mailing list