fixedwing firmware now working on LIsa

This commit is contained in:
Antoine Drouin
2010-11-17 10:33:37 +00:00
committed by Felix Ruess
parent 6d10bdcb37
commit 4e383daddb
6 changed files with 39 additions and 26 deletions
+8 -7
View File
@@ -12,7 +12,7 @@
<target name="sim" board="pc"/>
<target name="ap" board="lisa_l_1.0"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="control"/>
<subsystem name="attitude" type="infrared"/>
@@ -21,9 +21,10 @@
</firmware>
<firmware name="lisa_l_test_progs">
<target name="test_led" board="lisa_l_1.0"/>
<target name="test_uart" board="lisa_l_1.0"/>
<target name="test_servos" board="lisa_l_1.0"/>
<target name="tunnel" board="lisa_l_1.0"/>
<target name="test_led" board="lisa_l_1.0"/>
<target name="test_uart" board="lisa_l_1.0"/>
<target name="test_servos" board="lisa_l_1.0"/>
<target name="test_telemetry" board="lisa_l_1.0"/>
<target name="test_baro" board="lisa_l_1.0"/>
<target name="test_imu_b2" board="lisa_l_1.0"/>
@@ -80,9 +81,9 @@
</section>
<section name="INFRARED" prefix="IR_">
<define name="ADC_IR1_NEUTRAL" value="512"/>
<define name="ADC_IR2_NEUTRAL" value="512"/>
<define name="ADC_TOP_NEUTRAL" value="512"/>
<define name="ADC_IR1_NEUTRAL" value="2048"/>
<define name="ADC_IR2_NEUTRAL" value="2048"/>
<define name="ADC_TOP_NEUTRAL" value="2048"/>
<define name="LATERAL_CORRECTION" value="-1"/>
<define name="LONGITUDINAL_CORRECTION" value="1"/>
+6 -3
View File
@@ -70,13 +70,16 @@ MODEM_UART_NR = 2
endif
ifndef ADC_IR1
ADC_IR1 = 1
ADC_IR1 = 1
ADC_IR1_CHAN = 0
endif
ifndef ADC_IR2
ADC_IR2 = 2
ADC_IR2 = 2
ADC_IR2_CHAN = 1
endif
ifndef ADC_IR3
ADC_IR_TOP = 3
ADC_IR_TOP = 3
ADC_IR_TOP_CHAN = 2
endif
ifndef ADC_IR_NB_SAMPLES
ADC_IR_NB_SAMPLES = 16
+5 -3
View File
@@ -91,6 +91,8 @@
#include <stm32/gpio.h>
#include <stm32/rcc.h>
#include <stm32/tim.h>
#include <string.h>
#include "std.h"
#include "led.h"
#include BOARD_CONFIG
@@ -369,14 +371,14 @@ void adc_init( void ) {
uint8_t channel;
#ifdef USE_AD1
for(channel = 0; channel < NB_ADC1_CHANNELS; channel++)
adc1_buffers[channel] = 0;
adc1_buffers[channel] = NULL;
#endif
#ifdef USE_AD2
for(channel = 0; channel < NB_ADC2_CHANNELS; channel++)
adc2_buffers[channel] = 0;
adc2_buffers[channel] = NULL;
#endif
adc_new_data_trigger = 0;
adc_new_data_trigger = FALSE;
adc_injected_channels[0] = ADC_InjectedChannel_1;
adc_injected_channels[1] = ADC_InjectedChannel_2;
adc_injected_channels[2] = ADC_InjectedChannel_3;
-10
View File
@@ -41,15 +41,7 @@
#define Ap(f)
#endif
#ifdef STM32
#include "init_hw.h"
#endif
int main( void ) {
#ifdef STM32
hw_init();
sys_time_init();
#endif
Fbw(init);
Ap(init);
InitSysTimePeriodic();
@@ -57,9 +49,7 @@ int main( void ) {
if (sys_time_periodic()) {
Fbw(periodic_task);
Ap(periodic_task);
#ifdef STM32
LED_PERIODIC();
#endif
}
Fbw(event_task);
Ap(event_task);
+9 -2
View File
@@ -508,7 +508,12 @@ void init_ap( void ) {
#ifdef USE_UART1
Uart1Init();
#endif
#ifdef USE_UART2
Uart2Init();
#endif
#ifdef USE_UART3
Uart3Init();
#endif
#ifdef USE_USB_SERIAL
VCOM_init();
#endif
@@ -520,10 +525,12 @@ void init_ap( void ) {
#ifdef USE_I2C0
i2c0_init();
#endif
#ifdef USE_I2C1
i2c1_init();
#endif
#ifdef USE_I2C2
i2c2_init();
#endif
/************* Links initialization ***************/
#if defined USE_SPI
+11 -1
View File
@@ -89,19 +89,29 @@ void init_fbw( void ) {
#ifdef LED
led_init();
#endif
#ifdef USE_UART0
uart0_init();
#endif
#ifdef USE_UART1
uart1_init();
#endif
#ifdef USE_UART2
uart2_init();
#endif
#ifdef USE_UART3
uart3_init();
#endif
// FIXME: remove STM32 flag
#ifndef STM32
#ifdef ADC
adc_init();
adc_buf_channel(ADC_CHANNEL_VSUPPLY, &vsupply_adc_buf, DEFAULT_AV_NB_SAMPLE);
# ifdef ADC_CHANNEL_CURRENT
adc_buf_channel(ADC_CHANNEL_CURRENT, &current_adc_buf, DEFAULT_AV_NB_SAMPLE);
adc_buf_channel(ADC_CHANNEL_CURRENT, &current_adc_buf, DEFAULT_AV_NB_SAMPLE);
# endif
#endif
#endif /* ! STM32 */
#ifdef ACTUATORS
actuators_init();
/* Load the failsafe defaults */