1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

Fix the l3gd20 initialization in pios_board.c and also change the (ugly)

hardcoded exti system to use line3 on F1xx for L3GD20
This commit is contained in:
James Cotton 2012-01-20 14:36:48 -06:00
parent c76e9f2d7a
commit a252ee134a
5 changed files with 15 additions and 13 deletions

View File

@ -75,6 +75,7 @@
#define PIOS_INCLUDE_BL_HELPER #define PIOS_INCLUDE_BL_HELPER
#define PIOS_INCLUDE_ADXL345 #define PIOS_INCLUDE_ADXL345
#define PIOS_INCLUDE_L3GD20
#define PIOS_INCLUDE_FLASH #define PIOS_INCLUDE_FLASH
#define PIOS_INCLUDE_BMP085 #define PIOS_INCLUDE_BMP085

View File

@ -1146,6 +1146,8 @@ static const struct pios_l3gd20_cfg pios_l3gd20_cfg = {
}, },
}, },
.eoc_exti = { .eoc_exti = {
.pin_source = GPIO_PinSource3,
.port_source = GPIO_PortSourceGPIOA,
.init = { .init = {
.EXTI_Line = EXTI_Line3, // matches above GPIO pin .EXTI_Line = EXTI_Line3, // matches above GPIO pin
.EXTI_Mode = EXTI_Mode_Interrupt, .EXTI_Mode = EXTI_Mode_Interrupt,

View File

@ -79,14 +79,17 @@ void EXTI9_5_IRQHandler(void)
} }
/** /**
* Handle external line 4 interrupt requests * Handle external line 3 interrupt requests
*/ */
#if defined(PIOS_INCLUDE_USB) #if defined(PIOS_INCLUDE_L3GD20)
void EXTI4_IRQHandler(void) extern void PIOS_L3GD20_IRQHandler();
void EXTI3_IRQHandler(void)
{ {
if (EXTI_GetITStatus(PIOS_USB_DETECT_EXTI_LINE) != RESET) { if (EXTI_GetITStatus(EXTI_Line3) != RESET) {
PIOS_L3GD20_IRQHandler();
/* Clear the EXTI line pending bit */ /* Clear the EXTI line pending bit */
EXTI_ClearITPendingBit(PIOS_USB_DETECT_EXTI_LINE); EXTI_ClearITPendingBit(EXTI_Line3);
} }
} }
#endif #endif

View File

@ -309,14 +309,6 @@ void PIOS_L3GD20_IRQHandler(void)
} }
void EXTI4_IRQHandler(void)
{
if (EXTI_GetITStatus(PIOS_USB_DETECT_EXTI_LINE) != RESET) {
/* Clear the EXTI line pending bit */
EXTI_ClearITPendingBit(PIOS_USB_DETECT_EXTI_LINE);
}
}
#endif /* L3GD20 */ #endif /* L3GD20 */

View File

@ -121,6 +121,10 @@
#include <pios_adxl345.h> #include <pios_adxl345.h>
#endif #endif
#if defined(PIOS_INCLUDE_L3GD20)
#include <pios_l3gd20.h>
#endif
#if defined(PIOS_INCLUDE_BMA180) #if defined(PIOS_INCLUDE_BMA180)
#include <pios_bma180.h> #include <pios_bma180.h>
#endif #endif