From 76218a079dfaccb37e57298d333f218442101113 Mon Sep 17 00:00:00 2001 From: "goprife@gmail.com" Date: Sun, 21 Oct 2012 05:55:36 +0000 Subject: [PATCH] clean code under bsp/simulator git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2362 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/simulator/application.c | 8 --- bsp/simulator/serial.c | 7 +- bsp/simulator/sst25vfxx_mtd_sim.c | 5 +- bsp/simulator/testfs.c | 107 ------------------------------ bsp/simulator/vs2005.vcproj | 4 -- 5 files changed, 4 insertions(+), 127 deletions(-) delete mode 100644 bsp/simulator/testfs.c diff --git a/bsp/simulator/application.c b/bsp/simulator/application.c index 2125b3a37e..860f7933af 100644 --- a/bsp/simulator/application.c +++ b/bsp/simulator/application.c @@ -107,12 +107,4 @@ int rt_application_init() return 0; } - -extern int rt_application_init(void); -#if 1 -FINSH_FUNCTION_EXPORT(rt_application_init, app init) -void testfun() -{} -FINSH_FUNCTION_EXPORT(testfun, test fun) -#endif /*@}*/ diff --git a/bsp/simulator/serial.c b/bsp/simulator/serial.c index b5e9cb01a6..0777bff928 100644 --- a/bsp/simulator/serial.c +++ b/bsp/simulator/serial.c @@ -7,7 +7,6 @@ */ #include "rtthread.h" -//#ifdef RT_USING_SERIAL #define _DEBUG_SERIAL 0 #include "serial.h" @@ -57,7 +56,6 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt rt_uint8_t* ptr; rt_err_t err_code; -#if 1 ptr = buffer; err_code = RT_EOK; @@ -101,9 +99,8 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt /* set error code */ rt_set_errno(err_code); return (rt_uint32_t)ptr - (rt_uint32_t)buffer; -#endif - } + static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { #if _DEBUG_SERIAL==1 @@ -161,4 +158,4 @@ rt_err_t rt_hw_serial_init(void) return rt_hw_serial_register(&serial_device,"sci0", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM); } -//#endif + diff --git a/bsp/simulator/sst25vfxx_mtd_sim.c b/bsp/simulator/sst25vfxx_mtd_sim.c index d799a98040..d2c4117302 100644 --- a/bsp/simulator/sst25vfxx_mtd_sim.c +++ b/bsp/simulator/sst25vfxx_mtd_sim.c @@ -1,7 +1,7 @@ /* * File : rtdef.h * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team + * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -9,8 +9,7 @@ * * Change Logs: * Date Author Notes - * 2011-12-16 aozima the first version - * 2012-02-01 mbbill MTD device version + * 2012-10-21 prife the first version */ #include diff --git a/bsp/simulator/testfs.c b/bsp/simulator/testfs.c deleted file mode 100644 index 109a948836..0000000000 --- a/bsp/simulator/testfs.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * File : application.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2009-01-05 Bernard the first version - */ - -#include -#include -#include - -#ifdef RT_USING_DFS -/* dfs init */ -#include -/* dfs filesystem:ELM filesystem init */ -#include -/* dfs Filesystem APIs */ -#include -#endif - -#include - -int testfat(void) -{ - int Fd,i; - int res; - - Fd = open("/nor/test.txt", O_WRONLY | O_CREAT | O_TRUNC, 0); //打开文件 - if (Fd>=0) - { - rt_kprintf("begin\n"); - for (i = 0; i < 94520 ; i++) - //for (i = 0; i < 512 ; i++) - { - res = write(Fd, &i, 1); - if (res < 0) - { - rt_kprintf("write %d bytes, then meet a error, break\n", i); - break; - } - } - close(Fd); - rt_kprintf("over\n"); - } - else - { - rt_kprintf("failed\n"); - } - return 0; -} - -static char buf[94520]; -int testfat2(void) -{ - int Fd,i; - - Fd = open("/nor/test2.txt", O_WRONLY | O_CREAT | O_TRUNC, 0); //打开文件 - if (Fd>=0) - { - rt_kprintf("begin\n"); - for (i = 0; i < 94520 ; i++) - { - write(Fd, buf, 1); - } - close(Fd); - rt_kprintf("over\n"); - } - else - { - rt_kprintf("failed\n"); - } - return 0; -} - - -int testfat3(void) -{ - int Fd,i; - - Fd = open("/nor/test3.txt", O_WRONLY | O_CREAT | O_TRUNC, 0); //打开文件 - if (Fd>=0) - { - rt_kprintf("begin\n"); - { - write(Fd, buf, 94520); - } - close(Fd); - rt_kprintf("over\n"); - } - else - { - rt_kprintf("failed\n"); - } - return 0; -} - -#include -FINSH_FUNCTION_EXPORT(testfat, test fs); -FINSH_FUNCTION_EXPORT(testfat2, test fs); -FINSH_FUNCTION_EXPORT(testfat3, test fs); \ No newline at end of file diff --git a/bsp/simulator/vs2005.vcproj b/bsp/simulator/vs2005.vcproj index 7ae6740d4d..7bd64324a9 100644 --- a/bsp/simulator/vs2005.vcproj +++ b/bsp/simulator/vs2005.vcproj @@ -279,10 +279,6 @@ RelativePath=".\startup.c" > - -