cmaglie / FlashStorage

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

Erase function doesn't work #29

Open Oxygen54 opened 5 years ago

Oxygen54 commented 5 years ago

I tried to erase the content of flash but it doesn't work. Is this way to erase ? I use a Feather M0 Adalogger

#include <FlashStorage.h>

FlashStorage(MyFlash, uint8_t *);

void setup(){
    MyFlash.write((uint8_t *) 255); // Write something
    MyFlash.erase(1); // The erase function is unknown
}

void loop(){

}

In the FlashStorage.h file there is an erase function but when I call it in the program, it says that the Erase function doesn't exist...

Thanks!

Adminius commented 3 years ago

@Oxygen54 why are writing erase(1)? There no function available that can accept arguments... Try MyFlash.erase();