cmaglie / FlashStorage

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

Is there a way to store a struct of struct array? #30

Open DavideNesi opened 5 years ago

DavideNesi commented 5 years ago

I need to store a struct made of an array of other struct, something like this:

typedef struct {
  boolean valid;
  char label[20];
  char name[20];
} A;

typedef struct {
  A arrayOfAs[50];
} B;

....

FlashStorage(flash_B_store, B);

Is there a way to do it using this library?

DavideNesi commented 5 years ago

using something like this:

typedef struct {
  boolean valid[50];
  char label[50][20];
  char name[50][20];
} B;

could actually be a work around...