diff --git a/flight/OpenPilot/Makefile.win32 b/flight/OpenPilot/Makefile.win32 index 101be1bba..2d8f09edc 100644 --- a/flight/OpenPilot/Makefile.win32 +++ b/flight/OpenPilot/Makefile.win32 @@ -110,6 +110,7 @@ PYMITEINC += $(PYMITEPLAT) PYMITEINC += $(OUTDIR) FLIGHTPLANLIB = $(OPMODULEDIR)/FlightPlan/lib FLIGHTPLANS = $(OPMODULEDIR)/FlightPlan/flightplans +OPUAVSYNTHDIR = $(OUTDIR)/../../uavobject-synthetics/flight # List C source files here. (C dependencies are automatically generated.) # use file-extension c for "c-only"-files @@ -137,9 +138,10 @@ SRC += $(OPSYSTEM)/alarms.c SRC += $(OPSYSTEM)/taskmonitor.c SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c -SRC += $(OPUAVOBJ)/uavobjectsinit.c +SRC += $(OPUAVSYNTHDIR)/init/uavobjectsinit.c SRC += $(OPUAVOBJ)/eventdispatcher.c SRC += $(FLIGHTLIB)/CoordinateConversions.c + else ## TESTCODE SRC += $(OPTESTS)/test_common.c @@ -149,48 +151,7 @@ endif ## UAVOBJECTS ifndef TESTAPP -SRC += $(OPUAVOBJ)/objectpersistence.c -SRC += $(OPUAVOBJ)/positionactual.c -SRC += $(OPUAVOBJ)/gpsposition.c -SRC += $(OPUAVOBJ)/gpstime.c -SRC += $(OPUAVOBJ)/gpssatellites.c -SRC += $(OPUAVOBJ)/gcstelemetrystats.c -SRC += $(OPUAVOBJ)/flighttelemetrystats.c -SRC += $(OPUAVOBJ)/systemstats.c -SRC += $(OPUAVOBJ)/systemalarms.c -SRC += $(OPUAVOBJ)/systemsettings.c -SRC += $(OPUAVOBJ)/telemetrysettings.c -SRC += $(OPUAVOBJ)/actuatorcommand.c -SRC += $(OPUAVOBJ)/actuatordesired.c -SRC += $(OPUAVOBJ)/actuatorsettings.c -SRC += $(OPUAVOBJ)/manualcontrolcommand.c -SRC += $(OPUAVOBJ)/manualcontrolsettings.c -SRC += $(OPUAVOBJ)/attitudedesired.c -SRC += $(OPUAVOBJ)/stabilizationsettings.c -SRC += $(OPUAVOBJ)/ahrsstatus.c -SRC += $(OPUAVOBJ)/i2cstats.c -SRC += $(OPUAVOBJ)/baroaltitude.c -SRC += $(OPUAVOBJ)/ahrscalibration.c -SRC += $(OPUAVOBJ)/attitudeactual.c -SRC += $(OPUAVOBJ)/ahrssettings.c -SRC += $(OPUAVOBJ)/flightbatterystate.c -SRC += $(OPUAVOBJ)/attituderaw.c -SRC += $(OPUAVOBJ)/homelocation.c -SRC += $(OPUAVOBJ)/mixersettings.c -SRC += $(OPUAVOBJ)/mixerstatus.c -SRC += $(OPUAVOBJ)/positiondesired.c -SRC += $(OPUAVOBJ)/velocitydesired.c -SRC += $(OPUAVOBJ)/velocityactual.c -SRC += $(OPUAVOBJ)/guidancesettings.c -SRC += $(OPUAVOBJ)/firmwareiapobj.c -SRC += $(OPUAVOBJ)/ratedesired.c -SRC += $(OPUAVOBJ)/batterysettings.c -SRC += $(OPUAVOBJ)/flightplancontrol.c -SRC += $(OPUAVOBJ)/flightplanstatus.c -SRC += $(OPUAVOBJ)/flightplansettings.c -SRC += $(OPUAVOBJ)/taskinfo.c -SRC += $(OPUAVOBJ)/watchdogstatus.c -SRC += $(OPUAVOBJ)/nedaccel.c +SRC += $(wildcard $(OPUAVSYNTHDIR)/*.c) endif ## PIOS Hardware (win32) @@ -246,6 +207,7 @@ EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/Win32 EXTRAINCDIRS += $(FLIGHTLIB) EXTRAINCDIRS += $(FLIGHTLIBINC) EXTRAINCDIRS += $(PYMITEINC) +EXTRAINCDIRS += $(OPUAVSYNTHDIR) EXTRAINCDIRS += ${foreach MOD, ${MODULES}, ${OPMODULEDIR}/${MOD}/inc} ${OPMODULEDIR}/System/inc diff --git a/flight/PiOS.win32/inc/pios_initcall.h b/flight/PiOS.win32/inc/pios_initcall.h new file mode 100644 index 000000000..73d5e72f7 --- /dev/null +++ b/flight/PiOS.win32/inc/pios_initcall.h @@ -0,0 +1,48 @@ +/** + ****************************************************************************** + * @addtogroup PIOS PIOS Initcall infrastructure + * @{ + * @addtogroup PIOS_INITCALL Generic Initcall Macros + * @brief Initcall Macros + * @{ + * + * @file pios_initcall.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. + * @brief Initcall header + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PIOS_INITCALL_H +#define PIOS_INITCALL_H + +/** + * Just a stub define to make things compile. + * Automatically link based initialization currently doesn't work + * since posix really runs on a multitude of architectures + * and we cannot define a linker script for each of them atm + */ + +#define uavobj_initcall(fn) + +#endif /* PIOS_INITCALL_H */ + +/** + * @} + * @} + */ diff --git a/flight/PiOS.win32/inc/pios_servo.h b/flight/PiOS.win32/inc/pios_servo.h index a9624b692..7cbf37a7d 100644 --- a/flight/PiOS.win32/inc/pios_servo.h +++ b/flight/PiOS.win32/inc/pios_servo.h @@ -32,7 +32,7 @@ /* Public Functions */ extern void PIOS_Servo_Init(void); -extern void PIOS_Servo_SetHz(uint16_t onetofour, uint16_t fivetoeight); +extern void PIOS_Servo_SetHz(uint16_t * speeds, uint8_t num_banks); extern void PIOS_Servo_Set(uint8_t Servo, uint16_t Position); #endif /* PIOS_SERVO_H */ diff --git a/flight/PiOS.win32/pios.h b/flight/PiOS.win32/pios.h index 855c9ea8b..0c908cafc 100644 --- a/flight/PiOS.win32/pios.h +++ b/flight/PiOS.win32/pios.h @@ -48,6 +48,9 @@ #include #include +/* Generic initcall infrastructure */ +#include "pios_initcall.h" + /* PIOS Board Specific Device Configuration */ #include "pios_board_posix.h" diff --git a/flight/PiOS.win32/win32/pios_servo.c b/flight/PiOS.win32/win32/pios_servo.c index 66e6e8eb1..93b86a1ed 100644 --- a/flight/PiOS.win32/win32/pios_servo.c +++ b/flight/PiOS.win32/win32/pios_servo.c @@ -50,7 +50,7 @@ void PIOS_Servo_Init(void) * \param[in] onetofour Rate for outputs 1 to 4 (Hz) * \param[in] fivetoeight Rate for outputs 5 to 8 (Hz) */ -void PIOS_Servo_SetHz(uint16_t onetofour, uint16_t fivetoeight) +void PIOS_Servo_SetHz(uint16_t * banks, uint8_t num_banks) { } @@ -63,7 +63,7 @@ void PIOS_Servo_Set(uint8_t Servo, uint16_t Position) { #ifndef PIOS_ENABLE_DEBUG_PINS /* Make sure servo exists */ - if (Servo < PIOS_SERVO_NUM_OUTPUTS && Servo >= 0) { + if (Servo < PIOS_SERVO_NUM_OUTPUTS) { /* Update the position */ ServoPosition[Servo] = Position;