cmaglie / FlashStorage

A convenient way to store data into Flash memory on the ATSAMD21 and ATSAMD51 processor family
203 stars 69 forks source link

EEPROM Emulation #7

Closed cmaglie closed 7 years ago

cmaglie commented 7 years ago

(follow up from: https://github.com/arduino/ArduinoCore-samd/issues/145 and https://github.com/arduino/Arduino/issues/5470)

@tuxedo0801 I've slightly changed the example to simplify it and renamed the class from ZeroEEPROM to EEPROM (since there is no "real" EEPROM there should be no collisions).

I've also touched the license a bit, please let me know if it is ok, so I can merge and publish the new release.

cmaglie commented 7 years ago

Is it really a good idea to name the "Eeprom Emulation Instance" EEPROM? Wouldn't it make sense to name it differently to make the differen more visible than just have a different "include"?

If you try to compile a sketch made for, say, AVR it would fail becuase of the different include. Also, you must call commit() to actually perform a write into the "EEPROM". IMHO just these two mandatory changes are enough to alert the user that there is something different, changing also the EEPROM name, in this case, would add another burden without any benefit, so I'm for keeping EEPROM.

tuxedo0801 commented 7 years ago

Okay, convinced.

cmaglie commented 7 years ago

Ok, I've pushed some more commits, and the init() method is no more needed.

Let me know if you have other concerns.

tuxedo0801 commented 7 years ago

Not yet tested, but had a look at the code. I'm happy with it.