From 1636d1f80e90ceebc94990f8b18783196c3309f1 Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Wed, 25 Aug 2010 08:14:36 +0000 Subject: [PATCH] Lisa Fixed Wing Actuators --- conf/airframes/AirborneCodeReorg/LisaFw.xml | 4 ++-- conf/autopilot/fixedwing.makefile | 2 +- conf/autopilot/fixedwing.xml | 2 +- .../fixedwing/actuators_direct.makefile | 11 +++++++++++ .../fixedwing/actuators_lisa.makefile | 5 ----- sw/airborne/stm32/servos_direct_hw.c | 12 ++++++++++++ sw/airborne/stm32/servos_direct_hw.h | 18 ++++++++++++++++++ 7 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 conf/autopilot/subsystems/fixedwing/actuators_direct.makefile delete mode 100644 conf/autopilot/subsystems/fixedwing/actuators_lisa.makefile create mode 100644 sw/airborne/stm32/servos_direct_hw.c create mode 100644 sw/airborne/stm32/servos_direct_hw.h diff --git a/conf/airframes/AirborneCodeReorg/LisaFw.xml b/conf/airframes/AirborneCodeReorg/LisaFw.xml index 3bd6ae6be0..08c4517427 100644 --- a/conf/airframes/AirborneCodeReorg/LisaFw.xml +++ b/conf/airframes/AirborneCodeReorg/LisaFw.xml @@ -9,8 +9,8 @@ - - + + diff --git a/conf/autopilot/fixedwing.makefile b/conf/autopilot/fixedwing.makefile index cc6d62dfd3..210fbba73c 100644 --- a/conf/autopilot/fixedwing.makefile +++ b/conf/autopilot/fixedwing.makefile @@ -34,7 +34,7 @@ ifeq ($(BOARD),tiny) endif ifeq ($(BOARD),lisa_l) - include $(CFG_FIXEDWING)/actuators_lisa.makefile + include $(CFG_FIXEDWING)/actuators_direct.makefile endif diff --git a/conf/autopilot/fixedwing.xml b/conf/autopilot/fixedwing.xml index 3b36e4da10..95f0142ee9 100644 --- a/conf/autopilot/fixedwing.xml +++ b/conf/autopilot/fixedwing.xml @@ -20,7 +20,7 @@ - + diff --git a/conf/autopilot/subsystems/fixedwing/actuators_direct.makefile b/conf/autopilot/subsystems/fixedwing/actuators_direct.makefile new file mode 100644 index 0000000000..601c7ed5c6 --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing/actuators_direct.makefile @@ -0,0 +1,11 @@ +# for lisa_l + +ap.CFLAGS += -DACTUATORS=\"servos_direct_hw.h\" -DSERVOS_DIRECT +ap.srcs += $(SRC_ARCH)/servos_direct_hw.c $(SRC_FIXEDWING)/actuators.c + + +# TODO TODO HELP HELP TERRIBLE HORRIBLE HACK!!!! +ifeq ($(ARCHI), stm32) +ap.srcs += $(SRC_FIXEDWING)/booz/arch/stm32/actuators/booz_actuators_pwm_arch.c +ap.CFLAGS += -I$(SRC_FIXEDWING)/booz/arch/stm32/ +endif diff --git a/conf/autopilot/subsystems/fixedwing/actuators_lisa.makefile b/conf/autopilot/subsystems/fixedwing/actuators_lisa.makefile deleted file mode 100644 index 6c71965eb2..0000000000 --- a/conf/autopilot/subsystems/fixedwing/actuators_lisa.makefile +++ /dev/null @@ -1,5 +0,0 @@ -# for lisa_l - -#ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -#ap.srcs += $(SRC_FIXEDWING_ARCH)/servos_4017_hw.c $(SRC_FIXEDWING)/actuators.c - diff --git a/sw/airborne/stm32/servos_direct_hw.c b/sw/airborne/stm32/servos_direct_hw.c new file mode 100644 index 0000000000..f0e2ff8c6e --- /dev/null +++ b/sw/airborne/stm32/servos_direct_hw.c @@ -0,0 +1,12 @@ +#include "std.h" +#include "actuators.h" +#include "servos_direct_hw.h" + +int32_t booz_actuators_pwm_values[BOOZ_ACTUATORS_PWM_NB]; + +void actuators_init ( void ) { + booz_actuators_pwm_arch_init(); +} + + + diff --git a/sw/airborne/stm32/servos_direct_hw.h b/sw/airborne/stm32/servos_direct_hw.h new file mode 100644 index 0000000000..6a6cd04b49 --- /dev/null +++ b/sw/airborne/stm32/servos_direct_hw.h @@ -0,0 +1,18 @@ +#ifndef SERVOS_DIRECT_HW_H +#define SERVOS_DIRECT_HW_H + + +#include "std.h" + +#define BOOZ_ACTUATORS_PWM_NB 6 +extern int32_t booz_actuators_pwm_values[BOOZ_ACTUATORS_PWM_NB]; + +#include "actuators/booz_actuators_pwm_arch.h" + +#define SERVOS_TICS_OF_USEC(_v) (_v) +#define Actuator(_x) booz_actuators_pwm_values[_x] +#define ChopServo(x,a,b) Chop(x, a, b) +#define ActuatorsCommit booz_actuators_pwm_commit + + +#endif /* SERVOS_DIRECT_HW_H */