This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 4aff454  sys/config: Make the maximum value length configurable
     new 8507a56  Merge pull request #2693 from vikrant-proxy/config-max-len
4aff454 is described below

commit 4aff4546646d118ff237f838c621867b24e919e5
Author: Vikrant More <vikr...@proxy.com>
AuthorDate: Thu Oct 7 16:40:29 2021 -0700

    sys/config: Make the maximum value length configurable
---
 sys/config/include/config/config.h | 3 ++-
 sys/config/syscfg.yml              | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/config/include/config/config.h 
b/sys/config/include/config/config.h
index 116f629..e492c5d 100644
--- a/sys/config/include/config/config.h
+++ b/sys/config/include/config/config.h
@@ -27,6 +27,7 @@
 #include <os/queue.h>
 #include <stdint.h>
 #include <stdbool.h>
+#include <syscfg/syscfg.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,7 +37,7 @@ extern "C" {
 
 #define CONF_MAX_DIR_DEPTH     8       /* max depth of config tree */
 #define CONF_MAX_NAME_LEN      (8 * CONF_MAX_DIR_DEPTH)
-#define CONF_MAX_VAL_LEN       256
+#define CONF_MAX_VAL_LEN       MYNEWT_VAL(CONFIG_MAX_VAL_LEN)
 #define CONF_NAME_SEPARATOR    "/"
 
 #define CONF_NMGR_OP           0
diff --git a/sys/config/syscfg.yml b/sys/config/syscfg.yml
index 471dcb6..b9994c0 100644
--- a/sys/config/syscfg.yml
+++ b/sys/config/syscfg.yml
@@ -89,6 +89,10 @@ syscfg.defs:
         description: >
             Config CLI commands read 1, write 2, read/write 3
         value: 3
+    CONFIG_MAX_VAL_LEN:
+        description: >
+            Max length of a value stored in the config FCB.
+        value: 256
 
 syscfg.defs.(CONFIG_FCB || CONFIG_FCB2):
     CONFIG_FCB_FLASH_AREA:

Reply via email to