Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
e022f08a
Commit
e022f08a
authored
Aug 25, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buttons: Moved OS-related irq handling to irq_dispatcher.c.
parent
14dc9df6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
49 deletions
+32
-49
buttons.c
sw/common/drivers/buttons.c
+2
-5
irq_dispatcher.c
sw/freertos/src/irq_dispatcher.c
+30
-4
irq_dispatcher.h
sw/freertos/src/irq_dispatcher.h
+0
-40
No files found.
sw/common/drivers/buttons.c
View file @
e022f08a
...
...
@@ -25,8 +25,8 @@
*/
#include "buttons.h"
#include "irq_dispatcher.h"
__attribute__
((
weak
))
void
GPIO_EVEN_IRQHandler
(
void
)
{
uint32_t
iflags
;
...
...
@@ -36,10 +36,9 @@ void GPIO_EVEN_IRQHandler(void)
// Clean only even interrupts
GPIO_IntClear
(
iflags
);
portEND_SWITCHING_ISR
(
gpio_irq_dispatcher
(
iflags
));
}
__attribute__
((
weak
))
void
GPIO_ODD_IRQHandler
(
void
)
{
uint32_t
iflags
;
...
...
@@ -49,8 +48,6 @@ void GPIO_ODD_IRQHandler(void)
// Clean only odd interrupts
GPIO_IntClear
(
iflags
);
portEND_SWITCHING_ISR
(
gpio_irq_dispatcher
(
iflags
));
}
void
buttons_init
(
void
)
...
...
sw/freertos/src/irq_dispatcher.c
View file @
e022f08a
...
...
@@ -25,12 +25,12 @@
* hardware interrupts and operating system.
*/
#include "irq_dispatcher.h"
#include <apps/application.h>
#include <event.h>
portBASE_TYPE
gpio_irq_dispatcher
(
uint32_t
flags
)
#include <em_gpio.h>
static
portBASE_TYPE
gpio_irq_dispatcher
(
uint32_t
flags
)
{
// We have not woken a task at the start of the ISR
portBASE_TYPE
xHigherPriorityTaskWoken
=
pdFALSE
;
...
...
@@ -50,8 +50,34 @@ portBASE_TYPE gpio_irq_dispatcher(uint32_t flags)
}
// Post the byte to the back of the queue
xQueueSendToBackFromISR
(
appQueue
,
&
evt
,
&
xHigherPriorityTaskWoken
);
xQueueSendToBackFromISR
(
appQueue
,
&
evt
,
&
xHigherPriorityTaskWoken
);
return
xHigherPriorityTaskWoken
;
}
void
GPIO_EVEN_IRQHandler
(
void
)
{
uint32_t
iflags
;
// Get all even interrupts
iflags
=
GPIO_IntGetEnabled
()
&
0x00005555
;
// Clean only even interrupts
GPIO_IntClear
(
iflags
);
portEND_SWITCHING_ISR
(
gpio_irq_dispatcher
(
iflags
));
}
void
GPIO_ODD_IRQHandler
(
void
)
{
uint32_t
iflags
;
// Get all odd interrupts
iflags
=
GPIO_IntGetEnabled
()
&
0x0000AAAA
;
// Clean only odd interrupts
GPIO_IntClear
(
iflags
);
portEND_SWITCHING_ISR
(
gpio_irq_dispatcher
(
iflags
));
}
sw/freertos/src/irq_dispatcher.h
deleted
100644 → 0
View file @
14dc9df6
/*
* Copyright (C) 2014 Julian Lewis
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* Interrupt service routines dispatchers. An abstraction layer between
* hardware interrupts and operating system.
*/
#ifndef IRQ_DISPATCHER_H
#define IRQ_DISPATCHER_H
#include <FreeRTOS.h>
#include <stdint.h>
/**
* @brief GPIO interrupt requests dispatcher.
*/
portBASE_TYPE
gpio_irq_dispatcher
(
uint32_t
flags
);
#endif
/* IRQ_DISPATCHER_H */
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