Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
5397e18c
R
rt-thread
项目概览
人间散章
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5397e18c
编写于
8月 03, 2014
作者:
B
bernard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[DeviceDrivers] Fix compiling warning.
上级
582aff86
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
44 deletion
+5
-44
components/drivers/i2c/i2c-bit-ops.c
components/drivers/i2c/i2c-bit-ops.c
+0
-3
components/drivers/i2c/i2c_dev.c
components/drivers/i2c/i2c_dev.c
+2
-9
components/drivers/spi/spi_dev.c
components/drivers/spi/spi_dev.c
+3
-32
未找到文件。
components/drivers/i2c/i2c-bit-ops.c
浏览文件 @
5397e18c
...
...
@@ -451,9 +451,6 @@ static const struct rt_i2c_bus_device_ops i2c_bit_bus_ops =
rt_err_t
rt_i2c_bit_add_bus
(
struct
rt_i2c_bus_device
*
bus
,
const
char
*
bus_name
)
{
struct
rt_i2c_bit_ops
*
bit_ops
=
bus
->
priv
;
RT_ASSERT
(
bit_ops
!=
RT_NULL
);
bus
->
ops
=
&
i2c_bit_bus_ops
;
return
rt_i2c_bus_device_register
(
bus
,
bus_name
);
...
...
components/drivers/i2c/i2c_dev.c
浏览文件 @
5397e18c
...
...
@@ -20,18 +20,11 @@
* Change Logs:
* Date Author Notes
* 2012-04-25 weety first version
* 2014-08-03 bernard fix some compiling warning
*/
#include <rtdevice.h>
static
rt_err_t
i2c_bus_device_init
(
rt_device_t
dev
)
{
struct
rt_i2c_bus_device
*
bus
=
(
struct
rt_i2c_bus_device
*
)
dev
->
user_data
;
RT_ASSERT
(
bus
!=
RT_NULL
);
return
RT_EOK
;
}
static
rt_size_t
i2c_bus_device_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
...
...
@@ -122,7 +115,7 @@ rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
/* set device type */
device
->
type
=
RT_Device_Class_I2CBUS
;
/* initialize device interface */
device
->
init
=
i2c_bus_device_init
;
device
->
init
=
RT_NULL
;
device
->
open
=
RT_NULL
;
device
->
close
=
RT_NULL
;
device
->
read
=
i2c_bus_device_read
;
...
...
components/drivers/spi/spi_dev.c
浏览文件 @
5397e18c
...
...
@@ -25,16 +25,6 @@
#include <drivers/spi.h>
/* SPI bus device interface, compatible with RT-Thread 0.3.x/1.0.x */
static
rt_err_t
_spi_bus_device_init
(
rt_device_t
dev
)
{
struct
rt_spi_bus
*
bus
;
bus
=
(
struct
rt_spi_bus
*
)
dev
;
RT_ASSERT
(
bus
!=
RT_NULL
);
return
RT_EOK
;
}
static
rt_size_t
_spi_bus_device_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
...
...
@@ -67,11 +57,7 @@ static rt_err_t _spi_bus_device_control(rt_device_t dev,
rt_uint8_t
cmd
,
void
*
args
)
{
struct
rt_spi_bus
*
bus
;
bus
=
(
struct
rt_spi_bus
*
)
dev
;
RT_ASSERT
(
bus
!=
RT_NULL
);
/* TODO: add control command handle */
switch
(
cmd
)
{
case
0
:
/* set device */
...
...
@@ -93,7 +79,7 @@ rt_err_t rt_spi_bus_device_init(struct rt_spi_bus *bus, const char *name)
/* set device type */
device
->
type
=
RT_Device_Class_SPIBUS
;
/* initialize device interface */
device
->
init
=
_spi_bus_device_init
;
device
->
init
=
RT_NULL
;
device
->
open
=
RT_NULL
;
device
->
close
=
RT_NULL
;
device
->
read
=
_spi_bus_device_read
;
...
...
@@ -105,16 +91,6 @@ rt_err_t rt_spi_bus_device_init(struct rt_spi_bus *bus, const char *name)
}
/* SPI Dev device interface, compatible with RT-Thread 0.3.x/1.0.x */
static
rt_err_t
_spidev_device_init
(
rt_device_t
dev
)
{
struct
rt_spi_device
*
device
;
device
=
(
struct
rt_spi_device
*
)
dev
;
RT_ASSERT
(
device
!=
RT_NULL
);
return
RT_EOK
;
}
static
rt_size_t
_spidev_device_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
...
...
@@ -147,11 +123,6 @@ static rt_err_t _spidev_device_control(rt_device_t dev,
rt_uint8_t
cmd
,
void
*
args
)
{
struct
rt_spi_device
*
device
;
device
=
(
struct
rt_spi_device
*
)
dev
;
RT_ASSERT
(
device
!=
RT_NULL
);
switch
(
cmd
)
{
case
0
:
/* set device */
...
...
@@ -172,7 +143,7 @@ rt_err_t rt_spidev_device_init(struct rt_spi_device *dev, const char *name)
/* set device type */
device
->
type
=
RT_Device_Class_SPIDevice
;
device
->
init
=
_spidev_device_init
;
device
->
init
=
RT_NULL
;
device
->
open
=
RT_NULL
;
device
->
close
=
RT_NULL
;
device
->
read
=
_spidev_device_read
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录