Skip to content

Commit

Permalink
pic32mx: sched_lock should replace with enter_critical_secion
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Sep 7, 2023
1 parent ba73272 commit 059ae9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/mips/src/pic32mx/pic32mx_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand All @@ -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 */
Expand Down Expand Up @@ -203,7 +204,7 @@ int pic32mx_configgpio(uint16_t cfgset)
#endif
}

sched_unlock();
leave_critical_section(flags);
return OK;
}

Expand Down

0 comments on commit 059ae9f

Please sign in to comment.