-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Key Value Storage implementation for EFR32 platform. #4367
Conversation
Add a small module which connects pigweed logs to CHIP logging.
Adds support for C++14 KVS.
c11879e
to
92fb5c1
Compare
size_t offset_bytes) const | ||
{ | ||
assert(CHIP_KVS_AVAILABLE); | ||
auto status_and_size = mKvs.Get(key, std::span<std::byte>(reinterpret_cast<std::byte *>(value), value_size), offset_bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't std::span C++20 and std::byte C++17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are provided by pigweed.
|
||
pw::StatusWithSize Write(Address destination_flash_address, std::span<const std::byte> data) override | ||
{ | ||
return pw::StatusWithSize(MscStatusToPwStatus(MSC_WriteWord(reinterpret_cast<uint32_t *>(destination_flash_address), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reinterpret_cast
looks like undefined behavior. What if I pass in a span that's not 32 bit aligned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface is private and only available to the KVS object which is provided the alignment. I'll add some asserts though just in case.
Use the pigweed KVS to implement persitent storage on the EFR32 platform. Only gets included when the application defined the KVS macros.
0af75e6
to
983f045
Compare
Add an example app which tests the KVS api.
…p#4367) * Add pigweed logging backend for CHIP Add a small module which connects pigweed logs to CHIP logging. * Update pigweed repo Adds support for C++14 KVS. * Add KVS implementation for EFR32 platform Use the pigweed KVS to implement persitent storage on the EFR32 platform. Only gets included when the application defined the KVS macros. * Add persistent storage test/example Add an example app which tests the KVS api.
…p#4367) * Add pigweed logging backend for CHIP Add a small module which connects pigweed logs to CHIP logging. * Update pigweed repo Adds support for C++14 KVS. * Add KVS implementation for EFR32 platform Use the pigweed KVS to implement persitent storage on the EFR32 platform. Only gets included when the application defined the KVS macros. * Add persistent storage test/example Add an example app which tests the KVS api.
Problem
Add the implementation for the Key Value Storage API on the EFR32 Platform using the pigweed KVS.
Summary of Changes