Skip to content

Commit

Permalink
[rotorcraft sim] some fixes for actuators arch
Browse files Browse the repository at this point in the history
* removed actuators mkk sim arch
* added pwm arch
  • Loading branch information
flixr committed May 29, 2012
1 parent e8753da commit fd2d1ec
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 20 deletions.
Expand Up @@ -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

Expand Up @@ -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
10 changes: 6 additions & 4 deletions conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile
Expand Up @@ -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
Expand Down
@@ -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

This file was deleted.

@@ -1,29 +1,34 @@
/*
* $Id$
* Copyright (C) 2010 The Paparazzi Team
*
* Copyright (C) 2009 Antoine Drouin <poinix@gmail.com>
* 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
*/

#include "firmwares/rotorcraft/actuators/actuators_pwm.h"

void actuators_pwm_arch_init(void) {

}

#define ActuatorsMkkArchSend() {}
void actuators_pwm_commit(void) {

#endif /* ACTUATORS_MKK_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 */

0 comments on commit fd2d1ec

Please sign in to comment.