mirror of
https://github.com/apache/nuttx.git
synced 2026-05-10 07:18:49 +08: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:
@@ -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);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user