From 059ae9f2d259996c538a420d710b7a201d32ac4f Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 7 Sep 2023 09:20:43 +0800 Subject: [PATCH] pic32mx: sched_lock should replace with enter_critical_secion Signed-off-by: hujun5 --- 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 0afaa899e0494..39d6e973496e1 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; }