Skip to content

Buffered read / writes for the EEPROM emulation #296

Closed
@hasenbanck

Description

@hasenbanck

Right now the EEPROM emulation inside the core (stm32_eeprom.c/h) provides two functions for reading and writing to an EEPROM emulated via flash (size of a page).

Both functions are touching the whole page in each function call, which is especially wasteful when writing to the flash.

To stay backward-compatible, I would propose to add four new functions to the core library:

void eeprom_buffer_fill();
void eeprom_buffer_flush();
uint8_t eeprom_buffered_read_byte(const uint16_t __p);
void eeprom_buffered_write_byte(uint16_t __p, uint8_t __value);

The developer would then to first fill the static, private buffer with the fill function, interact with it and when he wants to save the content of the buffer to flash, flush the buffer to flash.

Implementing these changes shouldn't take much effort, since all pieces are already in place. I would like to do the implementation.

Comments? Suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions