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

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

Re: [avr-libc-dev] [EEPROM] patch take 2: Fix mis-feature of lacking EEP


From: Dmitry K.
Subject: Re: [avr-libc-dev] [EEPROM] patch take 2: Fix mis-feature of lacking EEPROM support for many targets / rewrite of eeprom functions
Date: Sun, 31 Jul 2005 15:34:04 +1100
User-agent: KMail/1.5

Hi, Björn and all.

Many thanks!

Notes about 'eeprom_patch_take2.patch':

   1. eeprom_read_block: operands sequence is changed.

   2. function definitions: 'static inline' must before type of return
value.  Compiler give warnings.

   3. My opinion is debatable.
You are right, that, as a rule, the size of the block less than 256 and is a 
constant. But it is often, the wrapper functions are used. It interferes with 
the compiler to define the size of the block and it inserts into the program 
a cycle.  For example, avr-gcc 4.0.0 with '-Os' insert:

        mov r27,r23
        mov r26,r22
        mov r31,r25
        mov r30,r24
        ldi r18,lo8(0)
        ldi r19,hi8(0)
        rjmp .L2
.L3:
/* #APP */
        rcall __eeprom_read_byte_1C1D1E
        mov r24,__tmp_reg__
/* #NOAPP */
        st Z+,r24
        subi r18,lo8(-(1))
        sbci r19,hi8(-(1))
.L2:
        cp r18,r20
        cpc r19,r21
        brne .L3

Other approach - to transfer all actions to library functions. I shall try to 
compare these two variants.

Dmitry.





reply via email to

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