Skip to content

Commit

Permalink
add config
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyLadanov committed May 24, 2024
1 parent 6f50aca commit 8f308eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Components/NVS_Lib/Inc/NVS_Cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdio>
#include "NVS_IFlash.hpp"
#include <cstring>
#include "NVS_Config.h"



Expand All @@ -16,7 +17,7 @@ class NVS_Cell
static constexpr uint32_t STATE_RELEASED = 0x00000000;

static constexpr uint32_t TAG_START = 0x35353535;
static constexpr size_t MAX_BINARY_CELL_NUMBER = 2;
static constexpr size_t MAX_BINARY_CELL_NUMBER = NVS_CONF_MAXBINARYCELLS_COUNT;



Expand All @@ -43,7 +44,7 @@ class NVS_Cell
struct Header_t
{
uint32_t StartTag;
char Key[14];
char Key[NVS_CONF_KEY_SIZE];
uint8_t BlockCount;
uint8_t Type;
union __Value
Expand Down
12 changes: 12 additions & 0 deletions Components/NVS_Lib/Inc/NVS_Config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef __NVS_CONFIG_H__
#define __NVS_CONFIG_H__


#define NVS_CONF_DEBUG 1

#define NVS_CONF_MAXBINARYCELLS_COUNT 2

#define NVS_CONF_KEY_SIZE 14


#endif /* __NVS_CONFIG_H__ */
4 changes: 2 additions & 2 deletions Components/NVS_Lib/Inc/NVS_Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ extern "C"
#endif

#include "stdio.h"
#include "NVS_Config.h"

#define NVS_DEBUG 1

#if NVS_DEBUG != 0
#if NVS_CONF_DEBUG != 0
#define NVS_LOG(...) printf(__VA_ARGS__)
#else
#define NVS_LOG(TEXT, ...)
Expand Down

0 comments on commit 8f308eb

Please sign in to comment.