Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
May1624-Wireless-Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
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
jdkruege
May1624-Wireless-Controller
Commits
2810886f
Commit
2810886f
authored
9 years ago
by
jdkruege
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://git.ece.iastate.edu/jdkruege/May1624-Wireless-Controller
parents
bb0cb553
b7c1632e
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Development/Software/buttonInterrupt.c
+46
-0
46 additions, 0 deletions
Development/Software/buttonInterrupt.c
with
46 additions
and
0 deletions
Development/Software/buttonInterrupt.c
0 → 100644
+
46
−
0
View file @
2810886f
/*
* buttonInterrupt.c
*
* Created on: Feb 10, 2016
* Author: Nik
*/
#include
<stdio.h>
#include
<stdlib.h>
#include
<mraa.h>
static
volatile
int
counter
=
1
;
void
interrupt
(
void
*
args
)
{
fprintf
(
stdout
,
"%d
\n
"
,
counter
);
counter
++
;
}
int
buttonInterrupt
()
{
//initialize mraa
mraa_init
();
//create mraa context
mraa_gpio_context
context
;
//set context to GPIO 15 (J20:7)
context
=
mraa_gpio_init
(
15
);
if
(
context
==
NULL
)
{
return
-
1
;
}
else
{
fprintf
(
stdout
,
"GPIO Initialized
\n
"
);
}
mraa_gpio_dir
(
context
,
MRAA_GPIO_IN
);
mraa_gpio_edge_t
edge
=
MRAA_GPIO_EDGE_FALLING
;
mraa_gpio_isr
(
context
,
edge
,
&
interrupt
,
NULL
);
// mraa_result_t result = mraa_gpio_isr_exit(context);
// return result;
return
0
;
}
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