zkkkk12 opened a new pull request, #17764: URL: https://github.com/apache/nuttx/pull/17764
Use mutexlock to replace critical section protection when using adc_isr_thread *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* Summary The modification replaces critical section protection with mutex locks in ADC driver functions when CONFIG_ADC_ISR_THREAD is enabled, ensuring thread-safe hardware operations without unnecessarily disabling interrupts. Impact Benefits: Reduced Interrupt Latency: Interrupts remain enabled during hardware operations Better System Throughput: Other interrupts can still be serviced Improved Real-time Performance: Shorter critical sections mean better determinism Testing The ADC function was tested and verified to be working correctly using NuttX's built-in adc_drivers.(apps/examples/adc) Test Results: Test results: When you input adc -p in the nsh terminal, the pin corresponding to channel adc0 is shown below. [core2] adc -p [core2] adc_main:g_adcstate.count: 3 [core2] adc_main: Hardware initialized. Opening the ADC device: /dev/adc0 [core2] Sample: [core2] 1: channel: 32 value: 986 [core2] 2: channel: 34 value: 933 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
