diff --git a/.gitignore b/.gitignore index 6e22c007026..91fcea346b9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.out *~ +*.swp *.pyc @@ -16,6 +17,24 @@ *.aux +# Debian related files +*.deb +*.dsc +*.changes +*.substvars +*.debhelper.log +*-stamp +/debian/control +/debian/changelog +/debian/files +/debian/paparazzi-arm7 +/debian/paparazzi-avr +/debian/paparazzi-dev +/debian/paparazzi-bin +/sw/lib/ocaml/ivy/debian/changelog +/sw/lib/ocaml/ivy/debian/files +/sw/lib/ocaml/ivy/debian/ivy-ocaml + /var /dox @@ -89,3 +108,17 @@ # /sw/tools/ /sw/tools/fp_parser.ml /sw/tools/wiki_gen/wiki_gen + +# /sw/ground_segment/joystick +/sw/ground_segment/joystick/test_stick + +# /sw/airborne/arch/lpc21/test/bootloader +/sw/airborne/arch/lpc21/test/bootloader/bl.dmp +/sw/airborne/arch/lpc21/test/bootloader/bl.hex +/sw/airborne/arch/lpc21/test/bootloader/bl.map +/sw/airborne/arch/lpc21/test/bootloader/bl.elf +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.dmp +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.hex +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.map +/sw/airborne/arch/lpc21/test/bootloader/bl_ram.elf +/sw/airborne/arch/lpc21/test/bootloader/crt.lst diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 0df16e15f00..b1405b39313 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -16,7 +16,7 @@ - + @@ -29,7 +29,9 @@ - + + + diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml new file mode 100644 index 00000000000..a4641f02092 --- /dev/null +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + +
+ + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/conf/autopilot/rotorcraft.makefile b/conf/autopilot/rotorcraft.makefile index 2be86884fe8..a9b9b0738e0 100644 --- a/conf/autopilot/rotorcraft.makefile +++ b/conf/autopilot/rotorcraft.makefile @@ -134,6 +134,8 @@ ifeq ($(BOARD), booz) ap.CFLAGS += -DROTORCRAFT_BARO_LED=$(BARO_LED) -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' else ifeq ($(BOARD), lisa_l) ap.CFLAGS += -DUSE_I2C2 +ap.srcs += mcu_periph/i2c.c +ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c endif # diff --git a/conf/autopilot/rotorcraft.xml b/conf/autopilot/rotorcraft.xml index a28c88f9848..93467a93ffb 100644 --- a/conf/autopilot/rotorcraft.xml +++ b/conf/autopilot/rotorcraft.xml @@ -18,8 +18,8 @@
- - + + diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile index a3c61afbefe..be29427092e 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec.makefile @@ -1,7 +1,5 @@ # asctec controllers ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile index c1cfc48f37d..6b9d300c2eb 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_asctec_v2.makefile @@ -19,8 +19,6 @@ ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c ap.CFLAGS += -DACTUATORS_ASCTEC_V2_PROTOCOL ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile index 95e3591951b..d89410102e1 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_heli.makefile @@ -5,6 +5,3 @@ ap.CFLAGS += -DUSE_HELI ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_heli.c ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c - -# fixme : this is needed by baro and usualy added by actuators_mkk or actuators_asctec -ap.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile index 3ea53af26e7..3529c03923a 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile @@ -38,8 +38,6 @@ endif ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c -ap.srcs += mcu_periph/i2c.c -ap.srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0 diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile new file mode 100644 index 00000000000..5daf9d055f2 --- /dev/null +++ b/conf/autopilot/subsystems/rotorcraft/actuators_pwm_supervision.makefile @@ -0,0 +1,7 @@ + +# add actuatos arch to include directories +ap.CFLAGS += -I$(SRC_FIRMWARE)/actuators/arch/$(ARCH) + +ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c +ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c new file mode 100644 index 00000000000..06fb68f5add --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c @@ -0,0 +1,62 @@ +/* + * $Id$ + * + * Copyright (C) 2010 The Paparazzi Team + * + * 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 "firmwares/rotorcraft/actuators.h" +#include "actuators_pwm_supervision.h" +#include "booz/booz2_commands.h" +#include "subsystems/radio_control.h" + +/* let's start butchery now and use the actuators_pwm arch functions */ +#include "firmwares/rotorcraft/actuators/actuators_pwm.h" + +#include "generated/airframe.h" + +int32_t actuators_pwm_values[ACTUATORS_PWM_NB]; + +void actuators_init(void) +{ + supervision_init(); + actuators_pwm_arch_init(); +} + +#define PWM_GAIN_SCALE 2 +#define PWM_OFF 1000 + +void actuators_set(bool_t motors_on) { + booz2_commands[COMMAND_PITCH] = booz2_commands[COMMAND_PITCH] * PWM_GAIN_SCALE; + booz2_commands[COMMAND_ROLL] = booz2_commands[COMMAND_ROLL] * PWM_GAIN_SCALE; + booz2_commands[COMMAND_YAW] = booz2_commands[COMMAND_YAW] * PWM_GAIN_SCALE; + + supervision_run(motors_on, FALSE, booz2_commands); + + if (motors_on) { + for (int i = 0; i < SUPERVISION_NB_MOTOR; i++) + actuators_pwm_values[i] = supervision.commands[i]; + } else { + for (int i = 0; i < ACTUATORS_PWM_NB; i++) + actuators_pwm_values[i] = PWM_OFF; + } + actuators_pwm_commit(); + +} + diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h new file mode 100644 index 00000000000..cf10740cc2f --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h @@ -0,0 +1,30 @@ +/* + * $Id: actuators_pwm_supervision$ + * + * Copyright (C) 2010 The Paparazzi Team + * + * 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 ACTUATORS_PWM_SUPERVISION_H +#define ACTUATORS_PWM_SUPERVISION_H + +#include "firmwares/rotorcraft/actuators/supervision.h" + +#endif /* ACTUATORS_PWM_SUPERVISION_H */ diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index dff50473444..3b3291659a0 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -103,7 +103,7 @@ void guidance_v_read_rc(void) { // used in RC_DIRECT directly and as saturation in CLIMB and HOVER #ifndef USE_HELI - guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * 200 / MAX_PPRZ; + guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * (SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ + SUPERVISION_MIN_MOTOR; #else guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * 4 / 5; #endif diff --git a/sw/lib/ocaml/ivy/cglibivy.c b/sw/lib/ocaml/ivy/cglibivy.c index 228246d85fc..8241b70fc22 100644 --- a/sw/lib/ocaml/ivy/cglibivy.c +++ b/sw/lib/ocaml/ivy/cglibivy.c @@ -20,8 +20,8 @@ value ivy_GtkmainLoop(value unit) } extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); -extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_GtkchannelSetUp(value fd, value closure_name) { @@ -29,9 +29,9 @@ value ivy_GtkchannelSetUp(value fd, value closure_name) value * closure = caml_named_value(String_val(closure_name)); #if IVYMINOR_VERSION == 8 - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); #else - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); #endif return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/civy.c b/sw/lib/ocaml/ivy/civy.c index 15561182d4f..563f7ec517b 100644 --- a/sw/lib/ocaml/ivy/civy.c +++ b/sw/lib/ocaml/ivy/civy.c @@ -83,11 +83,11 @@ void cb_delete_channel(void *delete_read) { } -void cb_write_channel(Channel ch, HANDLE fd, void *closure) +void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure) { } -void cb_read_channel(Channel ch, HANDLE fd, void *closure) +void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure) { callback(*(value*)closure, Val_int(ch)); } diff --git a/sw/lib/ocaml/ivy/civyloop.c b/sw/lib/ocaml/ivy/civyloop.c index 4ff0a9311f8..083b104ee15 100644 --- a/sw/lib/ocaml/ivy/civyloop.c +++ b/sw/lib/ocaml/ivy/civyloop.c @@ -39,8 +39,8 @@ value ivy_timerRepeatafter(value nb_ticks,value delay, value closure_name) read closures */ extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); -extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_channelSetUp(value fd, value closure_name) @@ -49,9 +49,9 @@ value ivy_channelSetUp(value fd, value closure_name) value * closure = caml_named_value(String_val(closure_name)); #if IVYMINOR_VERSION == 8 - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); #else - c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); + c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); #endif return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/ctkivy.c b/sw/lib/ocaml/ivy/ctkivy.c index ae31560816e..87b7eb617d9 100644 --- a/sw/lib/ocaml/ivy/ctkivy.c +++ b/sw/lib/ocaml/ivy/ctkivy.c @@ -11,7 +11,7 @@ #include "ivytcl.h" extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); value ivy_TclmainLoop(value unit) { @@ -25,7 +25,7 @@ value ivy_TclchannelSetUp(value fd, value closure_name) Channel c; value * closure = caml_named_value(String_val(closure_name)); - c = IvyTclChannelSetUp((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + c = IvyTclChannelSetUp((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); return Val_int(c); } diff --git a/sw/lib/ocaml/ivy/debian/changelog.3.11.2 b/sw/lib/ocaml/ivy/debian/changelog.3.11.2 index eb649f9b77e..e365e339215 100644 --- a/sw/lib/ocaml/ivy/debian/changelog.3.11.2 +++ b/sw/lib/ocaml/ivy/debian/changelog.3.11.2 @@ -1,3 +1,9 @@ +ivy-ocaml (1.1-12) unstable; urgency=low + + * Support for ivy-c_3.11.8 + + -- Gautier Hattenberger Wed, 02 Feb 2011 17:49:31 +0100 + ivy-ocaml (1.1-11) unstable; urgency=low * Support of ivy-c_3.11.6, OSX and Linux 64bit