cmaglie / FlashStorage

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

Add files via upload #14

Closed EduardoG26 closed 7 years ago

EduardoG26 commented 7 years ago

commit is now save against being called in a loop. isValid will return false as long as a write or update has not yet been commited. uint16_t getFlashWritings() returns the number of real flash write accesses after reset.

cmaglie commented 7 years ago

I don't like this kind of "safety measure" because it doesn't make it safe at all: if you do a mistake in your loop, you will discover it only after running it and at that point the flash is gone...

Even with a real EEPROM you should not update data in a loop.