esp-cpp / espp

C++ components for ESP
https://esp-cpp.github.io/espp/
MIT License
28 stars 9 forks source link

Add NVS component, wrapping esp-idf nvs_handle.hpp #235

Closed SamAtBackbone closed 1 month ago

SamAtBackbone commented 1 month ago

Some convenience wrappers for reaching the NVS on ESP. Usable with any namespace and variable.

Description

Created an API including calls to:

with the ESP NVS system.

Created an example app to test and show the API.

Note that Namespace and Key must be <=15 characters because of the underlying system. This would previously cause a panic abort, so we're testing for string length in this API

Motivation and Context

Convenience wrappers of all the tests etc required to interface to the NVS

How has this been tested?

Running both my own app that uses this class, and the example app included.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Example app running and being reset via button:

image

If namespace or key is too long: image

Types of changes

Checklist:

github-actions[bot] commented 1 month ago

:white_check_mark:Static analysis result - no issues found! :white_check_mark: