To find out if a register is in the io space in .c files,
i use the following, ugly, construct:
#undef _SFR_IO8
#define _SFR_IO8(arg) (arg)
#if (TIMSK < 0x40)
blah blah
#else
bloh bloh
#endif
#undef _SFR_IO8
#define _SFR_IO8(arg) (*(volatile uint8_t *)((arg) + 0x20))
I cannot test it with _SFR_IO_REG_P, although that macro seems to be
meant for the purpose:
#if _SFR_IO_REG_P(TIMSK)
for that gives the error:
error: operator '*' has no left operand
Somewhere i am missing the point i guess.
Who knows the proper way to do such things?
Ruud
_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat