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 <[email protected]>
  • Loading branch information
ArekBalysNordic authored and rlubos committed Oct 23, 2024
1 parent 222f581 commit 39388a9
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"

#if defined(CONFIG_NVS)
#if defined(CONFIG_SETTINGS_NVS)
#include <zephyr/fs/nvs.h>
#elif defined(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
{
#if defined(CONFIG_NVS)
#if defined(CONFIG_SETTINGS_NVS)
nvs_fs *sStorage = nullptr;
#elif defined(CONFIG_ZMS)
#elif defined(CONFIG_SETTINGS_ZMS)
zms_fs *sStorage = nullptr;
#endif

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

int CalculateFreeSpace()
{
#if defined(CONFIG_NVS)
#if defined(CONFIG_SETTINGS_NVS)
return nvs_calc_free_space(sStorage);
#elif defined(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;
}

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

Expand Down

0 comments on commit 39388a9

Please sign in to comment.