Skip to content

Commit 4a69949

Browse files
committed
ESP32/NVS: deprecate NVS functions that default to ?ATOMVM_NVS_NS
Let's explicitly mention the namespace, rather having a default one, so applications are encouraged using their own namespace, rather a kitchen sink one. Signed-off-by: Davide Bettio <[email protected]>
1 parent b36fbbe commit 4a69949

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libs/eavmlib/src/esp.erl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@
4646
get_mac/1
4747
]).
4848

49-
-deprecated([{nvs_set_binary, 2, next_version}, {nvs_set_binary, 3, next_version}]).
49+
-deprecated([
50+
{nvs_get_binary, 1, next_version},
51+
{nvs_erase_key, 1, next_version},
52+
{nvs_erase_all, 0, next_version},
53+
{nvs_set_binary, 2, next_version},
54+
{nvs_set_binary, 3, next_version}
55+
]).
5056

5157
-type esp_reset_reason() ::
5258
esp_rst_unknown
@@ -153,6 +159,7 @@ nvs_fetch_binary(Namespace, Key) when is_atom(Namespace) andalso is_atom(Key) ->
153159

154160
%%-----------------------------------------------------------------------------
155161
%% @doc Equivalent to nvs_get_binary(?ATOMVM_NVS_NS, Key).
162+
%% @deprecated Please do not use this function.
156163
%% @end
157164
%%-----------------------------------------------------------------------------
158165
-spec nvs_get_binary(Key :: atom()) -> binary() | undefined.
@@ -242,6 +249,7 @@ nvs_put_binary(Namespace, Key, Value) when
242249
%% @param Key NVS key
243250
%% @returns ok
244251
%% @doc Equivalent to nvs_erase_key(?ATOMVM_NVS_NS, Key).
252+
%% @deprecated Please do not use this function.
245253
%% @end
246254
%%-----------------------------------------------------------------------------
247255
-spec nvs_erase_key(Key :: atom()) -> ok.
@@ -262,6 +270,7 @@ nvs_erase_key(Namespace, Key) when is_atom(Namespace) andalso is_atom(Key) ->
262270

263271
%%-----------------------------------------------------------------------------
264272
%% @doc Equivalent to nvs_erase_all(?ATOMVM_NVS_NS).
273+
%% @deprecated Please do not use this function.
265274
%% @end
266275
%%-----------------------------------------------------------------------------
267276
-spec nvs_erase_all() -> ok.

0 commit comments

Comments
 (0)