EEPROM code bloat

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just switched to WinAVR 20080610 from 20071221 and I've discovered a significant increase in the code size for EEPROM read/write. In a nutshell:

a) eeprom_read_byte() and eeprom_write_byte() are now inlined (12 bytes per use instead of 4). You also get a stand-alone copy if you use word or block versions.

b) The word and block EEPROM functions have gone from 10 bytes to 42-56 bytes each. Instead of making simple calls to the byte version, they're now passed function pointers.

Anyone know why these changes were made? Any chance of getting back to the old compact way?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you prevent the bloat by writing your own EEPROM functioncs, or can you wrap the avr-libc provided routines in a single function so that you can still use normal function call?

- Jani

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the avr-libc CVS in the "NEWS" file:

Quote:
- EEPROM functions are rewriten. Now the base procedures (eeprom_read_byte
and eeprom_write_byte) are inline: they are evaluated at compile time
of user program. This gives a possibility to add support for new AVR
arhitectures very simply. Also this fixes Avr-libc bug #21410. New
functions for 32-bit words are added.