bugfix: Change namespace variable to nvs_namespace (C++ compatibility)

Closes https://github.com/espressif/esp-idf/pull/11028
This commit is contained in:
Kampi
2023-03-20 19:41:43 +01:00
committed by Jakob Hasse
parent ef4b1b7704
commit e66a1755df

View File

@ -98,12 +98,12 @@ static void init_ulp_program(void)
static void update_pulse_count(void) static void update_pulse_count(void)
{ {
const char* namespace = "plusecnt"; const char* nvs_namespace = "plusecnt";
const char* count_key = "count"; const char* count_key = "count";
ESP_ERROR_CHECK( nvs_flash_init() ); ESP_ERROR_CHECK( nvs_flash_init() );
nvs_handle_t handle; nvs_handle_t handle;
ESP_ERROR_CHECK( nvs_open(namespace, NVS_READWRITE, &handle)); ESP_ERROR_CHECK( nvs_open(nvs_namespace, NVS_READWRITE, &handle));
uint32_t pulse_count = 0; uint32_t pulse_count = 0;
esp_err_t err = nvs_get_u32(handle, count_key, &pulse_count); esp_err_t err = nvs_get_u32(handle, count_key, &pulse_count);
assert(err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND); assert(err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND);