diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile index 45fd6aaf54..167ccc3068 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile @@ -14,5 +14,5 @@ endif # Simulator sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=11 +sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile index 30451deebb..6aa20bc4fc 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile @@ -29,3 +29,8 @@ ifeq ($(ARCH), stm32) ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 ap.CFLAGS += -DUSE_I2C1 endif + +# Simulator +sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c +sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile index 58b251fc06..874c998a31 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile @@ -33,17 +33,19 @@ # # +ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c + +ifeq ($(ARCH), lpc21) + # set default i2c timing if not already configured ifeq ($(MKK_I2C_SCL_TIME), ) MKK_I2C_SCL_TIME=150 endif -ap.srcs += $(SRC_FIRMWARE)/actuators/supervision.c -ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c - -ifeq ($(ARCH), lpc21) ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) -DI2C0_VIC_SLOT=11 + else ifeq ($(ARCH), stm32) ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1 ap.CFLAGS += -DUSE_I2C1 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile index 5daf9d055f..d092a2ff9a 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile @@ -1,7 +1,12 @@ # add actuatos arch to include directories -ap.CFLAGS += -I$(SRC_FIRMWARE)/actuators/arch/$(ARCH) +$(TARGET).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 + +# Simulator +sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c +sim.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.c b/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.c deleted file mode 100644 index 2ed9a99455..0000000000 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "actuators/actuators_mkk.h" - -void actuators_mkk_arch_init(void) {} diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.h b/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.c similarity index 52% rename from sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.h rename to sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.c index 399c3c6c78..b709aa9b14 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_mkk_arch.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.c @@ -1,29 +1,34 @@ /* - * $Id$ + * Copyright (C) 2010 The Paparazzi Team * - * Copyright (C) 2009 Antoine Drouin + * This file is part of Paparazzi. * - * This file is part of paparazzi. - * - * paparazzi is free software; you can redistribute it and/or modify + * 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, + * 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 + * 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_MKK_ARCH_H -#define ACTUATORS_MKK_ARCH_H +/** @file arch/sim/actuators_pwm_arch.c + * dummy servos handling for sim + */ -#define ActuatorsMkkArchSend() {} +#include "firmwares/rotorcraft/actuators/actuators_pwm.h" -#endif /* ACTUATORS_MKK_ARCH_H */ +void actuators_pwm_arch_init(void) { + +} + +void actuators_pwm_commit(void) { + +} diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.h b/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.h new file mode 100644 index 0000000000..4e797628db --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/sim/actuators_pwm_arch.h @@ -0,0 +1,38 @@ +/* + * 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. + */ + +/** @file arch/sim/actuators_pwm_arch.h + * dummy servos handling for sim + */ + +#ifndef ACTUATORS_PWM_ARCH_H +#define ACTUATORS_PWM_ARCH_H + +#define ACTUATORS_PWM_NB 8 + +extern void actuators_pwm_arch_init(void); +extern void actuators_pwm_commit(void); + +#define ChopServo(_x,_a,_b) Chop(_x, _a, _b) +#define Actuator(_x) actuators_pwm_values[_x] +#define SERVOS_TICS_OF_USEC(_v) (_v) + +#endif /* ACTUATORS_PWM_ARCH_H */