From da947808c06f76ebc66c122472bc42b6d6b91aef Mon Sep 17 00:00:00 2001 From: Antoine Drouin Date: Fri, 16 Jul 2010 23:44:28 +0000 Subject: [PATCH] added hmc5843, crista and fixed servo test --- conf/autopilot/lisa_test_progs.makefile | 66 ++++++++++++++++++++++++- sw/airborne/lisa/test_mc2.c | 12 ++++- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/conf/autopilot/lisa_test_progs.makefile b/conf/autopilot/lisa_test_progs.makefile index 1e5b437a25..ff30b14cc6 100644 --- a/conf/autopilot/lisa_test_progs.makefile +++ b/conf/autopilot/lisa_test_progs.makefile @@ -315,8 +315,8 @@ test_servos.CFLAGS = -I$(SRC_LISA) -I$(ARCHI) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) test_servos.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_servos.LDFLAGS += -lm test_servos.srcs += $(SRC_LISA)/test_servos.c \ - $(SRC_LISA)/exceptions.c \ - $(SRC_LISA)/vector_table.c + $(SRC_ARCH)/stm32_exceptions.c \ + $(SRC_ARCH)/stm32_vector_table.c test_servos.CFLAGS += -DUSE_LED test_servos.srcs += $(SRC_ARCH)/led_hw.c test_servos.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 @@ -430,6 +430,40 @@ test_imu_b2.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_ test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c + +# +# test IMU crista +# +test_imu_crista.ARCHDIR = $(ARCHI) +test_imu_crista.TARGET = test_imu_crista +test_imu_crista.TARGETDIR = test_imu_crista +test_imu_crista.CFLAGS = -I$(SRC_LISA) -I$(ARCHI) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT +test_imu_crista.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) +test_imu_crista.srcs += $(SRC_BOOZ_TEST)/booz2_test_imu_b2.c \ + $(SRC_ARCH)/stm32_exceptions.c \ + $(SRC_ARCH)/stm32_vector_table.c + +test_imu_crista.CFLAGS += -DUSE_LED +test_imu_crista.srcs += $(SRC_ARCH)/led_hw.c + +test_imu_crista.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 +test_imu_crista.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' +test_imu_crista.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c + +test_imu_crista.CFLAGS += -DUSE_UART3 -DUART3_BAUD=B57600 +test_imu_crista.srcs += $(SRC_ARCH)/uart_hw.c + +test_imu_crista.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart3 +test_imu_crista.srcs += downlink.c pprz_transport.c + +test_imu_crista.srcs += math/pprz_trig_int.c + +test_imu_crista.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_crista.h\" -DIMU_OVERRIDE_CHANNELS +test_imu_crista.srcs += $(SRC_BOOZ)/booz_imu.c \ + $(SRC_BOOZ)/imu/booz_imu_crista.c \ + $(SRC_BOOZ_ARCH)/imu/booz_imu_crista_arch.c +test_imu_crista.CFLAGS += -DUSE_DMA1_C4_IRQ + # # test motor controllers # @@ -685,6 +719,34 @@ test_baro3.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +# +# test hmc5843 +# +test_hmc5843.ARCHDIR = $(ARCHI) +test_hmc5843.TARGET = test_hmc5843 +test_hmc5843.TARGETDIR = test_hmc5843 +test_hmc5843.CFLAGS = -I$(SRC_LISA) -I$(ARCHI) -Ibooz -DPERIPHERALS_AUTO_INIT +test_hmc5843.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) +test_hmc5843.srcs = booz/test/booz_test_hmc5843.c \ + $(SRC_ARCH)/stm32_exceptions.c \ + $(SRC_ARCH)/stm32_vector_table.c +test_hmc5843.CFLAGS += -DUSE_LED +test_hmc5843.srcs += $(SRC_ARCH)/led_hw.c +test_hmc5843.CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_LED=1 +test_hmc5843.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)' +test_hmc5843.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c + +test_hmc5843.CFLAGS += -DUSE_UART2 -DUART2_BAUD=B57600 +test_hmc5843.srcs += $(SRC_ARCH)/uart_hw.c + +test_hmc5843.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart2 +test_hmc5843.srcs += downlink.c pprz_transport.c + +test_hmc5843.srcs += booz/peripherals/booz_hmc5843.c +test_hmc5843.CFLAGS += -DUSE_I2C2 +test_hmc5843.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +test_hmc5843.CFLAGS += -DIMU_OVERRIDE_CHANNELS + diff --git a/sw/airborne/lisa/test_mc2.c b/sw/airborne/lisa/test_mc2.c index a4881ccda8..6ee7487d91 100644 --- a/sw/airborne/lisa/test_mc2.c +++ b/sw/airborne/lisa/test_mc2.c @@ -24,6 +24,7 @@ #include "init_hw.h" #include "sys_time.h" +#include "led.h" static inline void main_init( void ); static inline void main_periodic_task( void ); @@ -52,8 +53,15 @@ static inline void main_init( void ) { static inline void main_periodic_task( void ) { - i2c1_buf[0] = 0x00; - i2c1_transmit(0x58, 1, &i2c_done); + // LED_ON(4); + // static uint16_t i = 1000; + // if (i) i--; + // else { + // LED_OFF(4); + LED_ON(5); + i2c1_buf[0] = 0x04; + i2c1_transmit(0x58, 1, &i2c_done); + // } LED_PERIODIC();