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

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

Re: [avr-libc-dev] New eeprom library. Comments please


From: Dmitry K.
Subject: Re: [avr-libc-dev] New eeprom library. Comments please
Date: Sun, 24 Jul 2005 13:17:24 +1100
User-agent: KMail/1.5

On Friday 22 July 2005 18:38, Nigel Winterbottom wrote:
> The Attachment was missing (me being a buffoon). Now Added.
...

Thanks, the code is good optimized.
Notes:

   You use short commands (rcall/rjmp). Very well, but it is necessary to use 
subsections in this case (look, for example, libm or ctype.S).

   I am not assured of necessity to do functions atomic. In that case it is 
necessary to rewrite all Avr-libc.  But if to agree with such necessity your 
realization is unsafe, for example:

        .global Rd
Rd:
1:      sbic    _SFR_IO_ADDR(EECR), EEWE
        rjmp    1b                          ; Make sure EEPR is ready
<< Interrupt with writing to EEPROM>>
        in              __tmp_reg__, _SFR_IO_ADDR(SREG)
        cli
        ...
Here record of byte in EEPROM will be crashed.

Personally I use functions from Avr-libc in simple cases. In the same place, 
where the big volume of record is necessary, I use my own library based on 
interruptions.

Regards.





reply via email to

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