MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _audio_dev_close

Function _audio_dev_close

components/drivers/audio/dev_audio.c:426–447  ·  view source on GitHub ↗

* @brief Stop record, replay or both. * * @param[in] dev pointer to audio device * * @return useless param */

Source from the content-addressed store, hash-verified

424 * @return useless param
425 */
426static rt_err_t _audio_dev_close(struct rt_device *dev)
427{
428 struct rt_audio_device *audio;
429 RT_ASSERT(dev != RT_NULL);
430 audio = (struct rt_audio_device *) dev;
431
432 if (dev->open_flag & RT_DEVICE_OFLAG_WRONLY)
433 {
434 /* stop replay stream */
435 _aduio_replay_stop(audio);
436 dev->open_flag &= ~RT_DEVICE_OFLAG_WRONLY;
437 }
438
439 if (dev->open_flag & RT_DEVICE_OFLAG_RDONLY)
440 {
441 /* stop record stream */
442 _audio_record_stop(audio);
443 dev->open_flag &= ~RT_DEVICE_OFLAG_RDONLY;
444 }
445
446 return RT_EOK;
447}
448
449/**
450 * @brief Read audio device

Callers

nothing calls this directly

Calls 2

_aduio_replay_stopFunction · 0.85
_audio_record_stopFunction · 0.85

Tested by

no test coverage detected