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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3f8f3340d1 pic32mx: sched_lock should replace with 
enter_critical_secion
3f8f3340d1 is described below

commit 3f8f3340d17fa3cf0070262d381fa840374b8d33
Author: hujun5 <[email protected]>
AuthorDate: Thu Sep 7 09:20:43 2023 +0800

    pic32mx: sched_lock should replace with enter_critical_secion
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/mips/src/pic32mx/pic32mx_gpio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/src/pic32mx/pic32mx_gpio.c 
b/arch/mips/src/pic32mx/pic32mx_gpio.c
index 0afaa899e0..39d6e97349 100644
--- a/arch/mips/src/pic32mx/pic32mx_gpio.c
+++ b/arch/mips/src/pic32mx/pic32mx_gpio.c
@@ -136,6 +136,7 @@ int pic32mx_configgpio(uint16_t cfgset)
   unsigned int pin  = pic32mx_pinno(cfgset);
   uint32_t     mask = (1 << pin);
   uintptr_t    base;
+  irqstate_t   flags;
 
   /* Verify that the port number is within range */
 
@@ -147,7 +148,7 @@ int pic32mx_configgpio(uint16_t cfgset)
 
       /* Is this an input or an output? */
 
-      sched_lock();
+      flags = enter_critical_section();
       if (pic32mx_output(cfgset))
         {
           /* Not analog */
@@ -203,7 +204,7 @@ int pic32mx_configgpio(uint16_t cfgset)
 #endif
         }
 
-      sched_unlock();
+      leave_critical_section(flags);
       return OK;
     }
 

Reply via email to