zhaoxingyu12 commented on PR #3371:
URL: https://github.com/apache/nuttx-apps/pull/3371#issuecomment-3793643599

   > @zhaoxingyu12 I'm not sure that changing MTD_CONFIG to MTD_CONFIG_NONE is 
a good name change. I noticed your idea was to rename MTD_CONFIG_FAIL_SAFE to 
MTD_CONFIG_NVS, but it will be strange see CFGDATA depending on MTD_CONFIG_NONE.
   > 
   > Could you please add more details in the git commit message about this 
change? It seems very strange
   
   now, CFGDATA depending on !MTD_CONFIG_NONE. (If either MTD_CONFIG or 
MTD_CONFIG_NVS is enabled, CFGDATA will be enabled.)
   
   Currently, the mtd_config implementations use a choice structure, where all 
implementations (such as MTD_CONFIG, MTD_CONFIG_NVS (Original name: 
MTD_CONFIG_FAIL_SAFE), and any future submodules) are defined as mutually 
exclusive options—only one can be selected at a time. 
   MTD_CONFIG: mtd_config.c
   MTD_CONFIG_NVS: mtd_config_nvs.c
   MTD_CONFIG_NONE: Disables all MTD config solutions.
   
   By introducing MTD_CONFIG_NONE as a "no implementation" option, other 
submodules only need to depend on MTD_CONFIG_NONE=n, ensuring that their 
features are enabled only when a specific implementation is chosen. This 
approach not only avoids multiple dependencies and configuration conflicts, but 
also provides a clearer and more unified way to integrate additional mtd_config 
submodules in the future.
   
   it relates to this pr https://github.com/apache/nuttx/pull/18120
   
   choice
   prompt "Select MTD config solution"
   default MTD_CONFIG_NONE
   
   config MTD_CONFIG
   bool "Enable Dev Config (MTD based) device"
   ---help---
   Provides a /dev/config device for saving / restoring application
   configuration data to a standard MTD device or partition.
   
   config MTD_CONFIG_NVS
   bool "NVS"
   ---help---
   NVS is a lightweight KV storage mechanism which supports classical
   on-chip NorFlash, it implements basic KV write, read, and delete
   functions, and supports power down protection.
   
   config MTD_CONFIG_NONE
   bool "None MTD config"
   
   endchoice


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to