Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
ca439555
Commit
ca439555
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAMA5D3/4: Fix two issues associated with PIO interrupts
parent
ab850616
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/arm/src/sama5/sam_pio.c
+18
-16
18 additions, 16 deletions
arch/arm/src/sama5/sam_pio.c
arch/arm/src/sama5/sam_pio.h
+15
-5
15 additions, 5 deletions
arch/arm/src/sama5/sam_pio.h
arch/arm/src/sama5/sam_pioirq.c
+5
-5
5 additions, 5 deletions
arch/arm/src/sama5/sam_pioirq.c
with
38 additions
and
26 deletions
arch/arm/src/sama5/sam_pio.c
+
18
−
16
View file @
ca439555
...
...
@@ -65,6 +65,22 @@
* Private Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/* SAM_PION_VBASE will only be defined if the PIO register blocks are
* contiguous. If not defined, then we need to do a table lookup.
*/
#ifndef SAM_PION_VBASE
const
uintptr_t
g_piobase
[
SAM_NPIO
]
=
{
SAM_PIOA_VBASE
,
SAM_PIOB_VBASE
,
SAM_PIOC_VBASE
,
SAM_PIOD_VBASE
,
SAM_PIOE_VBASE
};
#endif
/****************************************************************************
* Private Data
****************************************************************************/
...
...
@@ -115,20 +131,6 @@ static const bool g_piointerrupt[SAM_NPIO] =
#endif
};
/* SAM_PION_VBASE will only be defined if the PIO register blocks are
* contiguous. If not defined, then we need to do a table lookup.
*/
#ifndef SAM_PION_VBASE
static
const
uintptr_t
g_piobase
[
SAM_NPIO
]
=
{
SAM_PIOA_VBASE
,
SAM_PIOB_VBASE
,
SAM_PIOC_VBASE
,
SAM_PIOD_VBASE
,
SAM_PIOE_VBASE
};
# define SAM_PION_VBASE(n) (g_piobase[(n)])
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
...
...
@@ -146,7 +148,7 @@ static inline uintptr_t sam_piobase(pio_pinset_t cfgset)
if
(
port
<
SAM_NPIO
)
{
return
SAM_PION_VBASE
(
port
);
return
sam_pion_vbase
(
port
);
}
else
{
...
...
@@ -730,7 +732,7 @@ int sam_dumppio(uint32_t pinset, const char *msg)
/* Get the base address associated with the PIO port */
port
=
(
pinset
&
PIO_PORT_MASK
)
>>
PIO_PORT_SHIFT
;
base
=
SAM_PION_VBASE
(
port
);
base
=
sam_pion_vbase
(
port
);
/* The following requires exclusive access to the PIO registers */
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sama5/sam_pio.h
+
15
−
5
View file @
ca439555
...
...
@@ -51,11 +51,10 @@
************************************************************************************/
/* Configuration ********************************************************************/
#undef CONFIG_SAMA5_PIO_IRQ
#if defined(CONFIG_SAMA5_PIOA_IRQ) || defined(CONFIG_SAMA5_PIOB_IRQ) || \
defined(CONFIG_SAMA5_PIOC_IRQ) || defined(CONFIG_SAMA5_PIOD_IRQ) || \
defined(CONFIG_SAMA5_PIOD_IRQ)
# define CONFIG_SAMA5_PIO_IRQ 1
#if !defined(CONFIG_SAMA5_PIOA_IRQ) && !defined(CONFIG_SAMA5_PIOB_IRQ) && \
!defined(CONFIG_SAMA5_PIOC_IRQ) && !defined(CONFIG_SAMA5_PIOD_IRQ) && \
!defined(CONFIG_SAMA5_PIOE_IRQ) && !defined(CONFIG_SAMA5_PIOF_IRQ)
# undef CONFIG_SAMA5_PIO_IRQ
#endif
#ifndef CONFIG_DEBUG
...
...
@@ -216,6 +215,17 @@
typedef
uint32_t
pio_pinset_t
;
/* SAM_PION_VBASE will only be defined if the PIO register blocks are contiguous.
* If not defined, then we need to do a table lookup.
*/
#ifndef SAM_PION_VBASE
extern
const
uintptr_t
g_piobase
[
SAM_NPIO
];
# define sam_pion_vbase(n) (g_piobase[(n)])
#else
# define sam_pion_vbase(n) SAM_PION_VBASE(n)
#endif
/************************************************************************************
* Inline Functions
************************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sama5/sam_pioirq.c
+
5
−
5
View file @
ca439555
...
...
@@ -87,14 +87,14 @@
static
inline
uint32_t
sam_piobase
(
pio_pinset_t
pinset
)
{
int
port
=
(
pinset
&
PIO_PORT_MASK
)
>>
PIO_PORT_SHIFT
;
return
SAM_PION_VBASE
(
port
>>
PIO_PORT_SHIFT
);
return
sam_pion_vbase
(
port
>>
PIO_PORT_SHIFT
);
}
/****************************************************************************
* Name: sam_piopin
*
* Description:
* Retur
u
n the base address of the PIO register set
* Return the base address of the PIO register set
*
****************************************************************************/
...
...
@@ -107,7 +107,7 @@ static inline int sam_piopin(pio_pinset_t pinset)
* Name: sam_irqbase
*
* Description:
* Return
pio
information associated with this IRQ
* Return
PIO
information associated with this IRQ
*
****************************************************************************/
...
...
@@ -169,10 +169,10 @@ static int sam_irqbase(int irq, uint32_t *base, int *pin)
}
/****************************************************************************
* Name: sam_pioa/b/cinterrupt
* Name: sam_pioa/b/c
/d/e/f
interrupt
*
* Description:
* Receive PIOA/B/C interrupts
* Receive PIOA/B/C
/D/E/F
interrupts
*
****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment