[En-Nut-Discussion] Hardware Register Access Using Volatile Pointer

Harald Kipp harald.kipp at egnite.de
Tue Apr 26 09:45:16 CEST 2011


Hi Nathan,

On 4/26/2011 2:06 AM, Nathan Moore wrote:
>asm volatile ("" : : "r" (tmp_var) : ); // gcc thinks we used the value here

Looks good to me.


> Or you might be able to do something crazy like:
>
>       #define FAKE_USE( x )  \
...
>   --- not sure about that, though.

Yes, the bad thing is, that this solution is type depended. No big deal 
for I/O registers, where there aren't so many (basic) types.

Regards,

Harald



More information about the En-Nut-Discussion mailing list