Skip to content

Commit b3c7bc9

Browse files
committed
更新mini2440 bsp包:
1、加入Kconfig以支持图形化菜单配置 2、编译脚本中添加动态模块编译参数 3、开启自动初始化机制支持 4、重构串口驱动以解决开启posix支持后终端无响应问题 5、解决dm9000网卡驱动link up问题 6、添加mnt.c文件用来挂载文件系统
1 parent 0f57faa commit b3c7bc9

File tree

21 files changed

+1063
-1223
lines changed

21 files changed

+1063
-1223
lines changed

bsp/mini2440/.config

Lines changed: 513 additions & 0 deletions
Large diffs are not rendered by default.

bsp/mini2440/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
mainmenu "RT-Thread Project Configuration"
2+
3+
config BSP_DIR
4+
string
5+
option env="BSP_ROOT"
6+
default "."
7+
8+
config RTT_DIR
9+
string
10+
option env="RTT_ROOT"
11+
default "../.."
12+
13+
config PKGS_DIR
14+
string
15+
option env="PKGS_ROOT"
16+
default "packages"
17+
18+
config BOARD_MINI2440
19+
bool "mini2440"
20+
select ARCH_ARM_ARM9
21+
select RT_USING_COMPONENTS_INIT
22+
select RT_USING_USER_MAIN
23+
default y
24+
25+
source "$RTT_DIR/Kconfig"
26+
source "$PKGS_DIR/Kconfig"
27+
28+

bsp/mini2440/SConstruct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Export('rtconfig')
2727
# prepare building environment
2828
objs = PrepareBuilding(env, RTT_ROOT)
2929

30-
if GetDepend('RT_USING_RTGUI'):
31-
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
30+
#if GetDepend('RT_USING_RTGUI'):
31+
# objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
3232

3333
# libc testsuite
3434
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)

bsp/mini2440/applications/application.c

Lines changed: 0 additions & 252 deletions
This file was deleted.

bsp/mini2440/applications/main.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <stdint.h>
2+
#include <stdio.h>
3+
#include <stdlib.h>
4+
#include <rtthread.h>
5+
6+
#include "led.h"
7+
8+
int main(void)
9+
{
10+
printf("hello rt-thread\n");
11+
12+
while (1)
13+
{
14+
/* light on leds for one second */
15+
rt_hw_led_on(LED2|LED3);
16+
rt_hw_led_off(LED1|LED4);
17+
rt_thread_delay(100);
18+
19+
/* light off leds for one second */
20+
rt_hw_led_off(LED2|LED3);
21+
rt_hw_led_on(LED1|LED4);
22+
rt_thread_delay(100);
23+
}
24+
25+
return 0;
26+
}
27+
28+

bsp/mini2440/applications/mnt.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <rtthread.h>
2+
3+
#ifdef RT_USING_DFS
4+
#include <dfs_fs.h>
5+
#include "dfs_ramfs.h"
6+
7+
int mnt_init(void)
8+
{
9+
10+
if(dfs_mount(RT_NULL, "/", "ram", 0, dfs_ramfs_create(rt_malloc(1024),1024)) == 0)
11+
{
12+
rt_kprintf("RAM file system initializated!\n");
13+
}
14+
else
15+
{
16+
rt_kprintf("RAM file system initializate failed!\n");
17+
}
18+
19+
return 0;
20+
}
21+
INIT_ENV_EXPORT(mnt_init);
22+
#endif
23+

0 commit comments

Comments
 (0)