This is an automated email from the ASF dual-hosted git repository.

archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4fa66a68501a38c7b2f6d9ee4706f51ac3b9322d
Author: wangzhi16 <[email protected]>
AuthorDate: Wed Mar 19 17:33:29 2025 +0800

    drivers/pwm : remove critical section and mutex.
    
    Use spinlock to replace critical section and mutex.
    
    Signed-off-by: wangzhi16 <[email protected]>
---
 drivers/timers/pwm.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/timers/pwm.c b/drivers/timers/pwm.c
index ec232bf7ce0..519d6e2aa58 100644
--- a/drivers/timers/pwm.c
+++ b/drivers/timers/pwm.c
@@ -316,10 +316,6 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, 
unsigned int oflags)
 
   if (!upper->started)
     {
-      /* Disable interrupts to avoid race conditions */
-
-      flags = enter_critical_section();
-
       /* Indicate that if will be waiting for the pulse count to complete.
        * Note that we will only wait if a non-zero pulse count is specified
        * and if the PWM driver was opened in normal, blocking mode.  Also
@@ -369,8 +365,6 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, 
unsigned int oflags)
           upper->started = false;
           upper->waiting = false;
         }
-
-      leave_critical_section(flags);
     }
 
   return ret;

Reply via email to