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

Any intention to support an EEPROM 'fake' #40

Open
david284 opened this issue Feb 14, 2023 · 6 comments
Open

Any intention to support an EEPROM 'fake' #40

david284 opened this issue Feb 14, 2023 · 6 comments

Comments

@david284
Copy link

One of the libraries I'm using expects 'EEPROM.h'
Is there any intention to support a version of this in ArduinoFake?

@FabioBatSilva
Copy link
Owner

Hi,

I'm not planing on working on it,
But I think it should be supported.

But there are instructions here explaining how to make a PR adding support :
https://github.com/FabioBatSilva/ArduinoFake/blob/master/CONTRIBUTING.md

It will looks something like this:
https://github.com/FabioBatSilva/ArduinoFake/pull/26/files

@wraybowling
Copy link

Wow what a coincidence! I just dug up a project I abandoned 3 years ago and now remembering it was because I did not understand how to write a test for a file that uses <EEPROM.h>. I thought surely there's a way and have burned up a couple horus here still not finding a solution.

@FabioBatSilva when you say "i think it should be supported" do you mean that you think it already should work, or are you suggesting that we should try to add it ourselves?

@FabioBatSilva
Copy link
Owner

@wraybowling I mean something we should support.

Yes, something that you or someone else interested can contribute following the example/doc i linked.

@wrong-kendall
Copy link
Contributor

I started playing with making ArduinoFake support EEPROM but quickly realized that the biggest problem is going to be the use of templates. Since you can't use templates and virtual methods, there's really no way to support the ability to read and write arbitrary datatypes.

@david284 How does the library you're using interact with EEPROM.h?

@FabioBatSilva If you think it's worth it to have a partially supported EEPROM, I can send a PR for my limited functionality one. It would at least be a start in case someone wanted to add more functionality (like array access, which I didn't implement) but I kinda hate adding something that's "broken"

@david284
Copy link
Author

david284 commented May 18, 2023 via email

@wrong-kendall
Copy link
Contributor

Thanks, that's exactly what I was asking and that's the only functionality that my change implements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants