Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-nRF5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-nRF5
Commits
71e9f7a3
Commit
71e9f7a3
authored
Mar 31, 2016
by
Sandeep Mistry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct attachInterrupt/detachInterrupt to use pin map
parent
d919a43d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
cores/nRF5/WInterrupts.c
cores/nRF5/WInterrupts.c
+12
-0
No files found.
cores/nRF5/WInterrupts.c
View file @
71e9f7a3
...
@@ -50,6 +50,12 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
...
@@ -50,6 +50,12 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
enabled
=
1
;
enabled
=
1
;
}
}
if
(
pin
>=
PINS_COUNT
)
{
return
;
}
pin
=
g_ADigitalPinMap
[
pin
];
nrf_gpiote_polarity_t
polarity
;
nrf_gpiote_polarity_t
polarity
;
switch
(
mode
)
{
switch
(
mode
)
{
...
@@ -88,6 +94,12 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
...
@@ -88,6 +94,12 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
*/
*/
void
detachInterrupt
(
uint32_t
pin
)
void
detachInterrupt
(
uint32_t
pin
)
{
{
if
(
pin
>=
PINS_COUNT
)
{
return
;
}
pin
=
g_ADigitalPinMap
[
pin
];
for
(
int
ch
=
0
;
ch
<
NUMBER_OF_GPIO_TE
;
ch
++
)
{
for
(
int
ch
=
0
;
ch
<
NUMBER_OF_GPIO_TE
;
ch
++
)
{
if
((
uint32_t
)
channelMap
[
ch
]
==
pin
)
{
if
((
uint32_t
)
channelMap
[
ch
]
==
pin
)
{
channelMap
[
ch
]
=
-
1
;
channelMap
[
ch
]
=
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment