mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 20:27:53 +00:00
arch/arm/src/samX/sam_gpioirq.c: fix pin base address calculation
GPIO PIN base address calculation had double right shift, thus call to SAM_PION_BASE was always with port = 0 instead of correct port number. As a result, function sam_gpioirq didn't correctly configure additional interrupt modes (only rising or falling edge and level interrupts). The issue occured on SAMv7 and SAM34 platforms (likely copy-pasted from one to another). Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
parent
1cf0551cf0
commit
e5f654f4ca
2 changed files with 2 additions and 2 deletions
|
|
@ -82,7 +82,7 @@
|
|||
static inline uint32_t sam_gpiobase(gpio_pinset_t pinset)
|
||||
{
|
||||
int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
|
||||
return SAM_PION_BASE(port >> GPIO_PORT_SHIFT);
|
||||
return SAM_PION_BASE(port);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
static inline uint32_t sam_gpiobase(gpio_pinset_t pinset)
|
||||
{
|
||||
int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
|
||||
return SAM_PION_BASE(port >> GPIO_PORT_SHIFT);
|
||||
return SAM_PION_BASE(port);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue