@@ -153,36 +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' )
170164
171- print ("<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." )
165+ print ("\n <menuconfig> 命令应当在某一特定 BSP 目录下执行,例如:\" rt-thread/bsp/stm32/stm32f091-st-nucleo\" " )
166+ print ("请确保当前目录为 BSP 根目录,并且该目录中有 Kconfig 文件。\n " )
174167
175- print ('\n config $RTT_DIR' )
176- print ('string' )
177- print ('option env="RTT_ROOT"' )
178- print ('default "../.."\n ' )
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." )
179171
180- if determine_support_chinese (env_root ):
181- print ('例如修改 default 这一项为 rt-thread 所在路径: default "F:/git_repositories/rt-thread"' )
182- print ('\n 下面的警告信息提示与找不到正确的 Kconfig 文件有关:' )
172+ if platform .system () == "Windows" :
173+ os .system ('chcp 437 > nul' )
183174
184- # if not args.menuconfig_easy:
185- # return
175+ return False
186176
187177 fn = '.config'
188178
@@ -224,10 +214,7 @@ def cmd(args):
224214 os .system ('kconfig-mconf Kconfig' )
225215
226216 os .chdir (beforepath )
227-
228- if determine_support_chinese (env_root ):
229- if platform .system () == "Windows" :
230- os .system ('chcp 65001 > nul' )
217+
231218 return
232219
233220 else :
@@ -247,10 +234,6 @@ def cmd(args):
247234 if mtime != mtime2 :
248235 mk_rtconfig (fn )
249236
250- if determine_support_chinese (env_root ):
251- if platform .system () == "Windows" :
252- os .system ('chcp 65001 > nul' )
253-
254237 if platform .system () == "Windows" :
255238 env_kconfig_path = os .path .join (env_root , 'tools\scripts\cmds' )
256239 fn = os .path .join (env_kconfig_path , '.config' )
0 commit comments