From acd0943ff8231d4a1eed03fb63751151f99232dc Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Wed, 24 Mar 2010 00:02:55 +0000 Subject: [PATCH] apply RT_LWIP_USING_RT_MEM options in setting; remove memp_ting.c to memp.c; fix some bugs in sdcard driver. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@529 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/sam7x/project.Uv2 | 18 ++++-------------- bsp/sam7x/rtconfig.h | 3 ++- bsp/sam7x/sd.c | 6 +++--- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/bsp/sam7x/project.Uv2 b/bsp/sam7x/project.Uv2 index 06978fc0f7..a85abceb86 100644 --- a/bsp/sam7x/project.Uv2 +++ b/bsp/sam7x/project.Uv2 @@ -88,24 +88,14 @@ File 5,1,<..\..\net\lwip\src\netif\loopif.c> File 5,1,<..\..\net\lwip\src\arch\sys_arch_init.c> File 5,1,<..\..\net\lwip\src\arch\sys_arch.c> File 5,1,<..\..\net\lwip\src\api\sockets.c> -File 5,1,<..\..\net\lwip\src\core\memp_tiny.c> +File 5,1, File 6,1,<..\..\filesystem\dfs\src\dfs_util.c> -File 6,1,<..\..\filesystem\dfs\src\dfs_cache.c> File 6,1,<..\..\filesystem\dfs\src\dfs_fs.c> File 6,1,<..\..\filesystem\dfs\src\dfs_init.c> File 6,1,<..\..\filesystem\dfs\src\dfs_raw.c> File 6,1,<..\..\filesystem\dfs\src\dfs_posix.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\base\plibc.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\base\efs.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\base\extract.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\base\partition.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\ui.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\dir.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\fat.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\file.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\fs.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\ls.c> -File 6,1,<..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\time.c> +File 6,1,<..\..\filesystem\dfs\filesystems\elmfat\ff.c> +File 6,1,<..\..\filesystem\dfs\filesystems\elmfat\dfs_elm.c> Options 1,0,0 // Target 'RT-Thread/AT91SAM7X' @@ -166,7 +156,7 @@ Options 1,0,0 // Target 'RT-Thread/AT91SAM7X' ADSCMISC () ADSCDEFN () ADSCUDEF () - ADSCINCD (.;..\..\include;..\..\libcpu\arm\AT91SAM7X;..\..\finsh;..\..\net\lwip\src\include;..\..\net\lwip\src;..\..\net\lwip\src\arch\include;..\..\net\lwip\src\include\ipv4;;..\..\filesystem\dfs;..\..\filesystem\dfs\include;..\..\filesystem\dfs\filesystems\efsl\src\include;..\..\filesystem\dfs\filesystems\efsl\src\base\include;..\..\filesystem\dfs\filesystems\efsl\src\fs\vfat\include) + ADSCINCD (.;..\..\include;..\..\libcpu\arm\AT91SAM7X;..\..\finsh;..\..\net\lwip\src\include;..\..\net\lwip\src;..\..\net\lwip\src\arch\include;..\..\net\lwip\src\include\ipv4;..\..\filesystem\dfs;..\..\filesystem\dfs\include) ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSAMISC () ADSADEFN () diff --git a/bsp/sam7x/rtconfig.h b/bsp/sam7x/rtconfig.h index 6a47581def..4e37ab0a2b 100644 --- a/bsp/sam7x/rtconfig.h +++ b/bsp/sam7x/rtconfig.h @@ -81,7 +81,8 @@ /* SECTION: lwip, a lighwight TCP/IP protocol stack */ /* Using lighweight TCP/IP protocol stack*/ -//#define RT_USING_LWIP +#define RT_USING_LWIP +#define RT_LWIP_USING_RT_MEM /* Trace LwIP protocol*/ /* #define RT_LWIP_DEBUG */ diff --git a/bsp/sam7x/sd.c b/bsp/sam7x/sd.c index da66b00c63..ad93243dcc 100644 --- a/bsp/sam7x/sd.c +++ b/bsp/sam7x/sd.c @@ -545,11 +545,11 @@ static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buf if (count) { - // rt_set_errno(-RT_ERROR); + rt_set_errno(-RT_ERROR); return 0; } - - return size / 512; + + return size; } static rt_err_t rt_sdcard_control(rt_device_t dev, rt_uint8_t cmd, void *args)