Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
ac032ad0
R
rt-thread
项目概览
天中雨水
/
rt-thread
该项目与 Fork 源项目分叉
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac032ad0
编写于
5月 30, 2013
作者:
qiuyiuestc
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #97 from heyuanjie87/ForPullRequest
For pull request
上级
521e331d
376a08d8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
components/drivers/usb/usbdevice/core/core.c
components/drivers/usb/usbdevice/core/core.c
+6
-6
未找到文件。
components/drivers/usb/usbdevice/core/core.c
浏览文件 @
ac032ad0
...
@@ -100,13 +100,13 @@ static rt_err_t _get_string_descriptor(struct udevice* device, ureq_t setup)
...
@@ -100,13 +100,13 @@ static rt_err_t _get_string_descriptor(struct udevice* device, ureq_t setup)
str_desc
.
type
=
USB_DESC_TYPE_STRING
;
str_desc
.
type
=
USB_DESC_TYPE_STRING
;
index
=
setup
->
value
&
0xFF
;
index
=
setup
->
value
&
0xFF
;
if
(
index
>
USB_STRING_INTERFACE_INDEX
)
if
(
index
>
USB_STRING_INTERFACE_INDEX
)
{
{
rt_kprintf
(
"unknown string index
\n
"
);
rt_kprintf
(
"unknown string index
\n
"
);
dcd_ep_stall
(
device
->
dcd
,
0
);
dcd_ep_stall
(
device
->
dcd
,
0
);
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
if
(
index
==
0
)
if
(
index
==
0
)
{
{
str_desc
.
bLength
=
4
;
str_desc
.
bLength
=
4
;
str_desc
.
String
[
0
]
=
0x09
;
str_desc
.
String
[
0
]
=
0x09
;
...
@@ -117,14 +117,14 @@ static rt_err_t _get_string_descriptor(struct udevice* device, ureq_t setup)
...
@@ -117,14 +117,14 @@ static rt_err_t _get_string_descriptor(struct udevice* device, ureq_t setup)
len
=
rt_strlen
(
device
->
str
[
index
]);
len
=
rt_strlen
(
device
->
str
[
index
]);
str_desc
.
bLength
=
len
*
2
+
2
;
str_desc
.
bLength
=
len
*
2
+
2
;
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
{
str_desc
.
String
[
i
*
2
]
=
device
->
str
[
index
][
i
];
str_desc
.
String
[
i
*
2
]
=
device
->
str
[
index
][
i
];
str_desc
.
String
[
i
*
2
+
1
]
=
0
;
str_desc
.
String
[
i
*
2
+
1
]
=
0
;
}
}
}
}
if
(
setup
->
length
>
len
)
if
(
setup
->
length
>
str_desc
.
bLength
)
len
=
str_desc
.
bLength
;
len
=
str_desc
.
bLength
;
else
else
len
=
setup
->
length
;
len
=
setup
->
length
;
...
@@ -149,7 +149,7 @@ static rt_err_t _get_descriptor(struct udevice* device, ureq_t setup)
...
@@ -149,7 +149,7 @@ static rt_err_t _get_descriptor(struct udevice* device, ureq_t setup)
RT_ASSERT
(
device
!=
RT_NULL
);
RT_ASSERT
(
device
!=
RT_NULL
);
RT_ASSERT
(
setup
!=
RT_NULL
);
RT_ASSERT
(
setup
!=
RT_NULL
);
if
(
setup
->
request_type
==
USB_REQ_TYPE_DIR_IN
)
if
(
setup
->
request_type
==
USB_REQ_TYPE_DIR_IN
)
{
{
switch
(
setup
->
value
>>
8
)
switch
(
setup
->
value
>>
8
)
{
{
...
@@ -250,7 +250,7 @@ static rt_err_t _set_interface(struct udevice* device, ureq_t setup)
...
@@ -250,7 +250,7 @@ static rt_err_t _set_interface(struct udevice* device, ureq_t setup)
setting
=
intf
->
curr_setting
;
setting
=
intf
->
curr_setting
;
/* start all endpoints of the interface alternate setting */
/* start all endpoints of the interface alternate setting */
for
(
i
=
setting
->
ep_list
.
next
;
i
!=
&
setting
->
ep_list
;
i
=
i
->
next
)
for
(
i
=
setting
->
ep_list
.
next
;
i
!=
&
setting
->
ep_list
;
i
=
i
->
next
)
{
{
ep
=
(
uep_t
)
rt_list_entry
(
i
,
struct
uendpoint
,
list
);
ep
=
(
uep_t
)
rt_list_entry
(
i
,
struct
uendpoint
,
list
);
dcd_ep_stop
(
device
->
dcd
,
ep
);
dcd_ep_stop
(
device
->
dcd
,
ep
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录