Skip to content

Conversation

@SamAtBackbone
Copy link
Contributor

Description

Added methods to get, get_or_set, and set float values to the ESP NVS system.

Motivation and Context

I needed to store float values and NVS only supports int/uint value storage at this time.

How has this been tested?

Storing and retrieving float values. Used logs to show the storage and retrieval process, also confirmed behavior of firmware to match stored values.

Logs from storage:
image

Logs from retrieval after hardware reset:
image

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

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

@github-actions
Copy link

github-actions bot commented Dec 5, 2024

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-requested a review December 5, 2024 22:13
@finger563 finger563 added enhancement New feature or request nvs related to non-volatile storage labels Dec 5, 2024
@finger563 finger563 merged commit 70a230a into esp-cpp:main Dec 5, 2024
69 checks passed
SquaredPotato pushed a commit to smartknob-ha/espp that referenced this pull request Jan 27, 2025
* Create overloads to allow float values to be saved in NVS

* Remove test for  sizeof float = uint32

* Move implementation from nvs to nvs_handle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request nvs related to non-volatile storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants