diff options
| author | prife <[email protected]> | 2013-02-07 23:27:29 +0800 |
|---|---|---|
| committer | prife <[email protected]> | 2013-02-07 23:27:29 +0800 |
| commit | fd5dfc723c070b431cb4d0d809a7790566f80f6d (patch) | |
| tree | c19ba0ea38270c3047c34cc4ba25f5f24f89e63b /bsp/simulator | |
| parent | 81751d99cc58e689e447487a05b2d3eb94841837 (diff) | |
clean code in simulator/drivers/serial.c
Diffstat (limited to 'bsp/simulator')
| -rwxr-xr-x | bsp/simulator/drivers/serial.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/bsp/simulator/drivers/serial.c b/bsp/simulator/drivers/serial.c index 7593959599..8f7567e439 100755 --- a/bsp/simulator/drivers/serial.c +++ b/bsp/simulator/drivers/serial.c @@ -1,14 +1,23 @@ /* -****************************************************************************** -* By : parai -* email:[email protected] -* virtual serial driver -****************************************************************************** -*/ + * File : serial.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2013 RT-Thread Develop 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-02-05 Bernard first version + * 2009-10-25 Bernard fix rt_serial_read bug when there is no data + * in the buffer. + * 2010-03-29 Bernard cleanup code. + * 2013-02-7 prife rewrite for simulator + */ #include <rthw.h> -#define _DEBUG_SERIAL 0 #include "serial.h" #include <stdio.h> @@ -85,17 +94,11 @@ static rt_err_t rt_serial_init(rt_device_t dev) static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) { -#if _DEBUG_SERIAL==1 - printf("in rt_serial_open()\n"); -#endif return RT_EOK; } static rt_err_t rt_serial_close(rt_device_t dev) { -#if _DEBUG_SERIAL==1 - printf("in rt_serial_close()\n"); -#endif return RT_EOK; } static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -152,9 +155,6 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_ static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { int level; -#if _DEBUG_SERIAL==1 - printf("in rt_serial_write()\n"); -#endif #if 0 if (fp == NULL) fp = fopen("log.txt", "wb+"); @@ -196,9 +196,6 @@ static rt_err_t rt_serial_control(rt_device_t dev, rt_uint8_t cmd, void *args) rt_err_t rt_hw_serial_register(rt_device_t device, const char *name, rt_uint32_t flag) { RT_ASSERT(device != RT_NULL); -#if _DEBUG_SERIAL==1 - printf("in rt_serial_register()\n"); -#endif device->type = RT_Device_Class_Char; device->rx_indicate = RT_NULL; device->tx_complete = RT_NULL; |
