2010-09-27 09:28:45 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_EXTI External Interrupt Handlers
|
|
|
|
* @brief External interrupt handler functions
|
|
|
|
* @note Currently deals with BMP085 readings
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file pios_exti.c
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief External Interrupt Handlers
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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 3 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, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Project Includes */
|
|
|
|
#include "pios.h"
|
|
|
|
|
|
|
|
#if defined(PIOS_INCLUDE_EXTI)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle external lines 15 to 10 interrupt requests
|
|
|
|
*/
|
|
|
|
void EXTI15_10_IRQHandler(void)
|
|
|
|
{
|
|
|
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
2011-01-14 02:38:30 +01:00
|
|
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
2011-04-20 12:37:50 +02:00
|
|
|
#endif /* PIOS_INCLUDE_FREERTOS */
|
2010-09-27 09:28:45 +02:00
|
|
|
|
2011-11-26 01:38:16 +01:00
|
|
|
#if defined(PIOS_INCLUDE_BMP085) && defined(PIOS_BMP085_HAS_GPIOS)
|
2010-09-27 09:28:45 +02:00
|
|
|
if (EXTI_GetITStatus(PIOS_BMP085_EOC_EXTI_LINE) != RESET) {
|
|
|
|
/* Read the ADC Value */
|
2011-04-20 12:37:50 +02:00
|
|
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
2011-08-15 12:00:02 +02:00
|
|
|
// xSemaphoreGiveFromISR(PIOS_BMP085_EOC, &xHigherPriorityTaskWoken);
|
2011-04-20 12:37:50 +02:00
|
|
|
#else
|
2011-08-15 12:00:02 +02:00
|
|
|
//TOOD: Update BMP driver PIOS_BMP085_EOC=1;
|
2011-04-20 12:37:50 +02:00
|
|
|
#endif /* PIOS_INCLUDE_FREERTOS */
|
2010-09-27 09:28:45 +02:00
|
|
|
|
|
|
|
/* Clear the EXTI line pending bit */
|
|
|
|
EXTI_ClearITPendingBit(PIOS_BMP085_EOC_EXTI_LINE);
|
|
|
|
}
|
2011-04-20 12:37:50 +02:00
|
|
|
#endif /* PIOS_INCLUDE_BMP085 */
|
2010-09-27 09:28:45 +02:00
|
|
|
|
|
|
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
|
|
|
/* Yield From ISR if needed */
|
|
|
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
2011-04-20 12:37:50 +02:00
|
|
|
#endif /* PIOS_INCLUDE_FREERTOS */
|
2010-09-27 09:28:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle external lines 9 to 5 interrupt requests
|
|
|
|
*/
|
|
|
|
extern void PIOS_HMC5843_IRQHandler(void);
|
2011-04-20 12:37:50 +02:00
|
|
|
extern void PIOS_HMC5883_IRQHandler(void);
|
2010-09-27 09:28:45 +02:00
|
|
|
void EXTI9_5_IRQHandler(void)
|
|
|
|
{
|
|
|
|
#if defined(PIOS_INCLUDE_HMC5843)
|
|
|
|
if (EXTI_GetITStatus(PIOS_HMC5843_DRDY_EXTI_LINE) != RESET) {
|
|
|
|
PIOS_HMC5843_IRQHandler();
|
|
|
|
EXTI_ClearITPendingBit(PIOS_HMC5843_DRDY_EXTI_LINE);
|
|
|
|
}
|
2011-04-20 12:37:50 +02:00
|
|
|
#elif defined(PIOS_INCLUDE_HMC5883)
|
|
|
|
if (EXTI_GetITStatus(PIOS_HMC5883_DRDY_EXTI_LINE) != RESET) {
|
|
|
|
PIOS_HMC5883_IRQHandler();
|
|
|
|
EXTI_ClearITPendingBit(PIOS_HMC5883_DRDY_EXTI_LINE);
|
|
|
|
}
|
|
|
|
#endif /* PIOS_INCLUDE_HMC5843 */
|
2010-09-27 09:28:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle external line 4 interrupt requests
|
|
|
|
*/
|
2011-05-26 20:57:41 +02:00
|
|
|
#if defined(PIOS_INCLUDE_IMU3000)
|
|
|
|
extern void PIOS_IMU3000_IRQHandler();
|
|
|
|
#endif
|
|
|
|
|
2010-09-27 09:28:45 +02:00
|
|
|
void EXTI4_IRQHandler(void)
|
|
|
|
{
|
2011-05-26 20:57:41 +02:00
|
|
|
#if defined(PIOS_INCLUDE_USB)
|
2010-09-27 09:28:45 +02:00
|
|
|
if (EXTI_GetITStatus(PIOS_USB_DETECT_EXTI_LINE) != RESET) {
|
|
|
|
/* Clear the EXTI line pending bit */
|
|
|
|
EXTI_ClearITPendingBit(PIOS_USB_DETECT_EXTI_LINE);
|
|
|
|
}
|
2011-04-20 12:37:50 +02:00
|
|
|
#endif /* PIOS_INCLUDE_USB */
|
2011-05-26 20:57:41 +02:00
|
|
|
#if defined (PIOS_INCLUDE_BMA180)
|
|
|
|
if (EXTI_GetITStatus(PIOS_BMA180_DRDY_EXTI_LINE) != RESET) {
|
|
|
|
PIOS_BMA180_IRQHandler();
|
|
|
|
EXTI_ClearITPendingBit(PIOS_BMA180_DRDY_EXTI_LINE);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
2011-04-20 12:37:50 +02:00
|
|
|
|
2011-05-26 20:57:41 +02:00
|
|
|
#if defined(PIOS_INCLUDE_IMU3000)
|
2011-04-20 12:37:50 +02:00
|
|
|
extern void PIOS_IMU3000_IRQHandler();
|
2011-05-26 20:57:41 +02:00
|
|
|
#endif
|
2011-04-20 12:37:50 +02:00
|
|
|
void EXTI1_IRQHandler(void)
|
|
|
|
{
|
|
|
|
#if defined(PIOS_INCLUDE_IMU3000)
|
|
|
|
if (EXTI_GetITStatus(PIOS_IMU3000_INT_EXTI_LINE) != RESET)
|
|
|
|
{
|
|
|
|
PIOS_IMU3000_IRQHandler();
|
|
|
|
EXTI_ClearITPendingBit(PIOS_IMU3000_INT_EXTI_LINE);
|
|
|
|
}
|
|
|
|
#endif /* PIOS_INCLUDE_IMU3000 */
|
|
|
|
}
|
|
|
|
#endif /* PIOS_INCLUDE_EXTI */
|
2010-09-27 09:28:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
* @}
|
|
|
|
*/
|