mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-21 13:28:58 +01:00
Add BMA180 to CopterControl 3D. Had to reduce the stack space by 256 bytes.
Some can be reclaimed by making the BMA180 allocate its fifo dynamically but I'll do that later when it uses FreeRTOS queues for the FIFO.
This commit is contained in:
parent
11471ff68b
commit
0cb6b13d33
@ -226,6 +226,7 @@ SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
|
||||
SRC += $(PIOSCOMMON)/pios_flash_w25x.c
|
||||
SRC += $(PIOSCOMMON)/pios_adxl345.c
|
||||
SRC += $(PIOSCOMMON)/pios_l3gd20.c
|
||||
SRC += $(PIOSCOMMON)/pios_bma180.c
|
||||
SRC += $(PIOSCOMMON)/pios_com.c
|
||||
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
||||
SRC += $(PIOSCOMMON)/pios_bmp085.c
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 48 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 54 * 256) )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 53 * 256) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
|
@ -75,6 +75,7 @@
|
||||
#define PIOS_INCLUDE_BL_HELPER
|
||||
|
||||
#define PIOS_INCLUDE_ADXL345
|
||||
#define PIOS_INCLUDE_BMA180
|
||||
#define PIOS_INCLUDE_L3GD20
|
||||
#define PIOS_INCLUDE_FLASH
|
||||
|
||||
|
@ -1141,6 +1141,44 @@ uint32_t pios_com_vcp_id;
|
||||
uint32_t pios_com_gps_id;
|
||||
uint32_t pios_com_bridge_id;
|
||||
|
||||
/**
|
||||
* Configuration for the BMA180 chip
|
||||
*/
|
||||
#if defined(PIOS_INCLUDE_BMA180)
|
||||
#include "pios_bma180.h"
|
||||
static const struct pios_exti_cfg pios_exti_bma180_cfg __exti_config = {
|
||||
.vector = PIOS_BMA180_IRQHandler,
|
||||
.line = EXTI_Line13,
|
||||
.pin = {
|
||||
.gpio = GPIOC,
|
||||
.init = {
|
||||
.GPIO_Pin = GPIO_Pin_13,
|
||||
.GPIO_Speed = GPIO_Speed_10MHz,
|
||||
.GPIO_Mode = GPIO_Mode_IPU,
|
||||
},
|
||||
},
|
||||
.irq = {
|
||||
.init = {
|
||||
.NVIC_IRQChannel = EXTI15_10_IRQn,
|
||||
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW,
|
||||
.NVIC_IRQChannelSubPriority = 0,
|
||||
.NVIC_IRQChannelCmd = ENABLE,
|
||||
},
|
||||
},
|
||||
.exti = {
|
||||
.init = {
|
||||
.EXTI_Line = EXTI_Line13, // matches above GPIO pin
|
||||
.EXTI_Mode = EXTI_Mode_Interrupt,
|
||||
.EXTI_Trigger = EXTI_Trigger_Rising,
|
||||
.EXTI_LineCmd = ENABLE,
|
||||
},
|
||||
},
|
||||
};
|
||||
static const struct pios_bma180_cfg pios_bma180_cfg = {
|
||||
.exti_cfg = &pios_exti_bma180_cfg,
|
||||
};
|
||||
#endif /* PIOS_INCLUDE_BMA180 */
|
||||
|
||||
/**
|
||||
* Configuration for L3GD20 chip
|
||||
*/
|
||||
@ -1199,7 +1237,6 @@ void PIOS_Board_Init(void) {
|
||||
}
|
||||
|
||||
PIOS_Flash_W25X_Init(pios_spi_flash_accel_id, 1);
|
||||
PIOS_ADXL345_Init(pios_spi_flash_accel_id, 0);
|
||||
|
||||
PIOS_FLASHFS_Init();
|
||||
|
||||
@ -1700,6 +1737,7 @@ void PIOS_Board_Init(void) {
|
||||
|
||||
if(0) {
|
||||
PIOS_ADC_Init();
|
||||
PIOS_ADXL345_Init(pios_spi_flash_accel_id, 0);
|
||||
} else
|
||||
{
|
||||
// Revision 2 with L3GD20 gyros, start a SPI interface and connect to it
|
||||
@ -1711,6 +1749,9 @@ void PIOS_Board_Init(void) {
|
||||
|
||||
PIOS_L3GD20_Attach(pios_spi_gyro_id);
|
||||
PIOS_L3GD20_Init(&pios_l3gd20_cfg);
|
||||
|
||||
PIOS_BMA180_Attach(pios_spi_flash_accel_id);
|
||||
PIOS_BMA180_Init(&pios_bma180_cfg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user