diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index bfdaa7420aa..379728374ce 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -1,11 +1,8 @@ - + + @@ -54,8 +51,8 @@ - - + + @@ -63,13 +60,15 @@ + - - - + + + +
@@ -230,12 +229,6 @@
-
- - - -
-
diff --git a/conf/messages.xml b/conf/messages.xml index 3322b460b5b..51db3830318 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -737,7 +737,7 @@ - + diff --git a/conf/modules/booz_drop.xml b/conf/modules/booz_drop.xml deleted file mode 100644 index 2b3355bb72e..00000000000 --- a/conf/modules/booz_drop.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Drop control for BOOZ board - - - - -
- -
- - - - - - -
- diff --git a/conf/modules/booz_pwm.xml b/conf/modules/booz_pwm.xml deleted file mode 100644 index 422c7f03014..00000000000 --- a/conf/modules/booz_pwm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - Allow to use PWM output on booz boards, PWM0 is activated by default (PWM5 on lpc21 output) - - -
- -
- - - - -
- diff --git a/conf/modules/servo_switch.xml b/conf/modules/servo_switch.xml index 175747143c4..0c175a2e04d 100644 --- a/conf/modules/servo_switch.xml +++ b/conf/modules/servo_switch.xml @@ -5,7 +5,7 @@ Servo switch - +
@@ -17,10 +17,14 @@ diff --git a/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c deleted file mode 100644 index 45579d79928..00000000000 --- a/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * $Id: $ - * - * Copyright (C) 2011 ENAC - * - * 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 "modules/core/booz_pwm_arch.h" - -#define PWM_PERIOD CPU_TICKS_OF_USEC(20000) -#define PWM_DUTY CPU_TICKS_OF_USEC(1500) - -void booz_pwm_init_arch( void ) { - - /* start PWM5 */ - /* select P0.21 as PWM5 */ - PWM0_PINSEL |= PWM0_PINSEL_VAL << PWM0_PINSEL_BIT; - /* select pwm period */ - PWMMR0 = PWM_PERIOD; - /* select pwm value to 50% at init (1500 us) */ - PWMMR5 = PWM_DUTY; - /* commit values */ - PWMLER = PWMLER_LATCH0 | PWMLER_LATCH5; - /* prescle timer to match TIMER 0 (15MHz) */ - PWMPR = T0_PCLK_DIV - 1; - /* enable counter and pwm mode */ - PWMTCR = PWMTCR_COUNTER_ENABLE | PWMTCR_PWM_ENABLE; - /* enable PWM5 */ - PWMPCR = PWMPCR_ENA5; - -#ifdef USE_PWM1 - /* start PWM2 */ - PWM1_PINSEL |= PWM1_PINSEL_VAL << PWM1_PINSEL_BIT; - /* select pwm value to 50% at init (1500 us) */ - PWMMR2 = PWM_DUTY; - /* commit values */ - PWMLER = PWMLER_LATCH2; - /* enable PWM2 */ - PWMPCR |= PWMPCR_ENA2; -#endif - - -} diff --git a/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h b/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h deleted file mode 100644 index 567b5793fa7..00000000000 --- a/sw/airborne/arch/lpc21/modules/core/booz_pwm_arch.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * $Id: $ - * - * Copyright (C) 2011 ENAC - * - * 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_PWM_ARCH_H -#define BOOZ_PWM_ARCH_H - -#include "std.h" -#include "mcu_periph/sys_time.h" - -extern void booz_pwm_init_arch(void); - -// Default PWM is PWM0 -#define BoozSetPwmValue(_v) BoozSetPwm0Value(_v) - -#define BoozSetPwm0Value(_v) { \ - PWMMR5 = CPU_TICKS_OF_USEC(_v); \ - PWMLER = PWMLER_LATCH5; \ -} - -#define BoozSetPwm1Value(_v) { \ - PWMMR2 = CPU_TICKS_OF_USEC(_v); \ - PWMLER = PWMLER_LATCH2; \ -} - -#endif /* BOOZ_PWM_ARCH_H */ diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h index 12161a08fe4..ba7d1f08a1c 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.h +++ b/sw/airborne/firmwares/rotorcraft/telemetry.h @@ -136,6 +136,12 @@ #define PERIODIC_SEND_PPM(_trans, _dev) {} #endif +#ifdef ACTUATORS +#define PERIODIC_SEND_ACTUATORS(_trans, _dev) DOWNLINK_SEND_ACTUATORS(_trans, _dev, ACTUATORS_NB, actuators) +#else +#define PERIODIC_SEND_ACTUATORS(_trans, _dev) {} +#endif + #define PERIODIC_SEND_IMU_GYRO_SCALED(_trans, _dev) { \ DOWNLINK_SEND_IMU_GYRO_SCALED(_trans, _dev, \ &imu.gyro.p, \ diff --git a/sw/airborne/modules/drop/booz_drop.c b/sw/airborne/modules/drop/booz_drop.c deleted file mode 100644 index 206c8a09f38..00000000000 --- a/sw/airborne/modules/drop/booz_drop.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id: $ - * - * Copyright (C) 2009 Flixr - * - * 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 "modules/drop/booz_drop.h" -#include "modules/core/booz_pwm_arch.h" -#include "generated/airframe.h" - -bool_t booz_drop_ball; -int16_t booz_drop_servo; - -#ifndef DROP_SERVO_OPEN -#define DROP_SERVO_OPEN 1700 -#endif -#ifndef DROP_SERVO_CLOSED -#define DROP_SERVO_CLOSED 900 -#endif - -// PWM definition -#ifndef BoozDropPwm -#define BoozDropPwm(_v) BoozSetPwmValue(_v) -#endif - -void booz_drop_init(void) { - booz_drop_ball = FALSE; - booz_drop_periodic(); -} - -void booz_drop_periodic(void) { - if (booz_drop_ball == TRUE) - booz_drop_servo = DROP_SERVO_OPEN; - else - booz_drop_servo = DROP_SERVO_CLOSED; - BoozDropPwm(booz_drop_servo); -} diff --git a/sw/airborne/modules/drop/booz_drop.h b/sw/airborne/modules/drop/booz_drop.h deleted file mode 100644 index c1b01823051..00000000000 --- a/sw/airborne/modules/drop/booz_drop.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id: $ - * - * Copyright (C) 2009 Flixr - * - * 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_DROP_H -#define BOOZ_DROP_H - -#include "std.h" - -extern bool_t booz_drop_ball; - -extern void booz_drop_init(void); -extern void booz_drop_periodic(void); - -#define NavDropNow() ({ booz_drop_ball = TRUE; FALSE; }) -#define NavDropClose() ({ booz_drop_ball = FALSE; FALSE; }) - -#endif /* BOOZ_DROP_H */ diff --git a/sw/airborne/modules/servo_switch/servo_switch.c b/sw/airborne/modules/servo_switch/servo_switch.c index 2d90ae53e68..568dee2ecb9 100644 --- a/sw/airborne/modules/servo_switch/servo_switch.c +++ b/sw/airborne/modules/servo_switch/servo_switch.c @@ -1,6 +1,4 @@ /* - * $Id: $ - * * Copyright (C) 2010 Flixr * * This file is part of paparazzi. @@ -23,10 +21,9 @@ #include "servo_switch/servo_switch.h" #include "generated/airframe.h" -#include "actuators.h" +#include "firmwares/rotorcraft/commands.h" bool_t servo_switch_on; -int16_t servo_switch_value; void servo_switch_init(void) { servo_switch_on = FALSE; @@ -35,7 +32,7 @@ void servo_switch_init(void) { void servo_switch_periodic(void) { if (servo_switch_on == TRUE) - SetServo(SERVO_SWITCH_SERVO, SERVO_SWITCH_ON_VALUE) + commands[SERVO_SWITCH_SERVO] = SERVO_SWITCH_ON_VALUE; else - SetServo(SERVO_SWITCH_SERVO, SERVO_SWITCH_OFF_VALUE) + commands[SERVO_SWITCH_SERVO] = SERVO_SWITCH_OFF_VALUE; } diff --git a/sw/airborne/modules/servo_switch/servo_switch.h b/sw/airborne/modules/servo_switch/servo_switch.h index 24a5a60da2d..0edbf0bd72f 100644 --- a/sw/airborne/modules/servo_switch/servo_switch.h +++ b/sw/airborne/modules/servo_switch/servo_switch.h @@ -31,13 +31,13 @@ extern bool_t servo_switch_on; extern int16_t servo_switch_value; #ifndef SERVO_SWITCH_ON_VALUE -#define SERVO_SWITCH_ON_VALUE 2000 +#define SERVO_SWITCH_ON_VALUE MAX_PPRZ #endif #ifndef SERVO_SWITCH_OFF_VALUE -#define SERVO_SWITCH_OFF_VALUE 1000 +#define SERVO_SWITCH_OFF_VALUE -MAX_PPRZ #endif #ifndef SERVO_SWITCH_SERVO -#define SERVO_SWITCH_SERVO SERVO_SWITCH +#define SERVO_SWITCH_SERVO COMMAND_SWITCH #endif diff --git a/sw/airborne/subsystems/actuators.c b/sw/airborne/subsystems/actuators.c index 907e24ad9d7..a2789ca7689 100644 --- a/sw/airborne/subsystems/actuators.c +++ b/sw/airborne/subsystems/actuators.c @@ -29,7 +29,7 @@ #if ACTUATORS_NB -uint16_t actuators[ACTUATORS_NB]; +int16_t actuators[ACTUATORS_NB]; void actuators_init(void) { diff --git a/sw/airborne/subsystems/actuators.h b/sw/airborne/subsystems/actuators.h index 7a71c96bc60..f06950634cb 100644 --- a/sw/airborne/subsystems/actuators.h +++ b/sw/airborne/subsystems/actuators.h @@ -40,7 +40,7 @@ extern void actuators_init(void); /** Temporary storage (for debugging purpose, downlinked via telemetry) */ -extern uint16_t actuators[ACTUATORS_NB]; +extern int16_t actuators[ACTUATORS_NB]; #endif /* ACTUATORS_NB */ diff --git a/sw/tools/gen_airframe.ml b/sw/tools/gen_airframe.ml index 90fe0697332..e1837a5459b 100644 --- a/sw/tools/gen_airframe.ml +++ b/sw/tools/gen_airframe.ml @@ -258,7 +258,7 @@ let rec parse_section = fun s -> print_actuators_idx (); printf "#define SetActuatorsFromCommands(values) { \\\n"; - printf " uint32_t servo_value;\\\n"; + printf " int32_t servo_value;\\\n"; printf " float command_value;\\\n"; List.iter parse_command_laws (Xml.children s);