RT-Thread / RT-Thread/rt-thread

[Feature] doxygen的audio注释中剩余问题汇总

Open
#10,095 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

Describe problem solved by the proposed feature

目前在编写audio注释时遇到了如下问题

首先是源代码的问题
@BernardXiong

  1. 根据 #10065 rt_audio_samplerate_to_speed可能是个无用函数,在bsp内也没有使用到,这个函数是否应该删除?如果确实要删除的话,内部负责采样率的宏AUDIO_SAMP_RATE_xxK是否也应删除?
  2. 目前audio模块的内部api有许多无效返回值和参数,这些是否需要在doxygen文档编写后统一修改?例如对于rt_audio_pipe_read的pos参数是无用的,rt_audio_tx_complete并没有检查_audio_send_replay_frame错误码,以及_audio_dev_close永远返回RT_EOK`

之后是注释格式化的问题
@unicornx

  1. 对于宏来说,注释可以位于宏右侧也可以位于宏上方,这点是否应该规定下?或者推荐使用哪种格式?
  2. 对于拥有多行注释的参数或者其他doxygen元素,注释写法有多种:
    类似@brief这种
/**
 * @brief Send a replay frame to the audio hardware device
 *
 * This function handles sending audio data from the memory queue to the hardware buffer for playback.
 * If there is no data available in the queue, it sends zero frames. Otherwise, it copies data from the memory pool
 * to the hardware device FIFO and manages the read index and position accordingly.
 *
 * @param[in] 
 * 
 * Audio pointer to the audio device structure.This is a section of comments, which is very long
 * for showing effect of multilines comments.
 *
 * @return error code, RT_EOK is successful otherwise means failure
 *
 * @note 
 * 
 * This function may temporarily disable interrupts or perform time-consuming operations like memcpy,            
 * which could affect system responsiveness
 */

分行并缩进保留*

/**
 * @brief Send a replay frame to the audio hardware device
 *
 * This function handles sending audio data from the memory queue to the hardware buffer for playback.
 * If there is no data available in the queue, it sends zero frames. Otherwise, it copies data from the memory pool
 * to the hardware device FIFO and manages the read index and position accordingly.
 *
 * @param[in] audio pointer to the audio device structure.This is a section of comments, which is very long
 *                     for showing effect of multilines comments.
 *
 * @return error code, RT_EOK is successful otherwise means failure
 *
 * @note This function may temporarily disable interrupts or perform time-consuming operations like memcpy,
 *             which could affect system responsiveness
 */

不保留*

/**
 * @brief Send a replay frame to the audio hardware device
 *
 * This function handles sending audio data from the memory queue to the hardware buffer for playback.
 * If there is no data available in the queue, it sends zero frames. Otherwise, it copies data from the memory pool
 * to the hardware device FIFO and manages the read index and position accordingly.
 *
 * @param[in] audio pointer to the audio device structure.This is a section of comments, which is very long
                      for showing effect of multilines comments.
 *
 * @return error code, RT_EOK is successful otherwise means failure
 *
 * @note This function may temporarily disable interrupts or perform time-consuming operations like memcpy,
               which could affect system responsiveness
 */

上面三种情况生成的网页效果均相同,差别只在源代码浏览上,这点是否需要统一起来?

Describe your preferred solution

No response

Describe possible alternatives

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issue #10065 and the audio symbols named in this report, including rt_audio_samplerate_to_speed, AUDIO_SAMP_RATE_xxK, and the listed internal APIs. Then examine the Doxygen comment examples and determine which source-code and formatting questions need maintainer decisions. Done means the agreed cleanup and documentation conventions are recorded and applied consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
documentation, embedded-iot
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.