提交 53349254 编写于 作者: D dzzxzz@gmail.com

fixed the coding style in device.c

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2386 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 1aab195a
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
* *
* @return the error code, RT_EOK on initialization successfully. * @return the error code, RT_EOK on initialization successfully.
*/ */
rt_err_t rt_device_register(rt_device_t dev, const char *name, rt_uint16_t flags) rt_err_t rt_device_register(rt_device_t dev,
const char *name,
rt_uint16_t flags)
{ {
if (dev == RT_NULL) if (dev == RT_NULL)
return -RT_ERROR; return -RT_ERROR;
...@@ -203,7 +205,7 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag) ...@@ -203,7 +205,7 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
/* if device is not initialized, initialize it. */ /* if device is not initialized, initialize it. */
if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED)) if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED))
{ {
if (dev->init != RT_NULL ) if (dev->init != RT_NULL)
{ {
result = dev->init(dev); result = dev->init(dev);
if (result != RT_EOK) if (result != RT_EOK)
...@@ -288,7 +290,10 @@ RTM_EXPORT(rt_device_close); ...@@ -288,7 +290,10 @@ RTM_EXPORT(rt_device_close);
* *
* @note since 0.4.0, the unit of size/pos is a block for block device. * @note since 0.4.0, the unit of size/pos is a block for block device.
*/ */
rt_size_t rt_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) rt_size_t rt_device_read(rt_device_t dev,
rt_off_t pos,
void *buffer,
rt_size_t size)
{ {
rt_size_t (*read)(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); rt_size_t (*read)(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size);
...@@ -320,7 +325,10 @@ RTM_EXPORT(rt_device_read); ...@@ -320,7 +325,10 @@ RTM_EXPORT(rt_device_read);
* *
* @note since 0.4.0, the unit of size/pos is a block for block device. * @note since 0.4.0, the unit of size/pos is a block for block device.
*/ */
rt_size_t rt_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) rt_size_t rt_device_write(rt_device_t dev,
rt_off_t pos,
const void *buffer,
rt_size_t size)
{ {
rt_size_t (*write)(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_size_t (*write)(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size);
...@@ -375,7 +383,9 @@ RTM_EXPORT(rt_device_control); ...@@ -375,7 +383,9 @@ RTM_EXPORT(rt_device_control);
* *
* @return RT_EOK * @return RT_EOK
*/ */
rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t (*rx_ind)(rt_device_t dev, rt_size_t size)) rt_err_t
rt_device_set_rx_indicate(rt_device_t dev,
rt_err_t (*rx_ind)(rt_device_t dev, rt_size_t size))
{ {
RT_ASSERT(dev != RT_NULL); RT_ASSERT(dev != RT_NULL);
...@@ -386,15 +396,17 @@ rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t (*rx_ind)(rt_device ...@@ -386,15 +396,17 @@ rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t (*rx_ind)(rt_device
RTM_EXPORT(rt_device_set_rx_indicate); RTM_EXPORT(rt_device_set_rx_indicate);
/** /**
* This function will set the indication callback function when device has written * This function will set the indication callback function when device has
* data to physical hardware. * written data to physical hardware.
* *
* @param dev the pointer of device driver structure * @param dev the pointer of device driver structure
* @param tx_done the indication callback function * @param tx_done the indication callback function
* *
* @return RT_EOK * @return RT_EOK
*/ */
rt_err_t rt_device_set_tx_complete(rt_device_t dev, rt_err_t (*tx_done)(rt_device_t dev, void *buffer)) rt_err_t
rt_device_set_tx_complete(rt_device_t dev,
rt_err_t (*tx_done)(rt_device_t dev, void *buffer))
{ {
RT_ASSERT(dev != RT_NULL); RT_ASSERT(dev != RT_NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册