Skip to content

Conversation

@bettio
Copy link
Collaborator

@bettio bettio commented Aug 13, 2023

Fixes nvs_get_binary/2 so it can work on devices with a completely erased NVS area.

namespace not found is quite common in a newly flash device, for consistency reasons it should be returned as undefined.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@bettio bettio changed the title ESP32/NVS: return namespace_not_found as undefined in get function ESP32/NVS: return namespace_not_found as undefined in get function Aug 13, 2023
namespace not found is quite common in a newly flash device, for
consistency reasons it should be returned as undefined.

Signed-off-by: Davide Bettio <davide@uninstall.it>
@bettio bettio force-pushed the handle-ns-not-found branch from b5ef080 to ae78b3b Compare August 13, 2023 10:17
Copy link
Collaborator

@fadushin fadushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit. We should really have tests for this API in the esp tests (assuming NVS can be tested in QEMU)

@bettio bettio merged commit 8f3b9f4 into atomvm:master Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants