Skip to content

Commit 7b99a5f

Browse files
authored
Merge pull request #49 from SummerGGift/20180807
【添加】:最新功能到 develop 分支
2 parents 4b19fdd + 1506f62 commit 7b99a5f

File tree

3 files changed

+437
-235
lines changed

3 files changed

+437
-235
lines changed

cmds/cmd_menuconfig.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def mk_rtconfig(filename):
105105
rtconfig.close()
106106

107107

108-
def find_macro_in_condfig(filename, macro_name):
108+
def find_macro_in_config(filename, macro_name):
109109
try:
110110
config = file(filename)
111111
except:
@@ -134,7 +134,7 @@ def find_macro_in_condfig(filename, macro_name):
134134
else:
135135
line = line[1:]
136136

137-
#print line
137+
# print line
138138

139139
empty_line = 0
140140
else:
@@ -156,7 +156,7 @@ def cmd(args):
156156
dirname = os.path.split(os.path.split(currentdir)[0])[0]
157157
get_rtt_name = os.path.basename(dirname)
158158
os_version = platform.platform(True)[10:13]
159-
#print os.path.split(currentdir)[1]
159+
# print os.path.split(currentdir)[1]
160160
kconfig_win7_path = os.path.join(
161161
env_root, 'tools', 'bin', 'kconfig-mconf_win7.exe')
162162

@@ -175,7 +175,7 @@ def cmd(args):
175175
print (
176176
"using command 'set RTT_ROOT=your_rtthread_root_path' to set RTT_ROOT is ok too.\n")
177177
print ("you can ignore debug messages below.")
178-
#if not args.menuconfig_easy:
178+
# if not args.menuconfig_easy:
179179
# return
180180

181181
fn = '.config'
@@ -189,6 +189,8 @@ def cmd(args):
189189
print 'use', args.menuconfig_fn
190190
import shutil
191191
shutil.copy(args.menuconfig_fn, fn)
192+
elif args.menuconfig_g:
193+
mk_rtconfig(fn)
192194
elif args.menuconfig_silent:
193195
if float(os_version) >= 6.2:
194196
os.system('kconfig-mconf Kconfig -n')
@@ -237,24 +239,19 @@ def cmd(args):
237239
if not os.path.isfile(fn):
238240
return
239241

240-
print("\nTry the command <menuconfig -s/--setting> ")
241-
print(
242-
"\nEnable the auto update option,env will auto update the packages you select.")
243242

244-
if find_macro_in_condfig(fn, 'SYS_AUTO_UPDATE_PKGS'):
243+
if find_macro_in_config(fn, 'SYS_AUTO_UPDATE_PKGS'):
245244
os.system('pkgs --update')
246-
print "Auto update packages done"
247-
248-
print("Select the project type your bsp support and then env will create a new mdk/iar project.")
245+
print "==============================>The packages have been updated completely."
249246

250-
if find_macro_in_condfig(fn, 'SYS_CREATE_MDK_IAR_PROJECT'):
251-
if find_macro_in_condfig(fn, 'SYS_CREATE_MDK4'):
247+
if find_macro_in_config(fn, 'SYS_CREATE_MDK_IAR_PROJECT'):
248+
if find_macro_in_config(fn, 'SYS_CREATE_MDK4'):
252249
os.system('scons --target=mdk4 -s')
253250
print "Create mdk4 project done"
254-
elif find_macro_in_condfig(fn, 'SYS_CREATE_MDK5'):
251+
elif find_macro_in_config(fn, 'SYS_CREATE_MDK5'):
255252
os.system('scons --target=mdk5 -s')
256253
print "Create mdk5 project done"
257-
elif find_macro_in_condfig(fn, 'SYS_CREATE_IAR'):
254+
elif find_macro_in_config(fn, 'SYS_CREATE_IAR'):
258255
os.system('scons --target=iar -s')
259256
print "Create iar project done"
260257

@@ -266,6 +263,12 @@ def add_parser(sub):
266263
help='Using the user specified configuration file.',
267264
dest='menuconfig_fn')
268265

266+
parser.add_argument('--generate',
267+
help='generate rtconfig.h by .config.',
268+
action='store_true',
269+
default=False,
270+
dest='menuconfig_g')
271+
269272
parser.add_argument('--silent',
270273
help='Silent mode,don\'t display menuconfig window.',
271274
action='store_true',

0 commit comments

Comments
 (0)