diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index 3b6e14634..6bca066dc 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -150,7 +150,6 @@ SRC += $(OPSYSTEM)/alarms.c SRC += $(OPSYSTEM)/taskmonitor.c SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c -SRC += $(OPUAVOBJ)/uavobjectsinit_cc.c SRC += $(OPUAVOBJ)/eventdispatcher.c else ## TESTCODE @@ -185,6 +184,7 @@ SRC += $(OPUAVSYNTHDIR)/manualcontrolsettings.c SRC += $(OPUAVSYNTHDIR)/mixersettings.c SRC += $(OPUAVSYNTHDIR)/mixerstatus.c SRC += $(OPUAVSYNTHDIR)/ahrssettings.c +SRC += $(OPUAVSYNTHDIR)/uavobjectsinit.c #${wildcard ${OBJ}/$(shell echo $(VAR) | tr A-Z a-z)/*.c} #SRC += ${foreach OBJ, ${UAVOBJECTS}, $(UAVOBJECTS)/$(OBJ).c} # Cant use until i can automatically generate list of UAVObjects @@ -598,16 +598,7 @@ endif # Generate intermediate code for objects -gencode: ${OUTDIR}/InitObjects.c ${OUTDIR}/InitMods.c - -# Generate code for object initialization -${OUTDIR}/InitObjects.c: Makefile - @echo ${MSG_OBJINIT} - @echo ${quote}// Autogenerated file${quote} > ${OUTDIR}/InitObjects.c - @echo ${quote}${OBJ}Initialize(); }${quote} >> ${OUTDIR}/InitObjects.c - @echo ${quote}void UAVObjectsInitializeAll() { ${quote} >> ${OUTDIR}/InitObjects.c - @echo ${quote}${foreach OBJ, ${UAVOBJECTS}, ${OBJ}Initialize(); }${quote} >> ${OUTDIR}/InitObjects.c - @echo ${quote}}${quote} >> ${OUTDIR}/InitObjects.c +gencode: ${OUTDIR}/InitMods.c # Generate code for module initialization ${OUTDIR}/InitMods.c: Makefile diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_MD_NB.ld b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_MD_NB.ld index 0c0931a87..54c9a5643 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_MD_NB.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_MD_NB.ld @@ -17,6 +17,16 @@ SECTIONS *(.rodata .rodata* .gnu.linkonce.r.*) } > FLASH + /* init sections */ + .initcalluavobj.init : + { + . = ALIGN(4); + __uavobj_initcall_start = .; + KEEP(*(.initcalluavobj.init)) + . = ALIGN(4); + __uavobj_initcall_end = .; + } >FLASH + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) diff --git a/flight/UAVObjects/uavobjectsinit_cc.c b/flight/UAVObjects/uavobjectsinit_cc.c deleted file mode 100644 index 9a58eccf1..000000000 --- a/flight/UAVObjects/uavobjectsinit_cc.c +++ /dev/null @@ -1,102 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjectsinit.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Initialize all objects. - * Automatically generated by the UAVObjectGenerator. - * - * @note This is an automatically generated file. - * DO NOT modify manually. - * @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 - */ - -#include "openpilot.h" -#include "actuatorcommand.h" -#include "actuatordesired.h" -#include "actuatorsettings.h" -#include "ahrscalibration.h" -#include "ahrssettings.h" -#include "ahrsstatus.h" -#include "attitudeactual.h" -#include "attitudedesired.h" -#include "attituderaw.h" -#include "baroaltitude.h" -#include "batterysettings.h" -#include "firmwareiapobj.h" -#include "flightbatterystate.h" -#include "flightplancontrol.h" -#include "flightplansettings.h" -#include "flightplanstatus.h" -#include "flighttelemetrystats.h" -#include "gcstelemetrystats.h" -#include "gpsposition.h" -#include "gpssatellites.h" -#include "gpstime.h" -#include "guidancesettings.h" -#include "homelocation.h" -#include "i2cstats.h" -#include "manualcontrolcommand.h" -#include "manualcontrolsettings.h" -#include "mixersettings.h" -#include "mixerstatus.h" -#include "objectpersistence.h" -#include "positionactual.h" -#include "positiondesired.h" -#include "ratedesired.h" -#include "stabilizationsettings.h" -#include "systemalarms.h" -#include "systemsettings.h" -#include "systemstats.h" -#include "taskinfo.h" -#include "telemetrysettings.h" -#include "velocityactual.h" -#include "velocitydesired.h" -#include "watchdogstatus.h" - -/** - * Function used to initialize the first instance of each object. - * This file is automatically updated by the UAVObjectGenerator. - */ -void UAVObjectsInitializeAll() -{ - ObjectPersistenceInitialize(); - GCSTelemetryStatsInitialize(); - FlightTelemetryStatsInitialize(); - SystemStatsInitialize(); - SystemAlarmsInitialize(); - SystemSettingsInitialize(); - ActuatorCommandInitialize(); - ActuatorDesiredInitialize(); - AttitudeRawInitialize(); - AttitudeActualInitialize(); - AttitudeDesiredInitialize(); - ManualControlCommandInitialize(); - TaskInfoInitialize(); - I2CStatsInitialize(); - WatchdogStatusInitialize(); - TelemetrySettingsInitialize(); - StabilizationSettingsInitialize(); - ActuatorSettingsInitialize(); - RateDesiredInitialize(); - AHRSSettingsInitialize(); - ManualControlSettingsInitialize(); - MixerSettingsInitialize(); - MixerStatusInitialize(); -}