forked from Imagelibrary/rtems
2011-08-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
* irq/irq-dispatch.c: New file. * irq/irq.c: Moved bsp_interrupt_dispatch() to new file. * Makefile.am: Reflect change from above.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2011-08-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* irq/irq-dispatch.c: New file.
|
||||
* irq/irq.c: Moved bsp_interrupt_dispatch() to new file.
|
||||
* Makefile.am: Reflect change from above.
|
||||
|
||||
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* include/lpc24xx.h: Added ADC defines.
|
||||
|
||||
@@ -103,7 +103,8 @@ libbsp_a_SOURCES += ../../shared/src/irq-generic.c \
|
||||
../../shared/src/irq-info.c \
|
||||
../../shared/src/irq-shell.c \
|
||||
../../shared/src/irq-server.c \
|
||||
irq/irq.c
|
||||
irq/irq.c \
|
||||
irq/irq-dispatch.c
|
||||
|
||||
# Console
|
||||
libbsp_a_SOURCES += ../../shared/console.c \
|
||||
|
||||
43
c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
Normal file
43
c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup bsp_interrupt
|
||||
*
|
||||
* @brief LPC24XX interrupt support.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
#include <bsp/lpc24xx.h>
|
||||
|
||||
void bsp_interrupt_dispatch(void)
|
||||
{
|
||||
/* Read current vector number */
|
||||
rtems_vector_number vector = VICVectAddr;
|
||||
|
||||
/* Enable interrupts in program status register */
|
||||
uint32_t psr = arm_status_irq_enable();
|
||||
|
||||
/* Dispatch interrupt handlers */
|
||||
bsp_interrupt_handler_dispatch(vector);
|
||||
|
||||
/* Restore program status register */
|
||||
arm_status_restore(psr);
|
||||
|
||||
/* Acknowledge interrupt */
|
||||
VICVectAddr = 0;
|
||||
}
|
||||
@@ -7,15 +7,17 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008, 2009
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* Germany
|
||||
* rtems@embedded-brains.de
|
||||
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* The license and distribution terms for this file may be found in the file
|
||||
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
@@ -48,24 +50,6 @@ unsigned lpc24xx_irq_get_priority(rtems_vector_number vector)
|
||||
}
|
||||
}
|
||||
|
||||
void bsp_interrupt_dispatch(void)
|
||||
{
|
||||
/* Read current vector number */
|
||||
rtems_vector_number vector = VICVectAddr;
|
||||
|
||||
/* Enable interrupts in program status register */
|
||||
uint32_t psr = arm_status_irq_enable();
|
||||
|
||||
/* Dispatch interrupt handlers */
|
||||
bsp_interrupt_handler_dispatch(vector);
|
||||
|
||||
/* Restore program status register */
|
||||
arm_status_restore(psr);
|
||||
|
||||
/* Acknowledge interrupt */
|
||||
VICVectAddr = 0;
|
||||
}
|
||||
|
||||
rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
|
||||
{
|
||||
VICIntEnable = 1U << vector;
|
||||
|
||||
Reference in New Issue
Block a user