mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-31 02:50:26 +08:00
Merge pull request #2009 from zhaojuntao/fix-1124
[components/drivers] 修复数据类型不匹配的问题
This commit is contained in:
commit
07fce42479
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user