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

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

Re: [avr-libc-dev] eeproms and interrupts


From: Bernard Fouché
Subject: Re: [avr-libc-dev] eeproms and interrupts
Date: Tue, 09 Aug 2005 15:59:50 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Joerg Wunsch wrote:

I'd even go so far to write it in the preamble that unless explicitly
stated, none of the library functions claims interrupt-safety.

Any opinions about that?

Well there are not re-entrant but interrupt safe, even for eeprom access since eeprom_write_* blocks
interrupts correctly.

I was not sure about eeprom read, and "brberie" comments and Atmel documentation confused me about that. Atmel writes, before eeprom read examples "The next code examples show assembly and C functions for reading the EEPROM. The examples assume that interrupts are controlled so that no interrupts will occur during execution of these functions." (Documentation of atmega64 2490J-AVR-03/05, page 23). So strictly reading that, one can think that even for eeprom read, it is mandatory to lock interrupts. However reading how to use EERE page 21, there is nothing about interrupts...

Now doing like you wrote, one should spend time specifying that a lot of functions are interrupt safe, when, in fact, only a small bunch are interrupt sensitive. Why not having something like: "All functions are interrupt safe but may not be re-entrant. The user is advised to read Atmel documentation about features directly related to hardware like eeprom or flash write for instance."

And then the 'user' would be confused like I was ;-) Unless eeprom reads really need interrupt protection!

 Bernard




reply via email to

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