Skip to content

Commit 998a86e

Browse files
committed
don't save hidden values
1 parent bc83c0a commit 998a86e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

components/usb/esp_tinyuf2/private_include/board_flash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#define CFG_UF2_INI_FILE_SIZE CONFIG_UF2_INI_FILE_SIZE
7575
extern char *_ini_file;
7676
extern char *_ini_file_dummy;
77+
#define NVS_HIDDEN_PLACEHOLDER "****"
7778

7879
//--------------------------------------------------------------------+
7980
// Basic API

components/usb/esp_tinyuf2/uf2/board_flash.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static void ini_gen_from_nvs(const char *part, const char *name)
233233
if ((result = nvs_get_str(nvs, info.key, str, &len)) == ESP_OK) {
234234
#ifdef CONFIG_UF2_INI_NVS_VALUE_HIDDEN
235235
if (check_value_if_hidden(info.key)) {
236-
ini_insert_pair(info.key, "****");
236+
ini_insert_pair(info.key, NVS_HIDDEN_PLACEHOLDER);
237237
} else
238238
#endif
239239
{
@@ -259,6 +259,10 @@ static void ini_gen_from_nvs(const char *part, const char *name)
259259
static int nvs_write_back(void* user, const char* section, const char* name,
260260
const char* value)
261261
{
262+
if (check_value_if_hidden(name) && strcmp(value, NVS_HIDDEN_PLACEHOLDER) == 0)
263+
{
264+
return 1;
265+
}
262266
nvs_handle_t nvs = (nvs_handle_t)user;
263267
PRINTFD("... [%s]", section);
264268
PRINTFD("... (%s=%s)", name, value);

0 commit comments

Comments
 (0)