From 6a41ec7cecf4fc4faabac3c07569ad02b0b5fa3b Mon Sep 17 00:00:00 2001 From: Paul Cox Date: Thu, 22 Jul 2010 12:40:37 +0000 Subject: [PATCH] remove bench_sensors and replace with i2c and CAN versions conditionally compiled by conf --- conf/airframes/Poine/beth.xml | 20 ++++++++++--------- sw/airborne/beth/bench_sensors.c | 34 -------------------------------- 2 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 sw/airborne/beth/bench_sensors.c diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index e46e671c21..643b4393bd 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -99,7 +99,8 @@ main_stm32.srcs += downlink.c pprz_transport.c main_stm32.CFLAGS += -DUSE_OVERO_LINK -main_stm32.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageBethUp -DOVERO_LINK_MSG_DOWN=AutopilotMessageBethDown +#main_stm32.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageBethUp -DOVERO_LINK_MSG_DOWN=AutopilotMessageBethDown +main_stm32.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageFoo -DOVERO_LINK_MSG_DOWN=AutopilotMessageFoo main_stm32.CFLAGS += -DOVERO_LINK_LED_OK=5 -DOVERO_LINK_LED_KO=4 -DUSE_DMA1_C2_IRQ main_stm32.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c @@ -115,18 +116,18 @@ main_stm32.srcs += math/pprz_trig_int.c main_stm32.srcs += $(SRC_BOOZ)/booz2_commands.c main_stm32.srcs += $(SRC_BOOZ)/actuators/booz_actuators_asctec.c #\ -# $(SRC_BOOZ_ARCH)/actuators/booz_actuators_asctec_arch.c -main_stm32.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 -# -DBOOZ_START_DELAY=3 -# -DUSE_TIM2_IRQ +# $(SRC_BOOZ_ARCH)/actuators/booz_actuators_asctec_arch.c +main_stm32.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 +#-DBOOZ_START_DELAY=3 -DUSE_TIM2_IRQ main_stm32.CFLAGS += -DUSE_I2C1 main_stm32.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c -main_stm32.CFLAGS += -DUSE_I2C2 -main_stm32.srcs += $(SRC_BETH)/bench_sensors.c +#main_stm32.CFLAGS += -DUSE_I2C2 +#main_stm32.srcs += $(SRC_BETH)/bench_sensors_i2c.c -main_stm32.CFLAGS += -DUSE_CAN1 -DUSE_USB_LP_CAN1_RX0_IRQ -DBETH_HACK +main_stm32.CFLAGS += -DUSE_CAN1 -DUSE_USB_LP_CAN1_RX0_IRQ main_stm32.srcs += can.c $(SRC_ARCH)/can_hw.c +main_stm32.srcs += $(SRC_BETH)/bench_sensors_can.c # # Coders handled by a Olimex stm32h103 dev board @@ -178,7 +179,8 @@ main_overo.ARCHDIR = omap main_overo.CFLAGS = -I. -I$(SRC_FMS) main_overo.srcs = $(SRC_BETH)/main_overo.c main_overo.srcs += $(SRC_FMS)/fms_spi_link.c -main_overo.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageBethUp -DOVERO_LINK_MSG_DOWN=AutopilotMessageBethDown +#main_overo.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageBethUp -DOVERO_LINK_MSG_DOWN=AutopilotMessageBethDown +main_overo.CFLAGS += -DOVERO_LINK_MSG_UP=AutopilotMessageFoo -DOVERO_LINK_MSG_DOWN=AutopilotMessageFoo # diff --git a/sw/airborne/beth/bench_sensors.c b/sw/airborne/beth/bench_sensors.c deleted file mode 100644 index 500dda8f94..0000000000 --- a/sw/airborne/beth/bench_sensors.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "bench_sensors.h" - -struct BenchSensors bench_sensors,bench_sensors2; - - -void bench_sensors_init(void) { - bench_sensors.status = BS_IDLE; - bench_sensors.i2c_done = TRUE; -} - -void bench_sensors2_init(void) { - bench_sensors2.status = BS_IDLE; - bench_sensors2.i2c_done = TRUE; -} - - -void read_bench_sensors(void) { - - const uint8_t bench_addr = 0x40; - bench_sensors.status = BS_BUSY; - bench_sensors.i2c_done = FALSE; - i2c2_receive(bench_addr, 4, &bench_sensors.i2c_done); - -} - - -void read_bench_sensors2(void) { - - const uint8_t bench_addr2 = 0x30; - bench_sensors2.status = BS_BUSY; - bench_sensors2.i2c_done = FALSE; - i2c2_receive(bench_addr2, 4, &bench_sensors2.i2c_done); - -}