hai
i want to store a struct contains two elements . can i store it in flash using pstorage....? if so how can i do that.........?
or
can i store a two dimensional array instead of a one dimensional array...........?
thank you
hai
i want to store a struct contains two elements . can i store it in flash using pstorage....? if so how can i do that.........?
or
can i store a two dimensional array instead of a one dimensional array...........?
thank you
You should be able to do something like:
err_code = pstorage_store(&block_handle, (uint8_t*)&mystruct, sizeof(mystruct_t), 0);
APP_ERROR_CHECK(err_code);
err_code = pstorage_load((uint8_t*)&mystruct, &block_handle, sizeof(mystruct_t), 0);
APP_ERROR_CHECK(err_code);
You should be able to do something like:
err_code = pstorage_store(&block_handle, (uint8_t*)&mystruct, sizeof(mystruct_t), 0);
APP_ERROR_CHECK(err_code);
err_code = pstorage_load((uint8_t*)&mystruct, &block_handle, sizeof(mystruct_t), 0);
APP_ERROR_CHECK(err_code);
@Petter Myhre thank you . your replays are so helpful for me.
Great. If I answered your question please consider accept my answer by clicking the grey circle with a check mark next to it.
@Petter
what will be the value of mystruct_t
in sizeof(mystruct_t)
...............?
The value? I don't understand.
what is mystruct_t
means..........?
is it a struct or a pointer......?