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

Storing a String or DateTime type in FRAM #25

Closed
pawisoon opened this issue May 12, 2020 · 1 comment
Closed

Storing a String or DateTime type in FRAM #25

pawisoon opened this issue May 12, 2020 · 1 comment

Comments

@pawisoon
Copy link

Hi!
Is it possible to store Strings or DateTime type(from Arduino RTClib) in FRAM?
Can someone share a code snippet that does that? I tried to edit "store anything" example, but adding a String type variable to a struct:
typedef struct MYDATA_t { bool data_0; float data_1; long data_2; int data_3; byte data_4; String log; };

Is causing compilation error:
FRAM_I2C_store_anything:38:14: error: use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()' MYDATA4I2C_t mydata; //data to be written in memory ^ /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino:33:15: note: 'MYDATA4I2C_t::MYDATA4I2C_t()' is implicitly deleted because the default definition would be ill-formed: typedef union MYDATA4I2C_t { ^ FRAM_I2C_store_anything:34:11: error: union member 'MYDATA4I2C_t::datastruct' with non-trivial 'MYDATA_t::MYDATA_t()' MYDATA_t datastruct; ^ FRAM_I2C_store_anything:39:14: error: use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()' MYDATA4I2C_t readdata; //data read from memory ^ /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino: In function 'void __static_initialization_and_destruction_0(int, int)': FRAM_I2C_store_anything:39:14: error: use of deleted function 'MYDATA4I2C_t::~MYDATA4I2C_t()' /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino:33:15: note: 'MYDATA4I2C_t::~MYDATA4I2C_t()' is implicitly deleted because the default definition would be ill-formed: typedef union MYDATA4I2C_t { ^ FRAM_I2C_store_anything:34:11: error: union member 'MYDATA4I2C_t::datastruct' with non-trivial 'MYDATA_t::~MYDATA_t()' MYDATA_t datastruct; ^ FRAM_I2C_store_anything:38:14: error: use of deleted function 'MYDATA4I2C_t::~MYDATA4I2C_t()' MYDATA4I2C_t mydata; //data to be written in memory ^ exit status 1 use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()'

@sosandroid
Copy link
Owner

Does the example work without modification ?

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

No branches or pull requests

2 participants