avrdudes / avr-libc

The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
https://avrdudes.github.io/avr-libc/
Other
257 stars 56 forks source link

[patch #6718] Optimize the EEPROM functions #761

Closed avrs-admin closed 2 years ago

avrs-admin commented 2 years ago

Fri 09 Jan 2009 05:05:52 AM CET

The EEPROM funtions are not the best yet:

This version does not contain inline: all functions are pure ones from library.  To obtain a set of different hardwares there is used the CCP substitution of function names.

Minor changes are:

Reading speed is high: there is no check of ready between bytes, no indirect calls, in case of Xmega the mapping into data space is used.

Space expense is small: for example, all the eeprom_read_word/dword/ block functions use the same code.  Also with small SRAM and/or small EEPROM chips the code for high address byte or for high counter byte is omited.

This project was started before the discussion of library per device. So it is not needed in any GCC or Binutils changes.

Note, there is no any manual work to sort the chips into any groups: all variants are compiled separatly.

At this moment the XMEGA is not tested.  More, it is not tryed to compile.

file #17230: avr-libc.tar.gz file #17865: head-20090404.diff.gz

This issue was migrated from https://savannah.nongnu.org/patch/?6718

avrs-admin commented 2 years ago

Dmitry Xmelkov Sun 05 Apr 2009 09:18:36 AM CEST

The patch is updated to the current HEAD.

To test with any real hardware:

  1. apply the head-20090404.diff to HEAD avr-libc copy
  2. build the library from scratch
  3. test with simulator
  4. test with a real AVR the 3 files from tests/simulate/avr/eeprom-*.c

To prepare eeprom-*.c for testing, add the success indication befor 'return 0' from main(). To indicate a bug, add the function, like: void exit (int i) { < On the RED LED > for (;;) ; }

Note, the section is stay default (.text) and the copyright notices are not present always.

(file #17865)

avrs-admin commented 2 years ago

Dmitry Xmelkov Sat 06 Jun 2009 03:22:18 AM CEST

The patch is applied to HEAD branch.