diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index c7ae144ea7..932380943a 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -124,21 +124,21 @@ main_stm32.CFLAGS += -DOVERO_LINK_LED_OK=3 -DOVERO_LINK_LED_KO=4 -DUSE_DMA1_C2_I main_stm32.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c #booz IMU -#main_stm32.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +#main_stm32.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" #main_stm32.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -#main_stm32.srcs += $(SRC_BOOZ)/booz_imu.c +#main_stm32.srcs += $(SRC_BOOZ)/imu.c #main_stm32.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ -#main_stm32.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +#main_stm32.srcs += $(SRC_BOOZ)/imu/imu_b2.c $(SRC_BOOZ_ARCH)/imu/imu_b2_arch.c #main_stm32.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c #main_stm32.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c #main_stm32.srcs += math/pprz_trig_int.c #crista IMU main_stm32.srcs += math/pprz_trig_int.c -main_stm32.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_crista.h\" -DIMU_OVERRIDE_CHANNELS -main_stm32.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_crista.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_crista_arch.c +main_stm32.CFLAGS += -DIMU_TYPE_H=\"imu/imu_crista.h\" -DIMU_OVERRIDE_CHANNELS +main_stm32.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_crista.c \ + $(SRC_BOOZ_ARCH)/imu/imu_crista_arch.c main_stm32.CFLAGS += -DUSE_DMA1_C4_IRQ main_stm32.srcs += $(SRC_BOOZ)/booz2_commands.c diff --git a/conf/autopilot/lisa_l_test_progs.makefile b/conf/autopilot/lisa_l_test_progs.makefile index 3bc9acaf4b..81aeb4ee8d 100644 --- a/conf/autopilot/lisa_l_test_progs.makefile +++ b/conf/autopilot/lisa_l_test_progs.makefile @@ -48,7 +48,7 @@ SRC_BOOZ_TEST = $(SRC_BOOZ)/test #SRC_ROTORCRAFT=rotorcraft SRC_BOARD=boards/$(BOARD) - +SRC_FIRMWARE=firmwares/rotorcraft # # default configuration expected from the board files @@ -232,8 +232,8 @@ test_adc.CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER # MODEM_BAUD # test_imu_b2.ARCHDIR = $(ARCH) -test_imu_b2.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT -test_imu_b2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) +test_imu_b2.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT +test_imu_b2.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_imu_b2.srcs += $(SRC_BOOZ_TEST)/booz_test_imu.c \ $(SRC_ARCH)/stm32_exceptions.c \ $(SRC_ARCH)/stm32_vector_table.c @@ -254,13 +254,13 @@ test_imu_b2.srcs += downlink.c pprz_transport.c test_imu_b2.srcs += math/pprz_trig_int.c -test_imu_b2.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +test_imu_b2.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -DIMU_B2_VERSION_1_1 -test_imu_b2.srcs += $(SRC_BOOZ)/booz_imu.c +test_imu_b2.srcs += $(SRC_FIRMWARE)/imu.c test_imu_b2.CFLAGS += -DMAX_1168_DRDY_PORT=$(MAX_1168_DRDY_PORT) test_imu_b2.CFLAGS += -DMAX_1168_DRDY_PORT_SOURCE=$(MAX_1168_DRDY_PORT_SOURCE) test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ -test_imu_b2.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +test_imu_b2.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c 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 @@ -270,7 +270,7 @@ test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c $(SRC_BOOZ_ARCH)/peri # test IMU aspirin # test_imu_aspirin.ARCHDIR = $(ARCH) -test_imu_aspirin.CFLAGS = -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT +test_imu_aspirin.CFLAGS = -I$(SRC_FIRMWARE) -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -I$(SRC_LISA) -I$(ARCH) -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) -DPERIPHERALS_AUTO_INIT test_imu_aspirin.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) test_imu_aspirin.srcs += $(SRC_BOOZ_TEST)/booz_test_imu.c \ $(SRC_ARCH)/stm32_exceptions.c \ @@ -291,10 +291,10 @@ test_imu_aspirin.srcs += downlink.c pprz_transport.c test_imu_aspirin.srcs += math/pprz_trig_int.c -test_imu_aspirin.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS -test_imu_aspirin.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_aspirin.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_aspirin_arch.c +test_imu_aspirin.CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS +test_imu_aspirin.srcs += $(SRC_FIRMWARE)/imu.c \ + $(SRC_FIRMWARE)/imu/imu_aspirin.c \ + $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_aspirin_arch.c test_imu_aspirin.CFLAGS += -DUSE_I2C2 test_imu_aspirin.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c diff --git a/conf/autopilot/lisa_test_progs.makefile b/conf/autopilot/lisa_test_progs.makefile index 700bfde743..006d573b0b 100644 --- a/conf/autopilot/lisa_test_progs.makefile +++ b/conf/autopilot/lisa_test_progs.makefile @@ -420,11 +420,11 @@ test_imu_b2.srcs += downlink.c pprz_transport.c test_imu_b2.srcs += math/pprz_trig_int.c -test_imu_b2.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +test_imu_b2.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" test_imu_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -test_imu_b2.srcs += $(SRC_BOOZ)/booz_imu.c +test_imu_b2.srcs += $(SRC_BOOZ)/imu.c test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ -test_imu_b2.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +test_imu_b2.srcs += $(SRC_BOOZ)/imu/imu_b2.c $(SRC_BOOZ_ARCH)/imu/imu_b2_arch.c 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 @@ -454,10 +454,10 @@ 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 += -DIMU_TYPE_H=\"imu/imu_crista.h\" -DIMU_OVERRIDE_CHANNELS +test_imu_crista.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_crista.c \ + $(SRC_BOOZ_ARCH)/imu/imu_crista_arch.c test_imu_crista.CFLAGS += -DUSE_DMA1_C4_IRQ @@ -486,10 +486,10 @@ test_imu_aspirin.srcs += downlink.c pprz_transport.c test_imu_aspirin.srcs += math/pprz_trig_int.c -test_imu_aspirin.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS -test_imu_aspirin.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_aspirin.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_aspirin_arch.c +test_imu_aspirin.CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS +test_imu_aspirin.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_aspirin.c \ + $(SRC_BOOZ_ARCH)/imu/imu_aspirin_arch.c test_imu_aspirin.CFLAGS += -DUSE_I2C2 test_imu_aspirin.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c @@ -498,7 +498,7 @@ test_imu_aspirin.CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 test_imu_aspirin.CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2 test_imu_aspirin.CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA -#test_imu_aspirin.CFLAGS += -DI2C2_STOP_HANDLER=OnI2CDone -DI2C2_STOP_HANDLER_HEADER=\"imu/booz_imu_aspirin_arch.h\" +#test_imu_aspirin.CFLAGS += -DI2C2_STOP_HANDLER=OnI2CDone -DI2C2_STOP_HANDLER_HEADER=\"imu/imu_aspirin_arch.h\" #test_imu_aspirin.CFLAGS += -DUSE_DMA1_C4_IRQ @@ -1091,11 +1091,11 @@ ptw.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Ov ptw.srcs += downlink.c pprz_transport.c # IMU -ptw.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +ptw.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" ptw.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -ptw.srcs += $(SRC_BOOZ)/booz_imu.c +ptw.srcs += $(SRC_BOOZ)/imu.c ptw.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ -ptw.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +ptw.srcs += $(SRC_BOOZ)/imu/imu_b2.c $(SRC_BOOZ_ARCH)/imu/imu_b2_arch.c ptw.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c ptw.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c ptw.srcs += math/pprz_trig_int.c @@ -1312,10 +1312,10 @@ hs_gyro_aspirin.srcs += downlink.c pprz_transport.c hs_gyro_aspirin.srcs += math/pprz_trig_int.c -hs_gyro_aspirin.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS -hs_gyro_aspirin.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_aspirin.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_aspirin_arch.c +hs_gyro_aspirin.CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS +hs_gyro_aspirin.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_aspirin.c \ + $(SRC_BOOZ_ARCH)/imu/imu_aspirin_arch.c hs_gyro_aspirin.CFLAGS += -DUSE_I2C2 hs_gyro_aspirin.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c @@ -1350,11 +1350,11 @@ hs_gyro_b2.srcs += downlink.c pprz_transport.c hs_gyro_b2.srcs += math/pprz_trig_int.c -hs_gyro_b2.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +hs_gyro_b2.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" hs_gyro_b2.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -hs_gyro_b2.srcs += $(SRC_BOOZ)/booz_imu.c +hs_gyro_b2.srcs += $(SRC_BOOZ)/imu.c hs_gyro_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ -hs_gyro_b2.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +hs_gyro_b2.srcs += $(SRC_BOOZ)/imu/imu_b2.c $(SRC_BOOZ_ARCH)/imu/imu_b2_arch.c hs_gyro_b2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c hs_gyro_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c @@ -1383,10 +1383,10 @@ hs_gyro_crista.srcs += downlink.c pprz_transport.c hs_gyro_crista.srcs += math/pprz_trig_int.c -hs_gyro_crista.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_crista.h\" -DIMU_OVERRIDE_CHANNELS -hs_gyro_crista.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_crista.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_crista_arch.c +hs_gyro_crista.CFLAGS += -DIMU_TYPE_H=\"imu/imu_crista.h\" -DIMU_OVERRIDE_CHANNELS +hs_gyro_crista.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_crista.c \ + $(SRC_BOOZ_ARCH)/imu/imu_crista_arch.c hs_gyro_crista.CFLAGS += -DUSE_DMA1_C4_IRQ hs_gyro_crista.CFLAGS += -DMEASURED_SENSOR=gyro_unscaled.p -DMEASURED_SENSOR_NB=0 diff --git a/conf/autopilot/mercury.makefile b/conf/autopilot/mercury.makefile index a54e693d49..7750ea88c1 100644 --- a/conf/autopilot/mercury.makefile +++ b/conf/autopilot/mercury.makefile @@ -70,8 +70,8 @@ ap.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart1 ap.srcs += $(SRC_CSC)/csc_datalink.c ap.CFLAGS += -DPPRZ_TRIG_CONST=const -ap.srcs += $(SRC_CSC)/mercury_xsens.c $(SRC_BOOZ)/booz_imu.c math/pprz_trig_int.c -ap.CFLAGS += -DXSENS1_LINK=Uart0 -DBOOZ_IMU_TYPE_H=\"mercury_xsens.h\" +ap.srcs += $(SRC_CSC)/mercury_xsens.c $(SRC_BOOZ)/imu.c math/pprz_trig_int.c +ap.CFLAGS += -DXSENS1_LINK=Uart0 -DIMU_TYPE_H=\"mercury_xsens.h\" ap.srcs += $(SRC_BOOZ)/ahrs/ahrs_cmpl_euler.c $(SRC_BOOZ)/ahrs/ahrs_aligner.c ap.CFLAGS += -DFLOAT_T=float diff --git a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile index 961c00a7aa..030f9d2666 100644 --- a/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile +++ b/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile @@ -40,12 +40,12 @@ # imu Booz2 v1.1 -$(TARGET).CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +$(TARGET).CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" $(TARGET).CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 $(TARGET).CFLAGS += -DIMU_B2_VERSION_1_1 -$(TARGET).srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_b2.c \ - $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c +$(TARGET).srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_b2.c \ + $(SRC_BOOZ_ARCH)/imu/imu_b2_arch.c $(TARGET).srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c @@ -67,12 +67,12 @@ endif # Simulator # -sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" sim.CFLAGS += -DIMU_B2_VERSION_1_1 sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 -sim.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/imu/booz_imu_b2.c \ - $(SRC_BOOZ_SIM)/imu/booz_imu_b2_arch.c +sim.srcs += $(SRC_BOOZ)/imu.c \ + $(SRC_BOOZ)/imu/imu_b2.c \ + $(SRC_BOOZ_SIM)/imu/imu_b2_arch.c sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile index 42ec0a2ee9..1a0642b4c6 100644 --- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile @@ -85,7 +85,7 @@ sim.srcs += $(SRC_BOOZ)/booz2_battery.c sim.srcs += $(SRC_BOOZ)/booz2_analog.c $(SRC_BOOZ_SIM)/booz2_analog_hw.c -#sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" +#sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" #sim.CFLAGS += -DIMU_B2_VERSION_1_1 sim.srcs += $(SRC_FIRMWARE)/autopilot.c diff --git a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile index 5c00d4ce6d..9784f93bc6 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile @@ -39,7 +39,7 @@ # add imu arch to include directories ap.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_b2.h\" +ap.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" ap.CFLAGS += -DIMU_B2_VERSION_1_0 ap.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 ap.CFLAGS += -DSSP_VIC_SLOT=9 @@ -63,7 +63,7 @@ ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 # add imu arch to include directories sim.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_b2.h\" +sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" sim.CFLAGS += -DIMU_B2_VERSION_1_0 sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 sim.srcs += $(SRC_FIRMWARE)/imu.c \ diff --git a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile index 2c9a338e64..aed431018a 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile @@ -44,7 +44,7 @@ # add imu arch to include directories ap.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -imu_CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_b2.h\" +imu_CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" imu_CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 imu_CFLAGS += -DIMU_B2_VERSION_1_1 ap.srcs += $(SRC_FIRMWARE)/imu.c \ @@ -79,7 +79,7 @@ ap.srcs += $(imu_srcs) # add imu arch to include directories sim.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_b2.h\" +sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" sim.CFLAGS += -DIMU_B2_VERSION_1_1 sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 sim.srcs += $(SRC_FIRMWARE)/imu.c \ diff --git a/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile b/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile index 08b6138db6..5e64c6836d 100644 --- a/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile +++ b/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile @@ -63,7 +63,7 @@ # add imu arch to include directories ap.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_crista.h\" +ap.CFLAGS += -DIMU_TYPE_H=\"imu/imu_crista.h\" ap.srcs += $(SRC_FIRMWARE)/imu.c \ $(SRC_FIRMWARE)/imu/imu_crista.c \ $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_crista_arch.c @@ -80,7 +80,7 @@ ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2 # add imu arch to include directories sim.CFLAGS += -I$(SRC_FIRMWARE)/imu/arch/$(ARCH) -sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/imu_crista.h\" +sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_crista.h\" sim.srcs += $(SRC_FIRMWARE)/imu.c \ $(SRC_FIRMWARE)/imu/imu_crista.c \ $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_crista_arch.c diff --git a/sw/airborne/booz/test/booz_test_imu.c b/sw/airborne/booz/test/booz_test_imu.c index 6121178693..3b1e9a9e9a 100644 --- a/sw/airborne/booz/test/booz_test_imu.c +++ b/sw/airborne/booz/test/booz_test_imu.c @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Boston, MA 02111-1307, USA. */ #include @@ -74,16 +74,16 @@ static inline void main_periodic_task( void ) { }); #ifdef USE_I2C2 RunOnceEvery(111, { - DOWNLINK_SEND_I2C_ERRORS(DefaultChannel, - &i2c2_errors.ack_fail_cnt, - &i2c2_errors.miss_start_stop_cnt, - &i2c2_errors.arb_lost_cnt, - &i2c2_errors.over_under_cnt, - &i2c2_errors.pec_recep_cnt, - &i2c2_errors.timeout_tlow_cnt, - &i2c2_errors.smbus_alert_cnt, - &i2c2_errors.unexpected_event_cnt, - &i2c2_errors.last_unexpected_event); + DOWNLINK_SEND_I2C_ERRORS(DefaultChannel, + &i2c2_errors.ack_fail_cnt, + &i2c2_errors.miss_start_stop_cnt, + &i2c2_errors.arb_lost_cnt, + &i2c2_errors.over_under_cnt, + &i2c2_errors.pec_recep_cnt, + &i2c2_errors.timeout_tlow_cnt, + &i2c2_errors.smbus_alert_cnt, + &i2c2_errors.unexpected_event_cnt, + &i2c2_errors.last_unexpected_event); }); #endif if (cpu_time_sec > 1) imu_periodic(); @@ -107,25 +107,25 @@ static inline void on_gyro_accel_event(void) { if (cnt == 0) { DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, - &imu.gyro_unscaled.p, - &imu.gyro_unscaled.q, - &imu.gyro_unscaled.r); - + &imu.gyro_unscaled.p, + &imu.gyro_unscaled.q, + &imu.gyro_unscaled.r); + DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, - &imu.accel_unscaled.x, - &imu.accel_unscaled.y, - &imu.accel_unscaled.z); + &imu.accel_unscaled.x, + &imu.accel_unscaled.y, + &imu.accel_unscaled.z); } else if (cnt == 7) { DOWNLINK_SEND_BOOZ2_GYRO(DefaultChannel, - &imu.gyro.p, - &imu.gyro.q, - &imu.gyro.r); - + &imu.gyro.p, + &imu.gyro.q, + &imu.gyro.r); + DOWNLINK_SEND_BOOZ2_ACCEL(DefaultChannel, - &imu.accel.x, - &imu.accel.y, - &imu.accel.z); + &imu.accel.x, + &imu.accel.y, + &imu.accel.z); } } @@ -138,14 +138,14 @@ static inline void on_mag_event(void) { if (cnt%2) { DOWNLINK_SEND_BOOZ2_MAG(DefaultChannel, - &imu.mag.x, - &imu.mag.y, - &imu.mag.z); + &imu.mag.x, + &imu.mag.y, + &imu.mag.z); } else { DOWNLINK_SEND_IMU_MAG_RAW(DefaultChannel, - &imu.mag_unscaled.x, - &imu.mag_unscaled.y, - &imu.mag_unscaled.z); + &imu.mag_unscaled.x, + &imu.mag_unscaled.y, + &imu.mag_unscaled.z); } } diff --git a/sw/airborne/firmwares/rotorcraft/imu.h b/sw/airborne/firmwares/rotorcraft/imu.h index b029ebbcff..d5d2f22d86 100644 --- a/sw/airborne/firmwares/rotorcraft/imu.h +++ b/sw/airborne/firmwares/rotorcraft/imu.h @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_IMU_H -#define BOOZ_IMU_H +#ifndef IMU_H +#define IMU_H #include "math/pprz_algebra_int.h" #include "math/pprz_algebra_float.h" @@ -60,8 +60,8 @@ struct ImuFloat { }; /* underlying hardware */ -#ifdef BOOZ_IMU_TYPE_H -#include BOOZ_IMU_TYPE_H +#ifdef IMU_TYPE_H +#include IMU_TYPE_H #endif extern struct Imu imu; diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/lpc21/imu_crista_arch.h b/sw/airborne/firmwares/rotorcraft/imu/arch/lpc21/imu_crista_arch.h index d9e4de990f..b78edce613 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/lpc21/imu_crista_arch.h +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/lpc21/imu_crista_arch.h @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_IMU_INT_HW_H -#define BOOZ_IMU_INT_HW_H +#ifndef IMU_INT_HW_H +#define IMU_INT_HW_H #include "std.h" @@ -34,4 +34,4 @@ extern void ADS8344_start( void ); -#endif /* BOOZ_IMU_INT_HW_H */ +#endif /* IMU_INT_HW_H */ diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/sim/imu_crista_arch.h b/sw/airborne/firmwares/rotorcraft/imu/arch/sim/imu_crista_arch.h index 6f2f7d28c7..ff40503315 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/sim/imu_crista_arch.h +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/sim/imu_crista_arch.h @@ -26,8 +26,8 @@ * simulator plug for the crista imu arch dependant functions * */ -#ifndef BOOZ_IMU_CRISTA_ARCH_H -#define BOOZ_IMU_CRISTA_ARCH_H +#ifndef IMU_CRISTA_ARCH_H +#define IMU_CRISTA_ARCH_H #include "imu.h" @@ -38,4 +38,4 @@ extern void imu_feed_gyro_accel(void); extern void imu_feed_mag(void); -#endif /* BOOZ_IMU_CRISTA_HW_H */ +#endif /* IMU_CRISTA_HW_H */ diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_aspirin_arch.h b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_aspirin_arch.h index 79787800e9..f63fc7412a 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_aspirin_arch.h +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_aspirin_arch.h @@ -1,5 +1,5 @@ -#ifndef BOOZ_IMU_ASPIRIN_ARCH_H -#define BOOZ_IMU_ASPIRIN_ARCH_H +#ifndef IMU_ASPIRIN_ARCH_H +#define IMU_ASPIRIN_ARCH_H #include "imu.h" @@ -11,4 +11,4 @@ extern void adxl345_clear_rx_buf(void); extern void adxl345_start_reading_data(void); -#endif /* BOOZ_IMU_ASPIRIN_ARCH_H */ +#endif /* IMU_ASPIRIN_ARCH_H */ diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.c b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.c index 59a894e985..143ef8017c 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.c +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.c @@ -30,9 +30,9 @@ #include #include -#define BOOZ_IMU_SSP_STA_IDLE 0 -#define BOOZ_IMU_SSP_STA_BUSY_MAX1168 1 -#define BOOZ_IMU_SSP_STA_BUSY_MS2100 2 +#define IMU_SSP_STA_IDLE 0 +#define IMU_SSP_STA_BUSY_MAX1168 1 +#define IMU_SSP_STA_BUSY_MS2100 2 volatile uint8_t imu_ssp_status; @@ -70,13 +70,13 @@ void imu_b2_arch_init(void) { }; NVIC_Init(&NVIC_init_structure_spi); - imu_ssp_status = BOOZ_IMU_SSP_STA_IDLE; + imu_ssp_status = IMU_SSP_STA_IDLE; } void imu_periodic(void) { // check ssp idle - // ASSERT((imu_status == BOOZ_IMU_STA_IDLE), DEBUG_IMU, IMU_ERR_OVERUN); - imu_ssp_status = BOOZ_IMU_SSP_STA_BUSY_MAX1168; + // ASSERT((imu_status == IMU_STA_IDLE), DEBUG_IMU, IMU_ERR_OVERUN); + imu_ssp_status = IMU_SSP_STA_BUSY_MAX1168; Max1168ConfigureSPI(); SPI_Cmd(SPI2, ENABLE); booz_max1168_read(); @@ -85,26 +85,26 @@ void imu_periodic(void) { void dma1_c4_irq_handler(void) { switch (imu_ssp_status) { - case BOOZ_IMU_SSP_STA_BUSY_MAX1168: + case IMU_SSP_STA_BUSY_MAX1168: Max1168OnDmaIrq(); SPI_Cmd(SPI2, DISABLE); if (ms2001_status == MS2001_IDLE) { Ms2001SendReq(); - imu_ssp_status = BOOZ_IMU_SSP_STA_BUSY_MS2100; + imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; } else if (ms2001_status == MS2001_WAITING_EOC && Ms2001HasEOC()) { Ms2001ReadRes(); - imu_ssp_status = BOOZ_IMU_SSP_STA_BUSY_MS2100; + imu_ssp_status = IMU_SSP_STA_BUSY_MS2100; } else - imu_ssp_status = BOOZ_IMU_SSP_STA_IDLE; + imu_ssp_status = IMU_SSP_STA_IDLE; break; - case BOOZ_IMU_SSP_STA_BUSY_MS2100: + case IMU_SSP_STA_BUSY_MS2100: Ms2001OnDmaIrq(); break; default: // POST_ERROR(DEBUG_IMU, IMU_ERR_SUPRIOUS_DMA1_C4_IRQ); - imu_ssp_status = BOOZ_IMU_SSP_STA_IDLE; + imu_ssp_status = IMU_SSP_STA_IDLE; } } diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.h b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.h index 804f398e05..bae3ba02a2 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.h +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_b2_arch.h @@ -21,9 +21,9 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_IMU_B2_ARCH_H -#define BOOZ_IMU_B2_ARCH_H +#ifndef IMU_B2_ARCH_H +#define IMU_B2_ARCH_H -#endif /* BOOZ_IMU_B2_ARCH_H */ +#endif /* IMU_B2_ARCH_H */ diff --git a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_crista_arch.h b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_crista_arch.h index 44e527b1ac..f45b33a638 100644 --- a/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_crista_arch.h +++ b/sw/airborne/firmwares/rotorcraft/imu/arch/stm32/imu_crista_arch.h @@ -20,8 +20,8 @@ * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_IMU_CRISTA_ARCH_H -#define BOOZ_IMU_CRISTA_ARCH_H +#ifndef IMU_CRISTA_ARCH_H +#define IMU_CRISTA_ARCH_H #define ImuCristaArchPeriodic() { \ @@ -31,4 +31,4 @@ extern void ADS8344_start( void ); -#endif /* BOOZ_IMU_CRISTA_ARCH_H */ +#endif /* IMU_CRISTA_ARCH_H */