drivers/adc: Use mutexlock to replace critical section protection

Use mutexlock to replace critical section protection when using adc_isr_thread

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
This commit is contained in:
zhangkai25
2024-12-11 16:24:26 +08:00
committed by Xiang Xiao
parent 0721dfd171
commit daf5715810
2 changed files with 16 additions and 11 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ struct adc_dev_s
uint8_t ad_ocount; /* The number of times the device has been opened */
uint8_t ad_nrxwaiters; /* Number of threads waiting to enqueue a message */
mutex_t ad_closelock; /* Locks out new opens while close is in progress */
mutex_t ad_lock; /* Locks use in adc open、close and read */
sem_t ad_recvsem; /* Used to wakeup user waiting for space in ad_recv.buffer */
struct adc_fifo_s ad_recv; /* Describes receive FIFO */
bool ad_isovr; /* Flag to indicate an ADC overrun */