Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
07fce424
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
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,发现更多精彩内容 >>
未验证
提交
07fce424
编写于
11月 28, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
11月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2009 from zhaojuntao/fix-1124
[components/drivers] 修复数据类型不匹配的问题
上级
d4469fe7
7556ab89
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
11 deletion
+6
-11
components/drivers/audio/audio.c
components/drivers/audio/audio.c
+1
-6
components/drivers/audio/audio_pipe.c
components/drivers/audio/audio_pipe.c
+2
-2
components/drivers/audio/audio_pipe.h
components/drivers/audio/audio_pipe.h
+3
-3
未找到文件。
components/drivers/audio/audio.c
浏览文件 @
07fce424
...
...
@@ -105,8 +105,6 @@ static rt_err_t _audio_dev_init(struct rt_device *dev)
static
rt_err_t
_audio_dev_open
(
struct
rt_device
*
dev
,
rt_uint16_t
oflag
)
{
rt_err_t
result
=
RT_EOK
;
rt_base_t
level
;
struct
rt_audio_device
*
audio
;
RT_ASSERT
(
dev
!=
RT_NULL
);
...
...
@@ -159,7 +157,6 @@ static rt_err_t _audio_dev_open(struct rt_device *dev, rt_uint16_t oflag)
//init pipe for record
{
rt_size_t
size
=
CFG_AUDIO_RECORD_PIPE_SIZE
;
rt_uint8_t
*
buf
=
rt_malloc
(
CFG_AUDIO_RECORD_PIPE_SIZE
);
if
(
buf
==
RT_NULL
)
...
...
@@ -170,7 +167,7 @@ static rt_err_t _audio_dev_open(struct rt_device *dev, rt_uint16_t oflag)
return
-
RT_ENOMEM
;
}
rt_audio_pipe_init
(
&
audio_pipe
,
"recpipe"
,
RT_PIPE_FLAG_FORCE_WR
|
RT_PIPE_FLAG_BLOCK_RD
,
buf
,
rt_audio_pipe_init
(
&
audio_pipe
,
"recpipe"
,
(
rt_int32_t
)(
RT_PIPE_FLAG_FORCE_WR
|
RT_PIPE_FLAG_BLOCK_RD
)
,
buf
,
CFG_AUDIO_RECORD_PIPE_SIZE
);
}
...
...
@@ -536,8 +533,6 @@ void rt_audio_tx_complete(struct rt_audio_device *audio, rt_uint8_t *pbuf)
void
rt_audio_rx_done
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
pbuf
,
rt_size_t
len
)
{
rt_err_t
result
=
RT_EOK
;
//save data to record pipe
rt_device_write
(
RT_DEVICE
(
RT_DEVICE
(
&
audio_pipe
)),
0
,
pbuf
,
len
);
...
...
components/drivers/audio/audio_pipe.c
浏览文件 @
07fce424
...
...
@@ -213,7 +213,7 @@ const static struct rt_device_ops audio_pipe_ops =
*/
rt_err_t
rt_audio_pipe_init
(
struct
rt_audio_pipe
*
pipe
,
const
char
*
name
,
enum
rt_audio_pipe_flag
flag
,
rt_int32_t
flag
,
rt_uint8_t
*
buf
,
rt_size_t
size
)
{
...
...
@@ -258,7 +258,7 @@ rt_err_t rt_audio_pipe_detach(struct rt_audio_pipe *pipe)
}
#ifdef RT_USING_HEAP
rt_err_t
rt_audio_pipe_create
(
const
char
*
name
,
enum
rt_audio_pipe_flag
flag
,
rt_size_t
size
)
rt_err_t
rt_audio_pipe_create
(
const
char
*
name
,
rt_int32_t
flag
,
rt_size_t
size
)
{
rt_uint8_t
*
rb_memptr
=
RT_NULL
;
struct
rt_audio_pipe
*
pipe
=
RT_NULL
;
...
...
components/drivers/audio/audio_pipe.h
浏览文件 @
07fce424
...
...
@@ -50,7 +50,7 @@ struct rt_audio_pipe
/* ring buffer in pipe device */
struct
rt_ringbuffer
ringbuffer
;
enum
rt_audio_pipe_flag
flag
;
rt_int32_t
flag
;
/* suspended list */
rt_list_t
suspended_read_list
;
...
...
@@ -64,12 +64,12 @@ struct rt_audio_pipe
rt_err_t
rt_audio_pipe_init
(
struct
rt_audio_pipe
*
pipe
,
const
char
*
name
,
enum
rt_audio_pipe_flag
flag
,
rt_int32_t
flag
,
rt_uint8_t
*
buf
,
rt_size_t
size
);
rt_err_t
rt_audio_pipe_detach
(
struct
rt_audio_pipe
*
pipe
);
#ifdef RT_USING_HEAP
rt_err_t
rt_audio_pipe_create
(
const
char
*
name
,
enum
rt_audio_pipe_flag
flag
,
rt_size_t
size
);
rt_err_t
rt_audio_pipe_create
(
const
char
*
name
,
rt_int32_t
flag
,
rt_size_t
size
);
void
rt_audio_pipe_destroy
(
struct
rt_audio_pipe
*
pipe
);
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录