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
b98a9661
Commit
b98a9661
authored
8 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Another update to the I/O Expander skeleton.c file
parent
c6d65b09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/ioexpander/skeleton.c
+23
-24
23 additions, 24 deletions
drivers/ioexpander/skeleton.c
with
23 additions
and
24 deletions
drivers/ioexpander/skeleton.c
+
23
−
24
View file @
b98a9661
...
...
@@ -128,11 +128,6 @@ static int skel_attach(FAR struct ioexpander_dev_s *dev,
*/
static
struct
skel_dev_s
g_skel
;
/* Otherwise, we will need to maintain allocated driver instances in a list */
#else
static
struct
skel_dev_s
*
g_skel_list
;
#endif
/* I/O expander vtable */
...
...
@@ -659,21 +654,26 @@ static void skel_irqworker(void *arg)
* Handle GPIO interrupt events (this function executes in the
* context of the interrupt).
*
* NOTE: A more typical prototype for an interrupt handler would be:
*
* int skel_interrupt(int irq, FAR void *context)
*
* However, it is assume that the lower half, board specific interface
* can provide intercept the actual interrupt, and call this function with
* the arg that can be mapped to the provide driver structure instance.
*
* Presumably the lower level interface provides an attach() method that
* provides both the address of skel_interrupt() as well as the arg value.
* provides both the address of skel_interrupt() as well as the arg value.
*
****************************************************************************/
#ifdef CONFIG_skeleton_INT_ENABLE
static
int
skel_interrupt
(
int
irq
,
FAR
void
*
context
)
static
void
skel_interrupt
(
FAR
void
*
arg
)
{
#ifdef CONFIG_skeleton_MULTIPLE
/* To support multiple devices,
* retrieve the priv structure using the irq number.
*/
FAR
struct
skel_dev_s
*
priv
=
(
FAR
struct
skel_dev_s
)
arg
;
# warning Missing logic
#else
register
FAR
struct
skel_dev_s
*
priv
=
&
g_skel
;
#endif
DEBUGASSERT
(
priv
!=
NULL
);
/* Defer interrupt processing to the worker thread. This is not only
* much kinder in the use of system resources but is probably necessary
...
...
@@ -711,7 +711,14 @@ static int skel_interrupt(int irq, FAR void *context)
* Description:
* Initialize a I/O Expander device.
*
* TODO: Actually support more than one device.
* NOTE: There are no arguments to the initialization function this
* skelton example. Typical implementations take two arguments:
*
* 1) A reference to an I2C or SPI interface used to interace with the
* device, and
* 2) A read-only configuration structure that provides things like: I2C
* or SPI characteristics and callbacks to attache, enable, and disable
* interrupts.
*
****************************************************************************/
...
...
@@ -727,14 +734,6 @@ FAR struct ioexpander_dev_s *skel_initialize(void)
{
return
NULL
;
}
/* And save the device structure in the list of I/O Expander so that we can
* find it later.
*/
priv
->
flink
=
g_skel_list
;
g_skel_list
=
priv
;
#else
/* Use the one-and-only I/O Expander driver instance */
...
...
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