From 66dd03f6c26caa15adb174e36f11544f60d3dadf Mon Sep 17 00:00:00 2001 From: SeliverWang <568073531@qq.com> Date: Sat, 7 Sep 2024 10:33:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Daudio=5Fpipe=E4=B8=AD?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=9C=A8=E5=BC=80=E5=90=AFPOSIX=20IPC?= =?UTF-8?q?=E6=97=B6=E4=B8=8E=20POSIX=20PIPE=E5=86=B2=E7=AA=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/audio/dev_audio_pipe.c | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/components/drivers/audio/dev_audio_pipe.c b/components/drivers/audio/dev_audio_pipe.c index 2f5e9df12e..24c0f26758 100644 --- a/components/drivers/audio/dev_audio_pipe.c +++ b/components/drivers/audio/dev_audio_pipe.c @@ -12,7 +12,7 @@ #include #include "dev_audio_pipe.h" -static void _rt_pipe_resume_writer(struct rt_audio_pipe *pipe) +static void _rt_audio_pipe_resume_writer(struct rt_audio_pipe *pipe) { if (!rt_list_isempty(&pipe->suspended_write_list)) { @@ -30,7 +30,7 @@ static void _rt_pipe_resume_writer(struct rt_audio_pipe *pipe) } } -static rt_ssize_t rt_pipe_read(rt_device_t dev, +static rt_ssize_t rt_audio_pipe_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -50,7 +50,7 @@ static rt_ssize_t rt_pipe_read(rt_device_t dev, /* if the ringbuffer is empty, there won't be any writer waiting */ if (read_nbytes) - _rt_pipe_resume_writer(pipe); + _rt_audio_pipe_resume_writer(pipe); rt_hw_interrupt_enable(level); @@ -78,7 +78,7 @@ static rt_ssize_t rt_pipe_read(rt_device_t dev, } else { - _rt_pipe_resume_writer(pipe); + _rt_audio_pipe_resume_writer(pipe); rt_hw_interrupt_enable(level); break; } @@ -88,7 +88,7 @@ static rt_ssize_t rt_pipe_read(rt_device_t dev, return read_nbytes; } -static void _rt_pipe_resume_reader(struct rt_audio_pipe *pipe) +static void _rt_audio_pipe_resume_reader(struct rt_audio_pipe *pipe) { if (pipe->parent.rx_indicate) pipe->parent.rx_indicate(&pipe->parent, @@ -110,7 +110,7 @@ static void _rt_pipe_resume_reader(struct rt_audio_pipe *pipe) } } -static rt_ssize_t rt_pipe_write(rt_device_t dev, +static rt_ssize_t rt_audio_pipe_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) @@ -135,7 +135,7 @@ static rt_ssize_t rt_pipe_write(rt_device_t dev, write_nbytes = rt_ringbuffer_put(&(pipe->ringbuffer), (const rt_uint8_t *)buffer, size); - _rt_pipe_resume_reader(pipe); + _rt_audio_pipe_resume_reader(pipe); rt_hw_interrupt_enable(level); @@ -164,7 +164,7 @@ static rt_ssize_t rt_pipe_write(rt_device_t dev, } else { - _rt_pipe_resume_reader(pipe); + _rt_audio_pipe_resume_reader(pipe); rt_hw_interrupt_enable(level); break; } @@ -174,7 +174,7 @@ static rt_ssize_t rt_pipe_write(rt_device_t dev, return write_nbytes; } -static rt_err_t rt_pipe_control(rt_device_t dev, int cmd, void *args) +static rt_err_t rt_audio_pipe_control(rt_device_t dev, int cmd, void *args) { struct rt_audio_pipe *pipe; @@ -191,9 +191,9 @@ const static struct rt_device_ops audio_pipe_ops = RT_NULL, RT_NULL, RT_NULL, - rt_pipe_read, - rt_pipe_write, - rt_pipe_control + rt_audio_pipe_read, + rt_audio_pipe_write, + rt_audio_pipe_control }; #endif @@ -235,9 +235,9 @@ rt_err_t rt_audio_pipe_init(struct rt_audio_pipe *pipe, pipe->parent.init = RT_NULL; pipe->parent.open = RT_NULL; pipe->parent.close = RT_NULL; - pipe->parent.read = rt_pipe_read; - pipe->parent.write = rt_pipe_write; - pipe->parent.control = rt_pipe_control; + pipe->parent.read = rt_audio_pipe_read; + pipe->parent.write = rt_audio_pipe_write; + pipe->parent.control = rt_audio_pipe_control; #endif return rt_device_register(&(pipe->parent), name, RT_DEVICE_FLAG_RDWR);