Skip to content

Commit

Permalink
samples: matter: Fix defines conditions in persistent storage.
Browse files Browse the repository at this point in the history
We should use CONFIG_SETTINGS_NVS/KVS instead of CONFIG_NVS/KVS to
select proper code parts.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
  • Loading branch information
ArekBalysNordic committed Oct 22, 2024
1 parent d7c19ea commit 7f4fad1
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "persistent_storage_shell.h"

#ifdef CONFIG_NVS
#if defined(CONFIG_SETTINGS_NVS)
#include <zephyr/fs/nvs.h>
#elif CONFIG_ZMS
#elif defined(CONFIG_SETTINGS_ZMS)
#include <zephyr/fs/zms.h>
#endif
#include <zephyr/settings/settings.h>
Expand All @@ -18,9 +18,9 @@ using namespace Nrf;

namespace
{
#ifdef CONFIG_NVS
#if defined(CONFIG_SETTINGS_NVS)
nvs_fs *sStorage = nullptr;
#elif CONFIG_ZMS
#elif defined(CONFIG_SETTINGS_ZMS)
zms_fs *sStorage = nullptr;
#endif

Expand All @@ -32,9 +32,9 @@ struct SettingsParams {

int CalculateFreeSpace()
{
#ifdef CONFIG_NVS
#if defined(CONFIG_SETTINGS_NVS)
return nvs_calc_free_space(sStorage);
#elif CONFIG_ZMS
#elif defined(CONFIG_SETTINGS_ZMS)
return zms_calc_free_space(sStorage);
#endif
}
Expand Down Expand Up @@ -133,9 +133,9 @@ bool PersistentStorageShell::Init()
return false;
}

#ifdef CONFIG_NVS
#if defined(CONFIG_SETTINGS_NVS)
sStorage = reinterpret_cast<nvs_fs *>(storage);
#elif CONFIG_ZMS
#elif defined(CONFIG_SETTINGS_ZMS)
sStorage = reinterpret_cast<zms_fs *>(storage);
#endif

Expand Down

0 comments on commit 7f4fad1

Please sign in to comment.