Skip to content

Commit 198c0d9

Browse files
authored
Merge pull request #3532 from qzhang1535/br_mini2440
Update bsp for mini2440
2 parents 4054c97 + 4b03562 commit 198c0d9

File tree

18 files changed

+1576
-1614
lines changed

18 files changed

+1576
-1614
lines changed

bsp/mini2440/.config

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ CONFIG_RT_USING_PIN=y
161161
# CONFIG_RT_USING_MTD_NAND is not set
162162
# CONFIG_RT_USING_PM is not set
163163
# CONFIG_RT_USING_RTC is not set
164-
# CONFIG_RT_USING_SDIO is not set
164+
CONFIG_RT_USING_SDIO=y
165+
CONFIG_RT_SDIO_STACK_SIZE=512
166+
CONFIG_RT_SDIO_THREAD_PRIORITY=15
167+
CONFIG_RT_MMCSD_STACK_SIZE=1024
168+
CONFIG_RT_MMCSD_THREAD_PREORITY=22
169+
CONFIG_RT_MMCSD_MAX_PARTITION=16
170+
# CONFIG_RT_SDIO_DEBUG is not set
165171
# CONFIG_RT_USING_SPI is not set
166172
# CONFIG_RT_USING_WDT is not set
167173
# CONFIG_RT_USING_AUDIO is not set

bsp/mini2440/Kconfig

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,33 @@ config PKGS_DIR
1616
default "packages"
1717

1818
config BOARD_MINI2440
19-
bool "mini2440"
19+
bool
2020
select ARCH_ARM_ARM9
2121
select RT_USING_COMPONENTS_INIT
2222
select RT_USING_USER_MAIN
2323
default y
2424

25+
choice
26+
prompt "Lcd for mini2440"
27+
default RT_MINI2440_LCD_T35
28+
depends on PKG_USING_GUIENGINE
29+
30+
config RT_MINI2440_LCD_A70
31+
bool "A70"
32+
33+
config RT_MINI2440_LCD_T43
34+
bool "T43"
35+
36+
config RT_MINI2440_LCD_N35
37+
bool "N35"
38+
39+
config RT_MINI2440_LCD_T35
40+
bool "T35"
41+
42+
config RT_MINI2440_LCD_X35
43+
bool "X35"
44+
endchoice
45+
2546
source "$RTT_DIR/Kconfig"
2647
source "$PKGS_DIR/Kconfig"
2748

bsp/mini2440/applications/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,25 @@
55

66
#include "led.h"
77

8+
#ifdef PKG_USING_GUIENGINE
9+
#include <rtgui/driver.h>
10+
#endif
11+
812
int main(void)
913
{
14+
rt_device_t device;
15+
1016
printf("hello rt-thread\n");
1117

18+
#ifdef PKG_USING_GUIENGINE
19+
device = rt_device_find("lcd");
20+
if (device)
21+
{
22+
rtgui_graphic_set_device(device);
23+
}
24+
#endif
25+
26+
1227
while (1)
1328
{
1429
/* light on leds for one second */

bsp/mini2440/applications/mnt.c

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,29 @@
66

77
int mnt_init(void)
88
{
9-
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
10-
{
11-
rt_kprintf("File System initialized!\n");
12-
}
13-
else
14-
{
15-
rt_kprintf("File System initialzation failed!\n");
16-
}
17-
18-
return RT_EOK;
9+
rt_uint32_t tryCnt = 5;
10+
rt_device_t dev;
11+
12+
while(tryCnt--)
13+
{
14+
dev = rt_device_find("sd0");
15+
if(dev != RT_NULL)
16+
{
17+
break;
18+
}
19+
rt_thread_mdelay(500);
20+
}
21+
22+
if(dfs_mount("sd0", "/", "elm", 0, 0) == 0)
23+
{
24+
rt_kprintf("File System initialized!\n");
25+
}
26+
else
27+
{
28+
rt_kprintf("File System initialzation failed!\n");
29+
}
30+
31+
return RT_EOK;
1932
}
2033
INIT_ENV_EXPORT(mnt_init);
2134
#endif

bsp/mini2440/drivers/SConscript

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@ cwd = os.path.join(str(Dir('#')), 'drivers')
88
src = Split("""
99
board.c
1010
led.c
11+
key.c
1112
uart.c
1213
""")
1314

14-
if GetDepend('RT_USING_DFS'):
15-
src += ['sdcard.c']
16-
1715
if GetDepend('RT_USING_LWIP'):
1816
src += ['dm9000.c']
1917

20-
if GetDepend('PKG_USING_GUIENGINE'):
21-
src += ['touch.c', 'key.c']
18+
if GetDepend('RT_MINI2440_LCD_A70'):
19+
src += ['lcd_a70.c']
20+
if GetDepend('RT_MINI2440_LCD_T43'):
21+
src += ['lcd_t43.c']
22+
if GetDepend('RT_MINI2440_LCD_N35'):
23+
src += ['lcd_n35.c']
24+
if GetDepend('RT_MINI2440_LCD_T35'):
25+
src += ['lcd_t35.c']
26+
if GetDepend('RT_MINI2440_LCD_X35'):
27+
src += ['lcd_x35.c']
2228

23-
if GetDepend('RT_USING_RTI'):
24-
src += ['rti_stub.c']
25-
2629
if GetDepend('PKG_USING_GUIENGINE'):
27-
if rtconfig.RT_USING_LCD_TYPE == 'PNL_A70':
28-
src += ['lcd_a70.c']
29-
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_N35':
30-
src += ['lcd_n35.c']
31-
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_T35':
32-
src += ['lcd_t35.c']
33-
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_X35':
34-
src += ['lcd_x35.c']
30+
src += ['touch.c']
31+
32+
if GetDepend('RT_USING_SDIO'):
33+
src += ['s3cmci.c']
34+
3535

3636
CPPPATH = [cwd]
3737

bsp/mini2440/drivers/lcd.h

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

0 commit comments

Comments
 (0)