diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index a419019daa..6dced6002b 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -1,19 +1,32 @@ + + + + + + + + + + + + + @@ -218,7 +231,7 @@ - + @@ -228,22 +241,4 @@ - - -ap.CFLAGS += -DGUIDANCE_H_USE_REF - -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 -DUSE_PWM1 -ap.CFLAGS += -DBOOZ_ACTUATORS_MAX_THRUST=160 -DBOOZ_THRUST_LOWPASS=17 - -ap.srcs += $(SRC_BOOZ_ARCH)/booz2_pwm_hw.c - -sim.CFLAGS += -DBSM_PARAMS=\"booz_sensors_model_params_booz2_a2.h\" -sim.CFLAGS += -DNPS_NO_SUPERVISION - -sim.CFLAGS += -DGUIDANCE_H_USE_REF -sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 -sim.srcs += $(SRC_BOOZ_SIM)/booz2_pwm_hw.c - - - diff --git a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c similarity index 94% rename from sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c rename to sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c index 5c0081cab5..2dbf3c22ef 100644 --- a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.c +++ b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c @@ -1,7 +1,7 @@ /* * $Id: $ * - * Copyright (C) 2007 ENAC + * Copyright (C) 2011 ENAC * * This file is part of paparazzi. * @@ -22,12 +22,12 @@ * */ -#include "booz2_pwm_hw.h" +#include "modules/core/booz_pwm_arch.h" #define PWM_PERIOD SYS_TICS_OF_USEC(20000) #define PWM_DUTY SYS_TICS_OF_USEC(1500) -void booz2_pwm_init_hw( void ) { +void booz_pwm_init_arch( void ) { /* start PWM5 */ /* select P0.21 as PWM5 */ diff --git a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h similarity index 79% rename from sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h rename to sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h index f3289f41e4..b191caf29f 100644 --- a/sw/airborne/booz/arch/lpc21/booz2_pwm_hw.h +++ b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h @@ -1,7 +1,7 @@ /* * $Id: $ * - * Copyright (C) 2007 ENAC + * Copyright (C) 2011 ENAC * * This file is part of paparazzi. * @@ -22,25 +22,25 @@ * */ -#ifndef BOOZ2_PWM_HW_H -#define BOOZ2_PWM_HW_H +#ifndef BOOZ_PWM_ARCH_H +#define BOOZ_PWM_ARCH_H #include "std.h" #include "sys_time.h" -extern void booz2_pwm_init_hw(void); +extern void booz_pwm_init_arch(void); // Default PWM is PWM0 -#define Booz2SetPwmValue(_v) Booz2SetPwm0Value(_v) +#define BoozSetPwmValue(_v) BoozSetPwm0Value(_v) -#define Booz2SetPwm0Value(_v) { \ +#define BoozSetPwm0Value(_v) { \ PWMMR5 = SYS_TICS_OF_USEC(_v); \ PWMLER = PWMLER_LATCH5; \ } -#define Booz2SetPwm1Value(_v) { \ +#define BoozSetPwm1Value(_v) { \ PWMMR2 = SYS_TICS_OF_USEC(_v); \ PWMLER = PWMLER_LATCH2; \ } -#endif /* BOOZ2_PWM_HW_H */ +#endif /* BOOZ_PWM_ARCH_H */ diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c index 01a7f58b02..60205f57e1 100644 --- a/sw/airborne/firmwares/rotorcraft/main.c +++ b/sw/airborne/firmwares/rotorcraft/main.c @@ -55,10 +55,6 @@ #include "subsystems/ahrs.h" #include "subsystems/ins.h" -#if defined USE_CAM || USE_DROP -#include "booz2_pwm_hw.h" -#endif - #include "firmwares/rotorcraft/main.h" #ifdef SITL @@ -88,11 +84,13 @@ int main( void ) { STATIC_INLINE void main_init( void ) { +#ifndef NO_FUCKING_STARTUP_DELAY #ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT /* IF THIS IS NEEDED SOME PERHIPHERAL THEN PLEASE MOVE IT THERE */ for (uint32_t startup_counter=0; startup_counter<2000000; startup_counter++){ __asm("nop"); } +#endif #endif mcu_init(); @@ -105,10 +103,6 @@ STATIC_INLINE void main_init( void ) { booz2_analog_init(); baro_init(); -#if defined USE_CAM || USE_DROP - booz2_pwm_init_hw(); -#endif - battery_init(); imu_init(); diff --git a/sw/airborne/modules/cam_control/booz_cam.c b/sw/airborne/modules/cam_control/booz_cam.c index 80f509db57..c595b787b1 100644 --- a/sw/airborne/modules/cam_control/booz_cam.c +++ b/sw/airborne/modules/cam_control/booz_cam.c @@ -23,7 +23,7 @@ */ #include "cam_control/booz_cam.h" -#include "booz2_pwm_hw.h" +#include "modules/core/booz_pwm_arch.h" #include "subsystems/ahrs.h" #include "firmwares/rotorcraft/navigation.h" #include "subsystems/ins.h" @@ -64,7 +64,7 @@ int16_t booz_cam_pan; // PWM definition #ifndef BOOZ_CAM_SetPwm -#define BOOZ_CAM_SetPwm(_v) Booz2SetPwmValue(_v) +#define BOOZ_CAM_SetPwm(_v) BoozSetPwmValue(_v) #endif #ifndef BOOZ_CAM_DEFAULT_MODE diff --git a/sw/airborne/modules/drop/booz_drop.c b/sw/airborne/modules/drop/booz_drop.c index 2e2ba6c4d8..206c8a09f3 100644 --- a/sw/airborne/modules/drop/booz_drop.c +++ b/sw/airborne/modules/drop/booz_drop.c @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#include "booz_drop.h" -#include "booz2_pwm_hw.h" +#include "modules/drop/booz_drop.h" +#include "modules/core/booz_pwm_arch.h" #include "generated/airframe.h" bool_t booz_drop_ball; @@ -37,7 +37,7 @@ int16_t booz_drop_servo; // PWM definition #ifndef BoozDropPwm -#define BoozDropPwm(_v) Booz2SetPwmValue(_v) +#define BoozDropPwm(_v) BoozSetPwmValue(_v) #endif void booz_drop_init(void) {