Commit a5aad0d
authored
[RFC] Two helper functions to allow easier validation of NVRAM table by OEMs (#538)
In the event that an OEM is using the RTC NVRAM table for something more
complicated than a few flags, integrity validation becomes necessary.
The `storage()` API in the `Nvram` trait returns a mutable reference and
ensures we can't double borrow. Great for safety but makes it difficult
to get the values for validation (and potential erasure if invalid) and
then also deconstruct the NVRAM table, so that they can be passed off
the values to whichever service needs them, as that would constitute a
double borrow.
This PR introduces two helper functions which 1) dumps the current u32
values of the registers, rather than allowing for another handle to the
RTC peripheral. The OEM can then perform their validation logic and if
something is iffy, they can 2) erase the contents of the table through
the object that has the handle before splitting up the entries as the
OEM desires.
Related PRs:
OpenDevicePartnership/embedded-mcu#111 parent e049318 commit a5aad0d
File tree
4 files changed
+16
-6
lines changed- examples
- rt633
- rt685s-evk
- src
4 files changed
+16
-6
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
178 | 188 | | |
0 commit comments