nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

add function of allocating fifosize on adc separately

Open zhangkai25 opened this issue 1 year ago • 1 comments

Summary

allocating fifosize on demand to optimize memory ,no need to seting adc_fifosize unified

Impact

Allocate fifosize on demand to optimize memory & Fix the situation where af_channel is still being read after it is released

Testing

zhangkai25 avatar Sep 27 '24 06:09 zhangkai25

[Experimental Bot, please feedback here]

No, this PR does not meet all the NuttX requirements.

Here's why and how to improve it:

  • Missing Information in Summary:

    • Why is the change necessary? Clearly state the problem the current fixed FIFO size causes. For example, "The current fixed adc_fifosize leads to wasted memory when applications don't require a large buffer, especially on memory-constrained devices."
    • What functional part is changed? Be specific. Mention the ADC driver or subsystem.
    • How does it work? Briefly explain the on-demand allocation mechanism. When is memory allocated/freed?
  • Incomplete Impact Section:

    • Impact on User: Do users need to change their application code to use this new feature? Will any ADC APIs change?
    • Impact on Build: Are there any new configuration options that users might need to set?
    • Impact on Hardware: Is this change specific to certain ADC hardware or architectures?
    • Impact on Documentation: Documentation updates are almost always needed for code changes. State that documentation will be updated or provide a link to a separate documentation PR.
  • Missing Testing Details:

    • Build Hosts: List the operating systems and compilers you used to build and test the change.
    • Target(s): Specify the exact architectures and boards you tested on (e.g., "sim:qemu-arm", "ARM: STM32F4DISCOVERY").
    • Testing Logs: The logs are empty. Provide relevant snippets showing:
      • The problem before the change (e.g., excessive memory usage, errors related to the af_channel issue).
      • The successful operation after the change (e.g., reduced memory usage, correct af_channel behavior).

Example of an Improved Summary:

"This PR optimizes memory usage in the ADC driver by allocating the FIFO buffer size on demand. Previously, a fixed adc_fifosize was used, leading to potential memory waste. The change introduces a dynamic allocation mechanism that allocates memory when an ADC channel is opened and frees it upon channel closure. This addresses the inefficiency of the previous approach and ensures optimal memory utilization."

nuttxpr avatar Sep 27 '24 06:09 nuttxpr