Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆着光、寻觅
rt-thread
提交
b0c7d480
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,发现更多精彩内容 >>
提交
b0c7d480
编写于
5月 22, 2013
作者:
qiuyiuestc
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #93 from heyuanjie87/ForPullRequest
For pull request
上级
d0d1861d
8aa4eb79
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
14 deletion
+36
-14
components/drivers/include/drivers/usb_device.h
components/drivers/include/drivers/usb_device.h
+6
-6
components/drivers/usb/usbdevice/core/core.c
components/drivers/usb/usbdevice/core/core.c
+30
-8
未找到文件。
components/drivers/include/drivers/usb_device.h
浏览文件 @
b0c7d480
...
...
@@ -42,8 +42,8 @@ struct uendpoint;
struct
udcd_ops
{
rt_err_t
(
*
set_address
)(
rt_uint8_t
value
);
rt_err_t
(
*
clear_feature
)(
rt_uint
8_t
value
);
rt_err_t
(
*
set_feature
)(
rt_uint
8_t
value
);
rt_err_t
(
*
clear_feature
)(
rt_uint
16_t
value
,
rt_uint16_t
index
);
rt_err_t
(
*
set_feature
)(
rt_uint
16_t
value
,
rt_uint16_t
index
);
rt_err_t
(
*
ep_alloc
)(
struct
uendpoint
*
ep
);
rt_err_t
(
*
ep_free
)(
struct
uendpoint
*
ep
);
rt_err_t
(
*
ep_stall
)(
struct
uendpoint
*
ep
);
...
...
@@ -212,18 +212,18 @@ rt_inline rt_err_t dcd_set_address(udcd_t dcd, rt_uint8_t value)
return
dcd
->
ops
->
set_address
(
value
);
}
rt_inline
rt_err_t
dcd_clear_feature
(
udcd_t
dcd
,
rt_uint
8_t
value
)
rt_inline
rt_err_t
dcd_clear_feature
(
udcd_t
dcd
,
rt_uint
16_t
value
,
rt_uint16_t
index
)
{
RT_ASSERT
(
dcd
!=
RT_NULL
);
return
dcd
->
ops
->
clear_feature
(
value
);
return
dcd
->
ops
->
clear_feature
(
value
,
index
);
}
rt_inline
rt_err_t
dcd_set_feature
(
udcd_t
dcd
,
rt_uint8_t
value
)
rt_inline
rt_err_t
dcd_set_feature
(
udcd_t
dcd
,
rt_uint8_t
value
,
rt_uint16_t
index
)
{
RT_ASSERT
(
dcd
!=
RT_NULL
);
return
dcd
->
ops
->
set_feature
(
value
);
return
dcd
->
ops
->
set_feature
(
value
,
index
);
}
rt_inline
rt_err_t
dcd_ep_stall
(
udcd_t
dcd
,
uep_t
ep
)
...
...
components/drivers/usb/usbdevice/core/core.c
浏览文件 @
b0c7d480
...
...
@@ -256,7 +256,8 @@ static rt_err_t _set_interface(struct udevice* device, ureq_t setup)
dcd_ep_stop
(
device
->
dcd
,
ep
);
dcd_ep_run
(
device
->
dcd
,
ep
);
}
dcd_send_status
(
device
->
dcd
);
return
RT_EOK
;
}
...
...
@@ -454,10 +455,11 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup)
dcd_ep_write
(
device
->
dcd
,
0
,
&
value
,
2
);
break
;
case
USB_REQ_CLEAR_FEATURE
:
dcd_clear_feature
(
dcd
,
setup
->
value
);
dcd_clear_feature
(
dcd
,
setup
->
value
,
setup
->
index
);
dcd_send_status
(
dcd
);
break
;
case
USB_REQ_SET_FEATURE
:
dcd_set_feature
(
dcd
,
setup
->
value
);
dcd_set_feature
(
dcd
,
setup
->
value
,
setup
->
index
);
break
;
case
USB_REQ_SET_ADDRESS
:
_set_address
(
device
,
setup
);
...
...
@@ -504,15 +506,35 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup)
switch
(
setup
->
request
)
{
case
USB_REQ_GET_STATUS
:
{
/* TODO */
uep_t
ep
;
ep
=
rt_usbd_find_endpoint
(
device
,
RT_NULL
,
setup
->
index
);
value
=
ep
->
is_stall
;
dcd_ep_write
(
dcd
,
0
,
&
value
,
2
);
break
;
}
break
;
case
USB_REQ_CLEAR_FEATURE
:
dcd_clear_feature
(
dcd
,
setup
->
value
);
break
;
{
uep_t
ep
;
ep
=
rt_usbd_find_endpoint
(
device
,
RT_NULL
,
setup
->
index
);
ep
->
is_stall
=
0
;
dcd_clear_feature
(
dcd
,
setup
->
value
,
setup
->
index
);
dcd_send_status
(
dcd
);
}
break
;
case
USB_REQ_SET_FEATURE
:
dcd_set_feature
(
dcd
,
setup
->
value
);
break
;
{
uep_t
ep
;
ep
=
rt_usbd_find_endpoint
(
device
,
RT_NULL
,
setup
->
index
);
ep
->
is_stall
=
1
;
dcd_set_feature
(
dcd
,
setup
->
value
,
setup
->
index
);
dcd_send_status
(
dcd
);
}
break
;
case
USB_REQ_SYNCH_FRAME
:
break
;
default:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录