diff --git a/KConfig b/KConfig deleted file mode 100644 index 506c20ff586832ec722425fb9dcc5de52845e271..0000000000000000000000000000000000000000 --- a/KConfig +++ /dev/null @@ -1,3 +0,0 @@ -source "$RTT_DIR/src/KConfig" -source "$RTT_DIR/libcpu/Kconfig" -source "$RTT_DIR/components/KConfig" diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..b32f7dafbe61da378fe27bc262e9cda6d69628da --- /dev/null +++ b/Kconfig @@ -0,0 +1,3 @@ +source "$RTT_DIR/src/Kconfig" +source "$RTT_DIR/libcpu/Kconfig" +source "$RTT_DIR/components/Kconfig" diff --git a/bsp/asm9260t/KConfig b/bsp/asm9260t/Kconfig similarity index 84% rename from bsp/asm9260t/KConfig rename to bsp/asm9260t/Kconfig index fbf953851472b44f954a5b00ea4acd7efacde63e..544cb4202faeca876a3932b0eeddbf9ac6407c29 100644 --- a/bsp/asm9260t/KConfig +++ b/bsp/asm9260t/Kconfig @@ -15,10 +15,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" - -menu "BSP_SPECIAL CONFIG" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config RT_USING_UART0 bool "Using RT_USING_UART0" @@ -37,9 +35,4 @@ config RT_USING_LED default y help led blink demo -endmenu - - - - - \ No newline at end of file + diff --git a/bsp/imx6ul/KConfig b/bsp/imx6ul/Kconfig similarity index 87% rename from bsp/imx6ul/KConfig rename to bsp/imx6ul/Kconfig index 1c54a2697470b7f28f089dc234b3a9155ff489be..68a1d983de3dbd3dc3b3ebbdbd4542c9844b56fd 100644 --- a/bsp/imx6ul/KConfig +++ b/bsp/imx6ul/Kconfig @@ -20,7 +20,7 @@ config BOARD_IMX6UL select ARCH_ARM_CORTEX_A7 default y -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" source "$BSP_DIR/drivers/Kconfig" diff --git a/bsp/imxrt1052-evk/KConfig b/bsp/imxrt1052-evk/Kconfig similarity index 80% rename from bsp/imxrt1052-evk/KConfig rename to bsp/imxrt1052-evk/Kconfig index a475aed0814af4d3971f1d7129ba4d7b884eefc0..f108d22bf90a38acfadcda9a0189146502e6cef2 100644 --- a/bsp/imxrt1052-evk/KConfig +++ b/bsp/imxrt1052-evk/Kconfig @@ -15,10 +15,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" - -menu "BSP_SPECIAL CONFIG" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config RT_USING_UART bool "Using RT_USING_UART" @@ -29,10 +27,4 @@ config RT_USING_UART1 bool "Using RT_USING_UART1" default y endif - -endmenu - - - - - \ No newline at end of file + diff --git a/bsp/lpc54608-LPCXpresso/Kconfig b/bsp/lpc54608-LPCXpresso/Kconfig index ac7e54d967780b1cfc623f43f448bfe872679fc7..86c8134c8bda43dfcb2f5bb1ca3cdd4e1b182e9f 100644 --- a/bsp/lpc54608-LPCXpresso/Kconfig +++ b/bsp/lpc54608-LPCXpresso/Kconfig @@ -18,8 +18,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config SOC_LPC54608 bool @@ -28,8 +28,3 @@ config SOC_LPC54608 source "$BSP_DIR/drivers/Kconfig" - - - - - \ No newline at end of file diff --git a/bsp/qemu-vexpress-a9/Kconfig b/bsp/qemu-vexpress-a9/Kconfig index 2e1b008775780bbdaf236611a2ff7dbd4dde61d0..a61626e3b63b8b1509a98e2a58c764905e32a0d2 100644 --- a/bsp/qemu-vexpress-a9/Kconfig +++ b/bsp/qemu-vexpress-a9/Kconfig @@ -15,6 +15,6 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" source "$BSP_DIR/drivers/Kconfig" diff --git a/bsp/stm32f10x-HAL/KConfig b/bsp/stm32f10x-HAL/Kconfig similarity index 98% rename from bsp/stm32f10x-HAL/KConfig rename to bsp/stm32f10x-HAL/Kconfig index 3ebeb013f0217b4eefaca78d035008db728581c3..28a348c4040d1a232f61cca0922db4b7222833a7 100644 --- a/bsp/stm32f10x-HAL/KConfig +++ b/bsp/stm32f10x-HAL/Kconfig @@ -15,8 +15,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" choice prompt "Device type" @@ -182,8 +182,3 @@ if RT_USING_SPI default n endif - - - - - \ No newline at end of file diff --git a/bsp/stm32f411-nucleo/KConfig b/bsp/stm32f411-nucleo/Kconfig similarity index 76% rename from bsp/stm32f411-nucleo/KConfig rename to bsp/stm32f411-nucleo/Kconfig index 5c7783d66e6d4594877f7bb0a1fddfc9216601b5..7a68666e8b6e7b20e9a3dc0f39968af061fc771b 100644 --- a/bsp/stm32f411-nucleo/KConfig +++ b/bsp/stm32f411-nucleo/Kconfig @@ -15,18 +15,10 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" - -menu "BSP_SPECIAL CONFIG" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config RT_USING_UART2 bool "Using RT_USING_UART2" default y - -endmenu - - - - \ No newline at end of file diff --git a/bsp/stm32f429-apollo/KConfig b/bsp/stm32f429-apollo/Kconfig similarity index 87% rename from bsp/stm32f429-apollo/KConfig rename to bsp/stm32f429-apollo/Kconfig index 5fbdd200628c5911ad5a0b032e3a53e5b9b91a17..43dcbee27f2b3f7e6b504d5d9f808f4b13cc052e 100644 --- a/bsp/stm32f429-apollo/KConfig +++ b/bsp/stm32f429-apollo/Kconfig @@ -20,7 +20,7 @@ config BOARD_STM32F429_APPOLO select ARCH_ARM_CORTEX_M4 default y -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" source "$BSP_DIR/drivers/Kconfig" diff --git a/bsp/stm32f429-disco/Kconfig b/bsp/stm32f429-disco/Kconfig index cf8e66ca349c3a6e2764dc65d5bda8aa7ec17be5..0f647d8cec93b122b5c429637f57c42f2e6573f7 100644 --- a/bsp/stm32f429-disco/Kconfig +++ b/bsp/stm32f429-disco/Kconfig @@ -18,14 +18,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" source "$BSP_DIR/drivers/Kconfig" - - - - - - \ No newline at end of file diff --git a/bsp/stm32f4xx-HAL/KConfig b/bsp/stm32f4xx-HAL/Kconfig similarity index 99% rename from bsp/stm32f4xx-HAL/KConfig rename to bsp/stm32f4xx-HAL/Kconfig index e4fea73c73507559a4a96a72c60b145795dc07da..638f56d2b493d9c00410a1709fc4ffb924304f00 100644 --- a/bsp/stm32f4xx-HAL/KConfig +++ b/bsp/stm32f4xx-HAL/Kconfig @@ -15,8 +15,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" choice @@ -339,4 +339,4 @@ endif - \ No newline at end of file + diff --git a/bsp/stm32l476-nucleo/Kconfig b/bsp/stm32l476-nucleo/Kconfig index a58fcdda753137bb5e6db97b25886d8b10401bfc..c09fa038b72d7613be8fcd894663293b09e6fbc7 100644 --- a/bsp/stm32l476-nucleo/Kconfig +++ b/bsp/stm32l476-nucleo/Kconfig @@ -18,6 +18,6 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" source "$BSP_DIR/drivers/Kconfig" diff --git a/bsp/tm4c129x/KConfig b/bsp/tm4c129x/Kconfig similarity index 76% rename from bsp/tm4c129x/KConfig rename to bsp/tm4c129x/Kconfig index fad849785c4748f7be4250fc91fdf136e8cc8fb2..e6e03d257d1a4d77d9b03660bdc94b6ed0aebfa5 100644 --- a/bsp/tm4c129x/KConfig +++ b/bsp/tm4c129x/Kconfig @@ -15,18 +15,10 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" - -menu "BSP_SPECIAL CONFIG" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config RT_USING_UART0 bool "Using RT_USING_UART0" default y - -endmenu - - - - - \ No newline at end of file + diff --git a/bsp/x1000/Kconfig b/bsp/x1000/Kconfig index a7a82890dfa3988ef73822f8db2e1ccff53d1770..adeb609f78ade07d429aa26cc03d73f05a3a7066 100644 --- a/bsp/x1000/Kconfig +++ b/bsp/x1000/Kconfig @@ -18,8 +18,8 @@ config $PKGS_DIR option env="PKGS_ROOT" default "packages" -source "$RTT_DIR/KConfig" -source "$PKGS_DIR/KConfig" +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" config BOARD_X1000_REALBOARD bool diff --git a/components/KConfig b/components/Kconfig similarity index 58% rename from components/KConfig rename to components/Kconfig index 957df871a4befe135e54a44caab3ed9ddb9d66bd..0a5e4e4e56b69fd118ed12e3d45de0e4b4964742 100644 --- a/components/KConfig +++ b/components/Kconfig @@ -10,17 +10,17 @@ if RT_USING_COMPONENTS_INIT default y endif -source "$RTT_DIR/components/cplusplus/KConfig" +source "$RTT_DIR/components/cplusplus/Kconfig" -source "$RTT_DIR/components/finsh/KConfig" +source "$RTT_DIR/components/finsh/Kconfig" -source "$RTT_DIR/components/dfs/KConfig" +source "$RTT_DIR/components/dfs/Kconfig" -source "$RTT_DIR/components/drivers/KConfig" +source "$RTT_DIR/components/drivers/Kconfig" -source "$RTT_DIR/components/libc/KConfig" +source "$RTT_DIR/components/libc/Kconfig" -source "$RTT_DIR/components/net/KConfig" +source "$RTT_DIR/components/net/Kconfig" source "$RTT_DIR/components/gui/Kconfig" diff --git a/components/cplusplus/KConfig b/components/cplusplus/Kconfig similarity index 100% rename from components/cplusplus/KConfig rename to components/cplusplus/Kconfig diff --git a/components/dfs/KConfig b/components/dfs/Kconfig similarity index 100% rename from components/dfs/KConfig rename to components/dfs/Kconfig diff --git a/components/drivers/KConfig b/components/drivers/Kconfig similarity index 100% rename from components/drivers/KConfig rename to components/drivers/Kconfig diff --git a/components/finsh/KConfig b/components/finsh/Kconfig similarity index 100% rename from components/finsh/KConfig rename to components/finsh/Kconfig diff --git a/components/libc/KConfig b/components/libc/Kconfig similarity index 100% rename from components/libc/KConfig rename to components/libc/Kconfig diff --git a/components/net/KConfig b/components/net/Kconfig similarity index 98% rename from components/net/KConfig rename to components/net/Kconfig index 6b8773503085eab8e13a5f772d280599b8fe032a..3220d5e7860965cc1c626ece49362a1503212cbc 100644 --- a/components/net/KConfig +++ b/components/net/Kconfig @@ -180,7 +180,7 @@ config RT_USING_LWIP endmenu -source "$RTT_DIR/components/net/freemodbus/KConfig" +source "$RTT_DIR/components/net/freemodbus/Kconfig" if RT_USING_LWIP config RT_USING_NETUTILS diff --git a/components/net/freemodbus/KConfig b/components/net/freemodbus/Kconfig similarity index 100% rename from components/net/freemodbus/KConfig rename to components/net/freemodbus/Kconfig diff --git a/include/rtdef.h b/include/rtdef.h index c7c0594ff443e990999b03bd943063215c0b6089..52cc60f55357e02a1ddb41909dff620db0d96546 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -30,7 +30,8 @@ * 2012-12-30 Bernard add more control command for graphic. * 2013-01-09 Bernard change version number. * 2015-02-01 Bernard change version number to v2.1.0 - * 2016-08-31 Bernard change version number to v3.0.0 + * 2017-08-31 Bernard change version number to v3.0.0 + * 2017-11-30 Bernard change version number to v3.0.1 */ #ifndef __RT_DEF_H__ @@ -52,7 +53,7 @@ extern "C" { /* RT-Thread version information */ #define RT_VERSION 3L /**< major version number */ #define RT_SUBVERSION 0L /**< minor version number */ -#define RT_REVISION 0L /**< revise version number */ +#define RT_REVISION 1L /**< revise version number */ /* RT-Thread version */ #define RTTHREAD_VERSION ((RT_VERSION * 10000) + \ diff --git a/src/KConfig b/src/Kconfig similarity index 100% rename from src/KConfig rename to src/Kconfig diff --git a/tools/building.py b/tools/building.py index 624245c202a2d41d1fb2984539ffa1bbe9a5f29c..79c013527b778294566ac79213b52c2cad54838a 100644 --- a/tools/building.py +++ b/tools/building.py @@ -274,6 +274,17 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ genconfig() exit(0) + if env['PLATFORM'] != 'win32': + AddOption('--menuconfig', + dest = 'menuconfig', + action = 'store_true', + default = False, + help = 'make menuconfig for RT-Thread BSP') + if GetOption('menuconfig'): + from menuconfig import menuconfig + menuconfig(Rtt_Root) + exit(0) + # add comstr option AddOption('--verbose', dest='verbose', diff --git a/tools/menuconfig.py b/tools/menuconfig.py index 9821f48ccbf178a4e1ae8af6341d1c86d13fb8e1..4ffcd9372fc4fd8a40aa1d32c5275b6dc3980949 100644 --- a/tools/menuconfig.py +++ b/tools/menuconfig.py @@ -29,23 +29,87 @@ def mk_rtconfig(filename): empty_line = 1 continue - rtconfig.write('/*%s */\n' % line[1:]) + comment_line = line[1:] + if line.startswith('# CONFIG_'): line = ' ' + line[9:] + else: line = line[1:] + + rtconfig.write('/*%s */\n' % line) empty_line = 0 else: empty_line = 0 - setting = line.split('=', 1) + setting = line.split('=') if len(setting) >= 2: if setting[0].startswith('CONFIG_'): setting[0] = setting[0][7:] + # remove CONFIG_PKG_XX_PATH or CONFIG_PKG_XX_VER + if type(setting[0]) == type('a') and (setting[0].endswith('_PATH') or setting[0].endswith('_VER')): + continue + if setting[1] == 'y': rtconfig.write('#define %s\n' % setting[0]) else: rtconfig.write('#define %s %s\n' % (setting[0], setting[1])) + if os.path.isfile('rtconfig_project.h'): + rtconfig.write('#include "rtconfig_project.h"\n') + + rtconfig.write('\n') rtconfig.write('#endif\n') rtconfig.close() def config(): mk_rtconfig('.config') +def get_env_dir(): + if os.environ.get('ENV_ROOT'): + return os.environ.get('ENV_ROOT') + + home_dir = os.environ['HOME'] + env_dir = os.path.join(home_dir, '.env') + + if not os.path.exists(env_dir): + return None + + return env_dir + +def touch_env(): + home_dir = os.environ['HOME'] + env_dir = os.path.join(home_dir, '.env') + if not os.path.exists(env_dir): + os.mkdir(env_dir) + os.mkdir(os.path.join(env_dir, 'local_pkgs')) + os.mkdir(os.path.join(env_dir, 'packages')) + kconfig = file(os.path.join(env_dir, 'packages', 'Kconfig'), 'w') + +# menuconfig for Linux +def menuconfig(RTT_ROOT): + kconfig_dir = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends') + os.system('scons -C ' + kconfig_dir) + + env_dir = get_env_dir() + if not env_dir: + touch_env() + env_dir = get_env_dir() + + os.environ['PKGS_ROOT'] = os.path.join(env_dir, 'packages') + + fn = '.config' + + if os.path.isfile(fn): + mtime = os.path.getmtime(fn) + else: + mtime = -1 + + kconfig_cmd = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends', 'kconfig-mconf') + os.system(kconfig_cmd + ' Kconfig') + + if os.path.isfile(fn): + mtime2 = os.path.getmtime(fn) + else: + mtime2 = -1 + + # make rtconfig.h + if mtime != mtime2: + mk_rtconfig(fn) + diff --git a/tools/mkdist.py b/tools/mkdist.py index 924e5608847c1af6bea8cd2756633d534d5bacc1..4a9f37035a119e008bee40d327cdc218aecb2e1d 100644 --- a/tools/mkdist.py +++ b/tools/mkdist.py @@ -121,7 +121,7 @@ def MakeCopy(program, BSP_ROOT, RTT_ROOT, Env): # copy tools directory print("=> tools") do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc')) - do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig')) + do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig')) do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS')) do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING')) do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md')) @@ -170,7 +170,7 @@ def MakeCopyHeader(program, BSP_ROOT, RTT_ROOT, Env): # copy tools directory print "=> tools" do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc')) - do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig')) + do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig')) do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS')) do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING')) do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md')) @@ -242,7 +242,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env): # copy tools directory print("=> tools") do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc')) - do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig')) + do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig')) do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS')) do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING')) do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md')) @@ -265,7 +265,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env): except : print('') - # change RTT_ROOT in KConfig + # change RTT_ROOT in Kconfig try: if os.path.exists(os.path.join(BSP_ROOT, 'Kconfig')): Kconfig = file(os.path.join(BSP_ROOT, 'Kconfig')) diff --git a/tools/wizard.py b/tools/wizard.py old mode 100755 new mode 100644