提交 6cf3256d 编写于 作者: mysterywolf's avatar mysterywolf

[device.c] fix the comment, add RT_DEBUG_LOG

上级 a2b17574
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
#define RT_DEBUG_IPC 0 #define RT_DEBUG_IPC 0
#endif #endif
#ifndef RT_DEBUG_DEVICE
#define RT_DEBUG_DEVICE 0
#endif
#ifndef RT_DEBUG_INIT #ifndef RT_DEBUG_INIT
#define RT_DEBUG_INIT 0 #define RT_DEBUG_INIT 0
#endif #endif
......
...@@ -178,8 +178,8 @@ rt_err_t rt_device_init(rt_device_t dev) ...@@ -178,8 +178,8 @@ rt_err_t rt_device_init(rt_device_t dev)
result = device_init(dev); result = device_init(dev);
if (result != RT_EOK) if (result != RT_EOK)
{ {
rt_kprintf("To initialize device:%s failed. The error code is %d\n", RT_DEBUG_LOG(RT_DEBUG_DEVICE, ("To initialize device:%s failed. The error code is %d\n",
dev->parent.name, result); dev->parent.name, result));
} }
else else
{ {
...@@ -216,8 +216,8 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag) ...@@ -216,8 +216,8 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
result = device_init(dev); result = device_init(dev);
if (result != RT_EOK) if (result != RT_EOK)
{ {
rt_kprintf("To initialize device:%s failed. The error code is %d\n", RT_DEBUG_LOG(RT_DEBUG_DEVICE, ("To initialize device:%s failed. The error code is %d\n",
dev->parent.name, result); dev->parent.name, result));
return result; return result;
} }
...@@ -307,9 +307,9 @@ RTM_EXPORT(rt_device_close); ...@@ -307,9 +307,9 @@ RTM_EXPORT(rt_device_close);
* *
* @param size is the size of buffer. * @param size is the size of buffer.
* *
* @return the actually read size on successful, otherwise negative returned. * @return the actually read size on successful, otherwise 0 will be returned.
* *
* @note since 0.4.0, the unit of size/pos is a block for block device. * @note the unit of size/pos is a block for block device.
*/ */
rt_size_t rt_device_read(rt_device_t dev, rt_size_t rt_device_read(rt_device_t dev,
rt_off_t pos, rt_off_t pos,
...@@ -350,9 +350,9 @@ RTM_EXPORT(rt_device_read); ...@@ -350,9 +350,9 @@ RTM_EXPORT(rt_device_read);
* *
* @param size is the size of buffer. * @param size is the size of buffer.
* *
* @return the actually written size on successful, otherwise negative returned. * @return the actually written size on successful, otherwise 0 will be returned.
* *
* @note since 0.4.0, the unit of size/pos is a block for block device. * @note the unit of size/pos is a block for block device.
*/ */
rt_size_t rt_device_write(rt_device_t dev, rt_size_t rt_device_write(rt_device_t dev,
rt_off_t pos, rt_off_t pos,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册