Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
47224cbc
Commit
47224cbc
authored
5 years ago
by
Florian Kargl
Browse files
Options
Downloads
Patches
Plain Diff
Unmask portexpander button interrupts by default + prevent redundant interrupts between polling
parent
eb8bc199
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/card10/portexpander.c
+10
-0
10 additions, 0 deletions
lib/card10/portexpander.c
with
10 additions
and
0 deletions
lib/card10/portexpander.c
+
10
−
0
View file @
47224cbc
...
...
@@ -123,6 +123,12 @@ int portexpander_init(void)
GPIO_IntEnable
(
&
pe_int_pin
);
NVIC_EnableIRQ
((
IRQn_Type
)
MXC_GPIO_GET_IRQ
(
pe_int_pin
.
port
));
// Unmask portexpander interrupts
portexpander_int_enable
(
PE_INPUT_MASK
);
// Clear existing interrupts
portexpander_in_get
(
0
);
return
E_SUCCESS
;
}
...
...
@@ -304,6 +310,8 @@ int portexpander_register_callback(
/* ************************************************************************** */
__attribute__
((
weak
))
void
portexpander_interrupt_callback
(
void
*
_
)
{
GPIO_IntDisable
(
&
pe_int_pin
);
GPIO_IntClr
(
&
pe_int_pin
);
interrupt_pending
=
true
;
}
...
...
@@ -317,6 +325,8 @@ void portexpander_poll()
// Port read resets interrupts
uint8_t
port_levels
=
portexpander_in_get
(
0xFF
);
GPIO_IntEnable
(
&
pe_int_pin
);
for
(
uint8_t
pin
=
0
;
pin
<
8
;
++
pin
)
{
if
((
caused_by
&
(
1
<<
pin
))
&&
callbacks
[
pin
])
{
gpio_int_pol_t
edge_type
=
...
...
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