diff --git a/conf/autopilot/booz2_actuators_asctec.makefile b/conf/autopilot/booz2_actuators_asctec.makefile index 467f0a3da0..b3d4f479bd 100644 --- a/conf/autopilot/booz2_actuators_asctec.makefile +++ b/conf/autopilot/booz2_actuators_asctec.makefile @@ -8,5 +8,5 @@ ap.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c # asctec controllers sim.CFLAGS += -DACTUATORS=\"actuators_asctec_twi_blmc_hw.h\" -sim.srcs += $(SRC_BOOZ_ARCH)/actuators_asctec_twi_blmc_hw.c actuators.c +sim.srcs += $(SRC_BOOZ_SIM)/actuators_asctec_twi_blmc_hw.c actuators.c diff --git a/conf/autopilot/booz2_imu_b2v1.makefile b/conf/autopilot/booz2_imu_b2v1.makefile index 010a53db59..218fe51b6d 100644 --- a/conf/autopilot/booz2_imu_b2v1.makefile +++ b/conf/autopilot/booz2_imu_b2v1.makefile @@ -47,11 +47,11 @@ # # imu Booz2 v1 -ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_b2.h\" +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" ap.CFLAGS += -DSSP_VIC_SLOT=9 -ap.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ)/impl/booz_imu_b2.c \ - $(SRC_BOOZ_ARCH)/impl/booz_imu_b2_arch.c +ap.srcs += $(SRC_BOOZ)/booz_imu.c \ + $(SRC_BOOZ)/imu/booz_imu_b2.c \ + $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c ap.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 ap.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ @@ -62,3 +62,16 @@ ap.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 +# +# Simulator +# + +sim.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_b2.h\" +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)/peripherals/booz_max1168.c \ + $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c + diff --git a/conf/autopilot/booz2_imu_b2v1_1.makefile b/conf/autopilot/booz2_imu_b2v1_1.makefile index 1949861f25..675745aa60 100644 --- a/conf/autopilot/booz2_imu_b2v1_1.makefile +++ b/conf/autopilot/booz2_imu_b2v1_1.makefile @@ -47,17 +47,17 @@ # # imu Booz2 v1.1 -ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_b2.h\" +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\" ap.srcs += $(SRC_BOOZ)/booz_imu.c ap.CFLAGS += -DSSP_VIC_SLOT=9 -DIMU_B2_MAG_TYPE=IMU_B2_MAG_MS2001 -ap.srcs += $(SRC_BOOZ)/impl/booz_imu_b2.c \ - $(SRC_BOOZ_ARCH)/impl/booz_imu_b2_arch.c +ap.srcs += $(SRC_BOOZ)/imu/booz_imu_b2.c \ + $(SRC_BOOZ_ARCH)/imu/booz_imu_b2_arch.c ap.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 ap.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \ $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c -ap.CFLAGS += -DUSE_MICROMAG -DMICROMAG_DRDY_VIC_SLOT=11 +ap.CFLAGS += -DMS2001_DRDY_VIC_SLOT=11 ap.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \ $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c diff --git a/conf/autopilot/booz2_imu_crista.makefile b/conf/autopilot/booz2_imu_crista.makefile index ab5cb2df68..62cb80c18a 100644 --- a/conf/autopilot/booz2_imu_crista.makefile +++ b/conf/autopilot/booz2_imu_crista.makefile @@ -48,13 +48,14 @@ -ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"impl/booz_imu_crista.h\" +ap.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_crista.h\" ap.srcs += $(SRC_BOOZ)/booz_imu.c \ - $(SRC_BOOZ_IMPL)/booz_imu_crista.c \ - $(SRC_BOOZ_ARCH_IMPL)/booz_imu_crista_arch.c + $(SRC_BOOZ)/imu/booz_imu_crista.c \ + $(SRC_BOOZ_ARCH)/imu/booz_imu_crista_arch.c + ap.CFLAGS += -DUSE_I2C1 -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 -DI2C1_BUF_LEN=16 ap.CFLAGS += -DUSE_AMI601 -ap.srcs += $(SRC_BOOZ_PERIPH)/booz_ami601.c +ap.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c diff --git a/conf/autopilot/booz2_radio_control_ppm.makefile b/conf/autopilot/booz2_radio_control_ppm.makefile index d38b606d61..1d04b27026 100644 --- a/conf/autopilot/booz2_radio_control_ppm.makefile +++ b/conf/autopilot/booz2_radio_control_ppm.makefile @@ -1,7 +1,19 @@ - +# +# Autopilot +# ap.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 -ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"impl/booz_radio_control_ppm.h\" +ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"radio_control/booz_radio_control_ppm.h\" ap.CFLAGS += -DRADIO_CONTROL_TYPE_PPM ap.srcs += $(SRC_BOOZ)/booz_radio_control.c \ - $(SRC_BOOZ_IMPL)/booz_radio_control_ppm.c \ - $(SRC_BOOZ_ARCH_IMPL)/booz_radio_control_ppm_arch.c \ No newline at end of file + $(SRC_BOOZ)/radio_control/booz_radio_control_ppm.c \ + $(SRC_BOOZ_ARCH)/radio_control/booz_radio_control_ppm_arch.c + +# +# Simulator +# +sim.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 +sim.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"radio_control/booz_radio_control_ppm.h\" +sim.CFLAGS += -DRADIO_CONTROL_TYPE_PPM +sim.srcs += $(SRC_BOOZ)/booz_radio_control.c \ + $(SRC_BOOZ)/radio_control/booz_radio_control_ppm.c \ + $(SRC_BOOZ_SIM)/radio_contrl/booz_radio_control_ppm_arch.c diff --git a/conf/autopilot/booz2_radio_control_spektrum.makefile b/conf/autopilot/booz2_radio_control_spektrum.makefile index 92900e17bc..4b2eaf84e0 100644 --- a/conf/autopilot/booz2_radio_control_spektrum.makefile +++ b/conf/autopilot/booz2_radio_control_spektrum.makefile @@ -1,6 +1,6 @@ ap.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 -ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"impl/booz_radio_control_spektrum.h\" +ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"radio_control/booz_radio_control_spektrum.h\" ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=\"impl/booz_radio_control_spektrum_dx7se.h\" ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200 ap.CFLAGS += -DRADIO_CONTROL_LINK=Uart0 diff --git a/conf/autopilot/booz2_simulator_nps.makefile b/conf/autopilot/booz2_simulator_nps.makefile index 73e8974108..9d3e7951f2 100644 --- a/conf/autopilot/booz2_simulator_nps.makefile +++ b/conf/autopilot/booz2_simulator_nps.makefile @@ -9,7 +9,7 @@ JSBSIM_INC = $(JSBSIM_ROOT)/include/JSBSim JSBSIM_LIB = $(JSBSIM_ROOT)/lib SRC_BOOZ=booz -SRC_BOOZ_SIM = $(SRC_BOOZ)/sim +SRC_BOOZ_SIM = $(SRC_BOOZ)/arch/sim sim.ARCHDIR = $(ARCHI) @@ -42,9 +42,9 @@ sim.srcs = $(SIMDIR)/nps_main.c \ $(SIMDIR)/nps_flightgear.c \ -sim.srcs += $(SRC_BOOZ)/booz_trig_int.c \ - pprz_geodetic_float.c \ - pprz_geodetic_double.c \ +sim.srcs += math/pprz_trig_int.c \ + math/pprz_geodetic_float.c \ + math/pprz_geodetic_double.c \ @@ -66,15 +66,10 @@ sim.srcs += $(SRC_BOOZ)/booz2_telemetry.c \ sim.srcs += $(SRC_BOOZ)/booz2_commands.c -#sim.CFLAGS += -DRADIO_CONTROL -DRC_LED=1 -#sim.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c -sim.CFLAGS += -DUSE_RADIO_CONTROL -DRADIO_CONTROL_LED=1 -sim.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"booz_radio_control_ppm.h\" -sim.CFLAGS += -DRADIO_CONTROL_TYPE_PPM -sim.srcs += $(SRC_BOOZ)/booz_radio_control.c \ - $(SRC_BOOZ)/booz_radio_control_ppm.c \ - $(SRC_BOOZ_SIM)/booz_radio_control_ppm_hw.c +# +# +# sim.CFLAGS += -DBOOZ2_ANALOG_BARO_LED=2 -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' @@ -101,7 +96,7 @@ sim.srcs += $(SRC_BOOZ)/booz2_stabilization_attitude.c sim.srcs += $(SRC_BOOZ)/booz2_guidance_h.c sim.srcs += $(SRC_BOOZ)/booz2_guidance_v.c -sim.srcs += pprz_geodetic_int.c +sim.srcs += math/pprz_geodetic_int.c sim.srcs += $(SRC_BOOZ)/booz2_ins.c # vertical filter float version sim.srcs += $(SRC_BOOZ)/booz2_vf_float.c @@ -112,8 +107,4 @@ sim.srcs += $(SRC_BOOZ)/booz2_hf_float.c sim.srcs += $(SRC_BOOZ)/booz2_navigation.c -sim.srcs += $(SRC_BOOZ)/booz2_fms.c -sim.CFLAGS += -DBOOZ2_FMS_TYPE=BOOZ2_FMS_TYPE_TEST_SIGNAL -sim.srcs += $(SRC_BOOZ)/booz2_fms_test_signal.c - diff --git a/sw/airborne/arm7/sys_time_hw.c b/sw/airborne/arm7/sys_time_hw.c index 0e0f76bce9..d2aebba475 100644 --- a/sw/airborne/arm7/sys_time_hw.c +++ b/sw/airborne/arm7/sys_time_hw.c @@ -20,7 +20,7 @@ uint32_t sys_time_chrono; /* T0TC ticks */ #endif #if defined USE_RADIO_CONTROL && defined RADIO_CONTROL_TYPE_PPM -#include RADIO_CONTROL_TYPE_H +#include "radio_control/booz_radio_control_ppm.h" #else #define RADIO_CONTROL_PPM_IT 0x00 #endif diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_imu_b2_arch.c b/sw/airborne/booz/arch/lpc21/imu/booz_imu_b2_arch.c similarity index 100% rename from sw/airborne/booz/arch/lpc21/impl/booz_imu_b2_arch.c rename to sw/airborne/booz/arch/lpc21/imu/booz_imu_b2_arch.c diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_imu_b2_arch.h b/sw/airborne/booz/arch/lpc21/imu/booz_imu_b2_arch.h similarity index 100% rename from sw/airborne/booz/arch/lpc21/impl/booz_imu_b2_arch.h rename to sw/airborne/booz/arch/lpc21/imu/booz_imu_b2_arch.h diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_imu_crista_arch.c b/sw/airborne/booz/arch/lpc21/imu/booz_imu_crista_arch.c similarity index 100% rename from sw/airborne/booz/arch/lpc21/impl/booz_imu_crista_arch.c rename to sw/airborne/booz/arch/lpc21/imu/booz_imu_crista_arch.c diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_imu_crista_arch.h b/sw/airborne/booz/arch/lpc21/imu/booz_imu_crista_arch.h similarity index 100% rename from sw/airborne/booz/arch/lpc21/impl/booz_imu_crista_arch.h rename to sw/airborne/booz/arch/lpc21/imu/booz_imu_crista_arch.h diff --git a/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.c b/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.c index e8b74147e5..b41db8ea8b 100644 --- a/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.c +++ b/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.c @@ -14,13 +14,13 @@ static void EXTINT_ISR(void) __attribute__((naked)); void ms2001_arch_init( void ) { - Ms2001Unselect(); /* pin idles high */ /* configure SS pin */ + Ms2001Unselect(); /* pin idles high */ SetBit(MS2001_SS_IODIR, MS2001_SS_PIN); /* pin is output */ /* configure RESET pin */ - SetBit(MS2001_RESET_IODIR, MS2001_RESET_PIN); /* pin is output */ Ms2001Reset(); /* pin idles low */ + SetBit(MS2001_RESET_IODIR, MS2001_RESET_PIN); /* pin is output */ /* configure DRDY pin */ /* connected pin to EXINT */ @@ -32,8 +32,8 @@ void ms2001_arch_init( void ) { /* initialize interrupt vector */ VICIntSelect &= ~VIC_BIT( MS2001_DRDY_VIC_IT ); /* select EINT as IRQ source */ VICIntEnable = VIC_BIT( MS2001_DRDY_VIC_IT ); /* enable it */ - _VIC_CNTL(MICROMAG_DRDY_VIC_SLOT) = VIC_ENABLE | MS2001_DRDY_VIC_IT; - _VIC_ADDR(MICROMAG_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR; // address of the ISR + _VIC_CNTL(MS2001_DRDY_VIC_SLOT) = VIC_ENABLE | MS2001_DRDY_VIC_IT; + _VIC_ADDR(MS2001_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR; // address of the ISR } diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_radio_control_ppm_arch.c b/sw/airborne/booz/arch/lpc21/radio_control/booz_radio_control_ppm_arch.c similarity index 100% rename from sw/airborne/booz/arch/lpc21/impl/booz_radio_control_ppm_arch.c rename to sw/airborne/booz/arch/lpc21/radio_control/booz_radio_control_ppm_arch.c diff --git a/sw/airborne/booz/arch/lpc21/impl/booz_radio_control_ppm_arch.h b/sw/airborne/booz/arch/lpc21/radio_control/booz_radio_control_ppm_arch.h similarity index 92% rename from sw/airborne/booz/arch/lpc21/impl/booz_radio_control_ppm_arch.h rename to sw/airborne/booz/arch/lpc21/radio_control/booz_radio_control_ppm_arch.h index a30916fae2..bd42f99bcb 100644 --- a/sw/airborne/booz/arch/lpc21/impl/booz_radio_control_ppm_arch.h +++ b/sw/airborne/booz/arch/lpc21/radio_control/booz_radio_control_ppm_arch.h @@ -21,9 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ_RADIO_CONTROL_PPM_HW_H -#define BOOZ_RADIO_CONTROL_PPM_HW_H - +#ifndef BOOZ_RADIO_CONTROL_PPM_ARCH_H +#define BOOZ_RADIO_CONTROL_PPM_ARCH_H #include "LPC21xx.h" @@ -32,7 +31,6 @@ extern uint8_t booz_radio_control_ppm_cur_pulse; extern uint32_t booz_radio_control_ppm_last_pulse_time; -extern void booz_radio_control_ppm_arch_init ( void ); #define RADIO_CONTROL_PPM_IT PPM_CRI #define RADIO_CONTROL_PPM_ISR() { \ @@ -62,4 +60,4 @@ extern void booz_radio_control_ppm_arch_init ( void ); } -#endif /* BOOZ_RADIO_CONTROL_PPM_HW_H */ +#endif /* BOOZ_RADIO_CONTROL_PPM_ARCH_H */ diff --git a/sw/airborne/booz/arch/sim/booz2_max1168_sim.c b/sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.c similarity index 89% rename from sw/airborne/booz/arch/sim/booz2_max1168_sim.c rename to sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.c index f8cf89db2e..97ab97f782 100644 --- a/sw/airborne/booz/arch/sim/booz2_max1168_sim.c +++ b/sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.c @@ -21,8 +21,13 @@ * Boston, MA 02111-1307, USA. */ -#include "booz2_max1168.h" +#include "booz_imu.h" -void booz2_max1168_hw_init( void ) {} +void booz_imu_b2_arch_init(void) { + +} + +void booz_imu_periodic(void) { + +} -void booz2_max1168_read( void ) {} diff --git a/sw/airborne/booz/arch/sim/booz2_imu_b2_hw.h b/sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.h similarity index 81% rename from sw/airborne/booz/arch/sim/booz2_imu_b2_hw.h rename to sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.h index b069470405..e001586274 100644 --- a/sw/airborne/booz/arch/sim/booz2_imu_b2_hw.h +++ b/sw/airborne/booz/arch/sim/imu/booz_imu_b2_arch.h @@ -23,15 +23,14 @@ /* * - * simulator plug for the booz2 v1 imu hw funtions + * simulator plug for the booz2 v1 imu arch dependant functions * */ -#ifndef BOOZ2_IMU_B2_HW_H -#define BOOZ2_IMU_B2_HW_H +#ifndef BOOZ2_IMU_B2_ARCH_H +#define BOOZ2_IMU_B2_ARCH_H -extern void booz2_imu_b2_hw_init(void); -#define booz2_imu_feed_data() { \ +#define booz_imu_feed_gyro_accel() { \ booz2_max1168_values[IMU_GYRO_P_CHAN] = bsm.gyro->ve[AXIS_P]; \ booz2_max1168_values[IMU_GYRO_Q_CHAN] = bsm.gyro->ve[AXIS_Q]; \ booz2_max1168_values[IMU_GYRO_R_CHAN] = bsm.gyro->ve[AXIS_R]; \ @@ -41,11 +40,5 @@ extern void booz2_imu_b2_hw_init(void); booz2_max1168_status = STA_MAX1168_DATA_AVAILABLE; \ } -#ifdef USE_MICROMAG -#define Booz2ImuSpiEvent(_handler1,_handler2) {} -#else // NO MICROMAG -#define Booz2ImuSpiEvent(_handler) {} -#endif - #endif /* BOOZ2_IMU_B2_HW_H */ diff --git a/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.c b/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.c new file mode 100644 index 0000000000..6c8536431b --- /dev/null +++ b/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.c @@ -0,0 +1,28 @@ +/* + * $Id$ + * + * Copyright (C) 2008-2009 Antoine Drouin + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +#include "peripherals/booz_max1168.h" + +void booz_max1168_arch_init( void ) {} + +void booz_max1168_read( void ) {} diff --git a/sw/airborne/booz/arch/sim/booz2_max1168_hw.h b/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.h similarity index 95% rename from sw/airborne/booz/arch/sim/booz2_max1168_hw.h rename to sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.h index f10713aef1..e8aaf81afe 100644 --- a/sw/airborne/booz/arch/sim/booz2_max1168_hw.h +++ b/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.h @@ -30,6 +30,5 @@ #ifndef BOOZ2_MAX1168_HW_H #define BOOZ2_MAX1168_HW_H -extern void booz2_max1168_hw_init( void ); #endif /* BOOZ2_MAX1168_HW_H */ diff --git a/sw/airborne/booz/arch/sim/booz2_imu_b2_hw.c b/sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.c similarity index 91% rename from sw/airborne/booz/arch/sim/booz2_imu_b2_hw.c rename to sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.c index 5bfbf14e6c..bd958dd546 100644 --- a/sw/airborne/booz/arch/sim/booz2_imu_b2_hw.c +++ b/sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.c @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#include "booz2_imu_b2.h" +#include "booz_radio_control.h" -void booz2_imu_b2_hw_init(void) { +void booz_radio_control_ppm_arch_init ( void ) { } diff --git a/sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.h b/sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.h new file mode 100644 index 0000000000..a08114913e --- /dev/null +++ b/sw/airborne/booz/arch/sim/radio_control/booz_radio_control_ppm_arch.h @@ -0,0 +1,29 @@ +/* + * $Id$ + * + * Copyright (C) 2008-2009 Antoine Drouin + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +#ifndef BOOZ_RADIO_CONTROL_PPM_ARCH_H +#define BOOZ_RADIO_CONTROL_PPM_ARCH_H + + + +#endif /* BOOZ_RADIO_CONTROL_PPM_ARCH_H */ diff --git a/sw/airborne/booz/impl/booz_fms_datalink.c b/sw/airborne/booz/fms/booz_fms_datalink.c similarity index 100% rename from sw/airborne/booz/impl/booz_fms_datalink.c rename to sw/airborne/booz/fms/booz_fms_datalink.c diff --git a/sw/airborne/booz/impl/booz_fms_datalink.h b/sw/airborne/booz/fms/booz_fms_datalink.h similarity index 100% rename from sw/airborne/booz/impl/booz_fms_datalink.h rename to sw/airborne/booz/fms/booz_fms_datalink.h diff --git a/sw/airborne/booz/impl/booz_fms_test_signal.c b/sw/airborne/booz/fms/booz_fms_test_signal.c similarity index 100% rename from sw/airborne/booz/impl/booz_fms_test_signal.c rename to sw/airborne/booz/fms/booz_fms_test_signal.c diff --git a/sw/airborne/booz/impl/booz_fms_test_signal.h b/sw/airborne/booz/fms/booz_fms_test_signal.h similarity index 100% rename from sw/airborne/booz/impl/booz_fms_test_signal.h rename to sw/airborne/booz/fms/booz_fms_test_signal.h diff --git a/sw/airborne/booz/impl/booz_imu_b2.c b/sw/airborne/booz/imu/booz_imu_b2.c similarity index 100% rename from sw/airborne/booz/impl/booz_imu_b2.c rename to sw/airborne/booz/imu/booz_imu_b2.c diff --git a/sw/airborne/booz/impl/booz_imu_b2.h b/sw/airborne/booz/imu/booz_imu_b2.h similarity index 98% rename from sw/airborne/booz/impl/booz_imu_b2.h rename to sw/airborne/booz/imu/booz_imu_b2.h index fe833500fe..ccce8eb066 100644 --- a/sw/airborne/booz/impl/booz_imu_b2.h +++ b/sw/airborne/booz/imu/booz_imu_b2.h @@ -75,7 +75,7 @@ /* underlying architecture */ -#include "impl/booz_imu_b2_arch.h" +#include "imu/booz_imu_b2_arch.h" /* must be implemented by underlying architecture */ extern void booz_imu_b2_arch_init(void); diff --git a/sw/airborne/booz/impl/booz_imu_crista.c b/sw/airborne/booz/imu/booz_imu_crista.c similarity index 100% rename from sw/airborne/booz/impl/booz_imu_crista.c rename to sw/airborne/booz/imu/booz_imu_crista.c diff --git a/sw/airborne/booz/impl/booz_imu_crista.h b/sw/airborne/booz/imu/booz_imu_crista.h similarity index 98% rename from sw/airborne/booz/impl/booz_imu_crista.h rename to sw/airborne/booz/imu/booz_imu_crista.h index d8de88236f..7b2ca57153 100644 --- a/sw/airborne/booz/impl/booz_imu_crista.h +++ b/sw/airborne/booz/imu/booz_imu_crista.h @@ -64,7 +64,7 @@ extern bool_t ADS8344_available; #endif /* underlying architecture */ -#include "impl/booz_imu_crista_arch.h" +#include "imu/booz_imu_crista_arch.h" /* must be defined by underlying architecture */ extern void booz_imu_crista_arch_init(void); diff --git a/sw/airborne/booz/impl/booz_radio_control_ppm.c b/sw/airborne/booz/radio_control/booz_radio_control_ppm.c similarity index 100% rename from sw/airborne/booz/impl/booz_radio_control_ppm.c rename to sw/airborne/booz/radio_control/booz_radio_control_ppm.c diff --git a/sw/airborne/booz/impl/booz_radio_control_ppm.h b/sw/airborne/booz/radio_control/booz_radio_control_ppm.h similarity index 78% rename from sw/airborne/booz/impl/booz_radio_control_ppm.h rename to sw/airborne/booz/radio_control/booz_radio_control_ppm.h index a3f955dab7..5cb3efe516 100644 --- a/sw/airborne/booz/impl/booz_radio_control_ppm.h +++ b/sw/airborne/booz/radio_control/booz_radio_control_ppm.h @@ -24,12 +24,21 @@ #ifndef BOOZ_RADIO_CONTROL_PPM_H #define BOOZ_RADIO_CONTROL_PPM_H -#include "impl/booz_radio_control_ppm_arch.h" - -#include "conf_radio_control_ppm.h" /* generated code */ +/** + * Architecture dependant code + */ +#include "radio_control/booz_radio_control_ppm_arch.h" +/* must be implemented by arch dependant code */ +extern void booz_radio_control_ppm_arch_init ( void ); /** - * Radio control type : futaba is falling edge clocked whereas JR is rising edge + * Generated code holding the description of a given + * transmitter + */ +#include "conf_radio_control_ppm.h" + +/** + * ppm pulse type : futaba is falling edge clocked whereas JR is rising edge */ #define PPM_PULSE_TYPE_POSITIVE 0 #define PPM_PULSE_TYPE_NEGATIVE 1 diff --git a/sw/airborne/booz/impl/booz_radio_control_spektrum.c b/sw/airborne/booz/radio_control/booz_radio_control_spektrum.c similarity index 100% rename from sw/airborne/booz/impl/booz_radio_control_spektrum.c rename to sw/airborne/booz/radio_control/booz_radio_control_spektrum.c diff --git a/sw/airborne/booz/impl/booz_radio_control_spektrum.h b/sw/airborne/booz/radio_control/booz_radio_control_spektrum.h similarity index 100% rename from sw/airborne/booz/impl/booz_radio_control_spektrum.h rename to sw/airborne/booz/radio_control/booz_radio_control_spektrum.h diff --git a/sw/airborne/booz/impl/booz_radio_control_spektrum_dx7se.h b/sw/airborne/booz/radio_control/booz_radio_control_spektrum_dx7se.h similarity index 100% rename from sw/airborne/booz/impl/booz_radio_control_spektrum_dx7se.h rename to sw/airborne/booz/radio_control/booz_radio_control_spektrum_dx7se.h diff --git a/sw/simulator/nps_fdm.h b/sw/simulator/nps_fdm.h index 5bd9022618..9947d43da9 100644 --- a/sw/simulator/nps_fdm.h +++ b/sw/simulator/nps_fdm.h @@ -3,8 +3,8 @@ #include "std.h" -#include "pprz_geodetic_double.h" -#include "pprz_algebra_double.h" +#include "math/pprz_geodetic_double.h" +#include "math/pprz_algebra_double.h" /* Notations for fdm variables diff --git a/sw/simulator/nps_fdm_jsbsim.c b/sw/simulator/nps_fdm_jsbsim.c index 0de601bd8d..201c92965c 100644 --- a/sw/simulator/nps_fdm_jsbsim.c +++ b/sw/simulator/nps_fdm_jsbsim.c @@ -5,11 +5,11 @@ #include "nps_fdm.h" #include "6dof.h" #include "airframe.h" -#include "pprz_geodetic.h" -#include "pprz_geodetic_double.h" -#include "pprz_geodetic_float.h" -#include "pprz_algebra.h" -#include "pprz_algebra_float.h" +#include "math/pprz_geodetic.h" +#include "math/pprz_geodetic_double.h" +#include "math/pprz_geodetic_float.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_float.h" #define MetersOfFeet(_f) ((_f)/3.2808399) @@ -118,7 +118,8 @@ static void test123(LlaCoor_d* fdm_lla, FGPropagate* propagate) { fdm_lla->lat = propagate->GetLatitude(); fdm_lla->lon = propagate->GetLongitude(); - fdm_lla->alt = MetersOfFeet(propagate->Geth()); + // FIXME + // fdm_lla->alt = MetersOfFeet(propagate->Geth()); } diff --git a/sw/simulator/nps_ivy.c b/sw/simulator/nps_ivy.c index f9283cbfbd..098a474059 100644 --- a/sw/simulator/nps_ivy.c +++ b/sw/simulator/nps_ivy.c @@ -5,7 +5,7 @@ #include #include "airframe.h" -#include "pprz_algebra_double.h" +#include "math/pprz_algebra_double.h" #include "nps_autopilot.h" #include "nps_fdm.h" diff --git a/sw/simulator/nps_random.h b/sw/simulator/nps_random.h index 73165d918f..8a4bfa08df 100644 --- a/sw/simulator/nps_random.h +++ b/sw/simulator/nps_random.h @@ -1,7 +1,7 @@ #ifndef NPS_RANDOM_H #define NPS_RANDOM_H -#include "pprz_algebra_double.h" +#include "math/pprz_algebra_double.h" extern double get_gaussian_noise(void); extern void double_vect3_add_gaussian_noise(struct DoubleVect3* vect, struct DoubleVect3* std_dev); diff --git a/sw/simulator/nps_sensor_accel.h b/sw/simulator/nps_sensor_accel.h index d6ce4b5e15..4b641994b2 100644 --- a/sw/simulator/nps_sensor_accel.h +++ b/sw/simulator/nps_sensor_accel.h @@ -1,9 +1,9 @@ #ifndef NPS_SENSOR_ACCEL_H #define NPS_SENSOR_ACCEL_H -#include "pprz_algebra.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_float.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_float.h" #include "std.h" struct NpsSensorAccel { diff --git a/sw/simulator/nps_sensor_baro.h b/sw/simulator/nps_sensor_baro.h index c0110a1749..06630b066d 100644 --- a/sw/simulator/nps_sensor_baro.h +++ b/sw/simulator/nps_sensor_baro.h @@ -1,9 +1,9 @@ #ifndef NPS_SENSOR_BARO_H #define NPS_SENSOR_BARO_H -#include "pprz_algebra.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_float.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_float.h" #include "std.h" struct NpsSensorBaro { diff --git a/sw/simulator/nps_sensor_gps.h b/sw/simulator/nps_sensor_gps.h index c5bb4da8cc..952cd68f4a 100644 --- a/sw/simulator/nps_sensor_gps.h +++ b/sw/simulator/nps_sensor_gps.h @@ -1,10 +1,10 @@ #ifndef NPS_SENSOR_GPS_H #define NPS_SENSOR_GPS_H -#include "pprz_algebra.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_float.h" -#include "pprz_geodetic_double.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_float.h" +#include "math/pprz_geodetic_double.h" #include "std.h" diff --git a/sw/simulator/nps_sensor_gyro.h b/sw/simulator/nps_sensor_gyro.h index cc7b454941..f6568b2518 100644 --- a/sw/simulator/nps_sensor_gyro.h +++ b/sw/simulator/nps_sensor_gyro.h @@ -1,9 +1,9 @@ #ifndef NPS_SENSOR_GYRO_H #define NPS_SENSOR_GYRO_H -#include "pprz_algebra.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_float.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_float.h" #include "std.h" struct NpsSensorGyro { diff --git a/sw/simulator/nps_sensor_mag.h b/sw/simulator/nps_sensor_mag.h index 5066233cb8..8eda06160c 100644 --- a/sw/simulator/nps_sensor_mag.h +++ b/sw/simulator/nps_sensor_mag.h @@ -1,9 +1,9 @@ #ifndef NPS_SENSOR_MAG_H #define NPS_SENSOR_MAG_H -#include "pprz_algebra.h" -#include "pprz_algebra_double.h" -#include "pprz_algebra_float.h" +#include "math/pprz_algebra.h" +#include "math/pprz_algebra_double.h" +#include "math/pprz_algebra_float.h" #include "std.h" struct NpsSensorMag { diff --git a/sw/simulator/nps_sensors.h b/sw/simulator/nps_sensors.h index 0b4a49877d..2a017cc780 100644 --- a/sw/simulator/nps_sensors.h +++ b/sw/simulator/nps_sensors.h @@ -1,7 +1,7 @@ #ifndef NPS_SENSORS_H #define NPS_SENSORS_H -#include "pprz_algebra.h" +#include "math/pprz_algebra.h" #include "nps_sensor_gyro.h" #include "nps_sensor_accel.h" #include "nps_sensor_mag.h"