[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-chat] Is this efficient?
From: |
Ruud Vlaming |
Subject: |
[avr-chat] Is this efficient? |
Date: |
Fri, 3 Oct 2008 18:27:36 +0200 |
User-agent: |
KMail/1.9.1 |
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] Is this efficient?,
Ruud Vlaming <=