Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
cm-projects
RIOT
Commits
c4584aca
Commit
c4584aca
authored
8 years ago
by
Anon Mall
Browse files
Options
Downloads
Patches
Plain Diff
gpio interrupt fix
parent
7ea64e37
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpu/cc2538/periph/gpio.c
+3
-3
3 additions, 3 deletions
cpu/cc2538/periph/gpio.c
with
3 additions
and
3 deletions
cpu/cc2538/periph/gpio.c
+
3
−
3
View file @
c4584aca
...
@@ -98,7 +98,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
...
@@ -98,7 +98,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
isr_ctx
[
port_num
(
pin
)][
pin_num
(
pin
)].
arg
=
arg
;
isr_ctx
[
port_num
(
pin
)][
pin_num
(
pin
)].
arg
=
arg
;
/* enable power-up interrupts for this GPIO port: */
/* enable power-up interrupts for this GPIO port: */
SYS_CTRL
->
IWE
|=
port_num
(
pin
);
SYS_CTRL
->
IWE
|=
(
1
<<
port_num
(
pin
)
)
;
/* configure the active flank(s) */
/* configure the active flank(s) */
gpio
(
pin
)
->
IS
&=
~
pin_mask
(
pin
);
gpio
(
pin
)
->
IS
&=
~
pin_mask
(
pin
);
...
@@ -111,7 +111,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
...
@@ -111,7 +111,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
case
GPIO_RISING
:
case
GPIO_RISING
:
gpio
(
pin
)
->
IBE
&=
~
pin_mask
(
pin
);
gpio
(
pin
)
->
IBE
&=
~
pin_mask
(
pin
);
gpio
(
pin
)
->
IEV
|=
pin_mask
(
pin
);
gpio
(
pin
)
->
IEV
|=
pin_mask
(
pin
);
gpio
(
pin
)
->
P_EDGE_CTRL
&=
(
1
<<
pp_num
(
pin
));
gpio
(
pin
)
->
P_EDGE_CTRL
&=
~
(
1
<<
pp_num
(
pin
));
break
;
break
;
case
GPIO_BOTH
:
case
GPIO_BOTH
:
gpio
(
pin
)
->
IBE
|=
pin_mask
(
pin
);
gpio
(
pin
)
->
IBE
|=
pin_mask
(
pin
);
...
@@ -175,7 +175,7 @@ static inline void handle_isr(cc2538_gpio_t *gpio, int port_num)
...
@@ -175,7 +175,7 @@ static inline void handle_isr(cc2538_gpio_t *gpio, int port_num)
{
{
uint32_t
state
=
gpio
->
MIS
;
uint32_t
state
=
gpio
->
MIS
;
gpio
->
IC
=
0x000000ff
;
gpio
->
IC
=
0x000000ff
;
gpio
->
IRQ_DETECT_ACK
=
0x
000000ff
;
gpio
->
IRQ_DETECT_ACK
=
(
0x
ff
<<
(
port_num
*
GPIO_BITS_PER_PORT
))
;
for
(
int
i
=
0
;
i
<
GPIO_BITS_PER_PORT
;
i
++
)
{
for
(
int
i
=
0
;
i
<
GPIO_BITS_PER_PORT
;
i
++
)
{
if
(
state
&
(
1
<<
i
))
{
if
(
state
&
(
1
<<
i
))
{
...
...
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