avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] volatile in pgmspace.h ?


From: Marek Michalkiewicz
Subject: Re: [avr-libc-dev] volatile in pgmspace.h ?
Date: Tue, 17 Jun 2003 19:56:01 +0200
User-agent: Mutt/1.4i

On Tue, Jun 17, 2003 at 03:12:20PM +0000, E. Weddington wrote:
> Unfortunately, that would assume that the argument to the 
> macro would be a variable. If the argument is a constant, 
> it wouldn't work.

Yes.  The _next macros would only work with a variable as the
address, while the normal ones work with any expression.
I don't see any problem here - pgm_read_byte_next(address) would
work just like pgm_read_byte(address++), except that you get the
post-increment for free as part of the LPM instruction.  Both
kinds of macros (with and without post-increment) can be useful
at various times.  With the "ELPM" versions of the _next macros,
RAMPZ can be incremented too, so after the operation it should
be stored in the third byte of the address.

Marek





reply via email to

[Prev in Thread] Current Thread [Next in Thread]