avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] pgm_read_byte_far, RAMPZ


From: Torsten Mohr
Subject: [avr-gcc-list] pgm_read_byte_far, RAMPZ
Date: Sun, 26 Jun 2005 13:17:35 +0200
User-agent: KMail/1.8

Hi,

when i browsed through the sources for pgm_read_byte_far i saw that this
macro changes the content of RAMPZ, right?

It looks ok and necessary to me to do this.

But also, the operation does not seem to be atomic to me, it could be
interrupted at any time inbetween.

When this happens, maybe due to an interrupt, the interrupt function
could also use some macro that changes RAMPZ and then there's a
slight chance to mess up the result of that function.


Is this suspicion correct, or do i miss something here?


Does this mean i have to save RAMPZ in my interrupt functions?

Or do i put pgm_read_byte_far between cli()/sei() ?


I can understand that pgm_read_byte_far does not save RAMPZ itself
to give the user all choices to handle this by himself, but shouldn't there
at least be a hint in the documentation?


Best regards,
Torsten.




reply via email to

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