@@ -153,31 +153,26 @@ def find_macro_in_config(filename, macro_name):
153153
154154def cmd (args ):
155155
156- from cmd_package import determine_support_chinese
157156 env_root = Import ('env_root' )
158- currentdir = os .getcwd ()
159- dirname = os .path .split (os .path .split (currentdir )[0 ])[0 ]
160- get_rtt_name = os .path .basename (dirname )
161157 os_version = platform .platform (True )[10 :13 ]
162158 kconfig_win7_path = os .path .join (
163159 env_root , 'tools' , 'bin' , 'kconfig-mconf_win7.exe' )
164160
165- if not os .getenv ("RTT_ROOT" ):
166- if get_rtt_name != 'rt-thread' :
167- if determine_support_chinese (env_root ):
168- print ("\n <menuconfig> 命令应当在某一特定 BSP 目录下执行,例如:\" rt-thread/bsp/stm32/stm32f091-st-nucleo\" " )
169- print ("请确保当前目录为 BSP 根目录,并且该目录中有 Kconfig 文件。\n " )
161+ if not os .path .exists ('Kconfig' ):
162+ if platform .system () == "Windows" :
163+ os .system ('chcp 65001 > nul' )
164+
165+ print ("\n <menuconfig> 命令应当在某一特定 BSP 目录下执行,例如:\" rt-thread/bsp/stm32/stm32f091-st-nucleo\" " )
166+ print ("请确保当前目录为 BSP 根目录,并且该目录中有 Kconfig 文件。\n " )
170167
171- print ("\n <menuconfig> command should be used in a bsp root path with a Kconfig file." )
172- print ("Example: \" rt-thread/bsp/stm32/stm32f091-st-nucleo\" " )
173- print ("You should check if there is a Kconfig file in your bsp root first." )
168+ print ("<menuconfig> command should be used in a bsp root path with a Kconfig file." )
169+ print ("Example: \" rt-thread/bsp/stm32/stm32f091-st-nucleo\" " )
170+ print ("You should check if there is a Kconfig file in your bsp root first." )
174171
175- if determine_support_chinese (env_root ):
176- print ('例如修改 default 这一项为 rt-thread 所在路径: default "F:/git_repositories/rt-thread"' )
177- print ('\n 下面的警告信息提示与找不到正确的 Kconfig 文件有关:' )
172+ if platform .system () == "Windows" :
173+ os .system ('chcp 437 > nul' )
178174
179- # if not args.menuconfig_easy:
180- # return
175+ return False
181176
182177 fn = '.config'
183178
@@ -219,10 +214,7 @@ def cmd(args):
219214 os .system ('kconfig-mconf Kconfig' )
220215
221216 os .chdir (beforepath )
222-
223- if determine_support_chinese (env_root ):
224- if platform .system () == "Windows" :
225- os .system ('chcp 65001 > nul' )
217+
226218 return
227219
228220 else :
@@ -242,10 +234,6 @@ def cmd(args):
242234 if mtime != mtime2 :
243235 mk_rtconfig (fn )
244236
245- if determine_support_chinese (env_root ):
246- if platform .system () == "Windows" :
247- os .system ('chcp 65001 > nul' )
248-
249237 if platform .system () == "Windows" :
250238 env_kconfig_path = os .path .join (env_root , 'tools\scripts\cmds' )
251239 fn = os .path .join (env_kconfig_path , '.config' )
0 commit comments