瀏覽代碼

cmake: Hide serial port settings in menuconfig when using cmake

Angus Gratton 7 年之前
父節點
當前提交
2f4079ebb2
共有 4 個文件被更改,包括 11 次插入1 次删除
  1. 3 0
      Kconfig
  2. 4 0
      components/esptool_py/Kconfig.projbuild
  3. 1 0
      make/project_config.mk
  4. 3 1
      tools/cmake/kconfig.cmake

+ 3 - 0
Kconfig

@@ -4,6 +4,9 @@
 #
 mainmenu "Espressif IoT Development Framework Configuration"
 
+config IDF_CMAKE
+    bool
+    option env="IDF_CMAKE"
 
 menu "SDK tool configuration"
 config TOOLPREFIX

+ 4 - 0
components/esptool_py/Kconfig.projbuild

@@ -2,6 +2,7 @@ menu "Serial flasher config"
 
 config ESPTOOLPY_PORT
 	string "Default serial port"
+    depends on !IDF_CMAKE
 	default "/dev/ttyUSB0"
 	help
         The serial port that's connected to the ESP chip. This can be overridden by setting the ESPPORT
@@ -11,6 +12,7 @@ config ESPTOOLPY_PORT
 
 choice ESPTOOLPY_BAUD
     prompt "Default baud rate"
+    depends on !IDF_CMAKE
     default ESPTOOLPY_BAUD_115200B
     help
         Default baud rate to use while communicating with the ESP chip. Can be overridden by
@@ -36,6 +38,7 @@ config ESPTOOLPY_BAUD_OTHER_VAL
 
 config ESPTOOLPY_BAUD
 	int
+    depends on !IDF_CMAKE
 	default 115200 if ESPTOOLPY_BAUD_115200B
 	default 230400 if ESPTOOLPY_BAUD_230400B
 	default 921600 if ESPTOOLPY_BAUD_921600B
@@ -44,6 +47,7 @@ config ESPTOOLPY_BAUD
 
 config ESPTOOLPY_COMPRESSED
 	bool "Use compressed upload"
+    depends on !IDF_CMAKE
 	default "y"
 	help
 		The flasher tool can send data compressed using zlib, letting the ROM on the ESP chip

+ 1 - 0
make/project_config.mk

@@ -43,6 +43,7 @@ define RunConf
 	cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \
 	COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \
 	COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \
+	IDF_CMAKE=n \
 	$(KCONFIG_TOOL_DIR)/$1 $(IDF_PATH)/Kconfig
 endef
 

+ 3 - 1
tools/cmake/kconfig.cmake

@@ -83,7 +83,8 @@ function(kconfig_process_config)
         ${defaults_arg}
         --create-config-if-missing
         --env "COMPONENT_KCONFIGS=${kconfigs}"
-        --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}")
+        --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}"
+        --env "IDF_CMAKE=y")
 
     # Generate the menuconfig target (uses C-based mconf tool, either prebuilt or via mconf target above)
     add_custom_target(menuconfig
@@ -93,6 +94,7 @@ function(kconfig_process_config)
         COMMAND ${CMAKE_COMMAND} -E env
         "COMPONENT_KCONFIGS=${kconfigs}"
         "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}"
+        "IDF_CMAKE=y"
         "KCONFIG_CONFIG=${SDKCONFIG}"
         ${MCONF} ${ROOT_KCONFIG}
         VERBATIM