Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework eeprom emulation for buffered access #302

Closed
wants to merge 1 commit into from
Closed

Rework eeprom emulation for buffered access #302

wants to merge 1 commit into from

Conversation

hasenbanck
Copy link
Contributor

The current eeprom emulation didn't had any buffered access to the
data on the flash. Every access to a byte would trigger a whole
page read / write. For writes it would mean, that the whole page
would be erased. For backward compatibility we will keep
the current functions as they are, but will add functions
to fill/flush the buffer and read from it.

The buffer size is static and is one page in size.

This commit also cleans up old unused code comments and
documentation stubs. I also cleaned up the old references
to the original author / version / date, since we already
refactored this code quite well. The copyright notice of
course is still intact.

@fpistm If I reworked too much from the file, then I can of course pull back the RC and just change the affected parts, but I thought it would be best if I clean up the code while working on it anyhow.

Fixes: #296

The current eeprom emulation didn't had any buffered access to the
data on the flash. Every access to a byte would trigger a whole
page read / write. For writes it would mean, that the whole page
would be erased. For backward compability we will keep
the current functions as they are, but will add functions
to fill/flush the buffer and read from it.

The buffer size is static and is one page in size.

This commit also cleans up old unused code comments and
documentation stubs. I also cleaned up the old references
to the original author / version / date, since we already
refactored this code quite well. The copyright notice of
course is still intact.

Fixes: #296
@fpistm fpistm self-requested a review August 10, 2018 18:57
@fpistm fpistm added enhancement New feature or request New feature labels Aug 10, 2018
@fpistm
Copy link
Member

fpistm commented Aug 10, 2018

Thanks @hasenbanck
I will try to review it before my vacation.

@hasenbanck
Copy link
Contributor Author

@fpistm Are you back from your vacation? Could my work be merged sooner or later?

@fpistm
Copy link
Member

fpistm commented Sep 7, 2018

Hi @hasenbanck
Yes. I'm back.
I've started to review it .
My first feeling is that I preferred to split in 2 commits one for the clean and the second for effective implementation.

@fpistm
Copy link
Member

fpistm commented Sep 8, 2018

@hasenbanck
I've splitted your commits:
https://github.com/fpistm/Arduino_Core_STM32/tree/pr-302-review

I've reviewed the code and it looks fine.
I will made some tests next week.
Thanks

@fpistm
Copy link
Member

fpistm commented Sep 12, 2018

Maybe an example using the new api could be added.
Maybe updating EEPROM class to support this buffering could be added.
Example by adding private member to set buffering access on and add a way to flush

@hasenbanck
Copy link
Contributor Author

Were would you like to have an example for the C API? Maybe in the STM32Example repository?

We could of course rework the EEPROM class to support this buffering, but for now I would separate it from this pull request (or your branch of it).

@fpistm
Copy link
Member

fpistm commented Sep 12, 2018

Yes STM32Example is a good candidate.
OK for EEPROM Class, this is just an idea ;)

fpistm added a commit that referenced this pull request Sep 21, 2018
[#302 review]Rework eeprom emulation for buffered access
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed in #333

@fpistm
Copy link
Member

fpistm commented Sep 21, 2018

#333 merged

@fpistm fpistm closed this Sep 21, 2018
@hasenbanck hasenbanck deleted the buffered_eeprom branch October 1, 2018 09:03
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
[stm32duino#302 review]Rework eeprom emulation for buffered access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants