* @brief Stop record, replay or both. * * @param[in] dev pointer to audio device * * @return useless param */
| 424 | * @return useless param |
| 425 | */ |
| 426 | static 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 |
nothing calls this directly
no test coverage detected