1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

uavobj: Convert CC over to use autogenerated uavobjinit

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2631 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2011-01-30 22:46:51 +00:00 committed by stac
parent 083e2b01a9
commit b5426e09d0
3 changed files with 12 additions and 113 deletions

View File

@ -150,7 +150,6 @@ SRC += $(OPSYSTEM)/alarms.c
SRC += $(OPSYSTEM)/taskmonitor.c SRC += $(OPSYSTEM)/taskmonitor.c
SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVTALK)/uavtalk.c
SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/uavobjectmanager.c
SRC += $(OPUAVOBJ)/uavobjectsinit_cc.c
SRC += $(OPUAVOBJ)/eventdispatcher.c SRC += $(OPUAVOBJ)/eventdispatcher.c
else else
## TESTCODE ## TESTCODE
@ -185,6 +184,7 @@ SRC += $(OPUAVSYNTHDIR)/manualcontrolsettings.c
SRC += $(OPUAVSYNTHDIR)/mixersettings.c SRC += $(OPUAVSYNTHDIR)/mixersettings.c
SRC += $(OPUAVSYNTHDIR)/mixerstatus.c SRC += $(OPUAVSYNTHDIR)/mixerstatus.c
SRC += $(OPUAVSYNTHDIR)/ahrssettings.c SRC += $(OPUAVSYNTHDIR)/ahrssettings.c
SRC += $(OPUAVSYNTHDIR)/uavobjectsinit.c
#${wildcard ${OBJ}/$(shell echo $(VAR) | tr A-Z a-z)/*.c} #${wildcard ${OBJ}/$(shell echo $(VAR) | tr A-Z a-z)/*.c}
#SRC += ${foreach OBJ, ${UAVOBJECTS}, $(UAVOBJECTS)/$(OBJ).c} #SRC += ${foreach OBJ, ${UAVOBJECTS}, $(UAVOBJECTS)/$(OBJ).c}
# Cant use until i can automatically generate list of UAVObjects # Cant use until i can automatically generate list of UAVObjects
@ -598,16 +598,7 @@ endif
# Generate intermediate code for objects # Generate intermediate code for objects
gencode: ${OUTDIR}/InitObjects.c ${OUTDIR}/InitMods.c gencode: ${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
# Generate code for module initialization # Generate code for module initialization
${OUTDIR}/InitMods.c: Makefile ${OUTDIR}/InitMods.c: Makefile

View File

@ -17,6 +17,16 @@ SECTIONS
*(.rodata .rodata* .gnu.linkonce.r.*) *(.rodata .rodata* .gnu.linkonce.r.*)
} > FLASH } > FLASH
/* init sections */
.initcalluavobj.init :
{
. = ALIGN(4);
__uavobj_initcall_start = .;
KEEP(*(.initcalluavobj.init))
. = ALIGN(4);
__uavobj_initcall_end = .;
} >FLASH
.ARM.extab : .ARM.extab :
{ {
*(.ARM.extab* .gnu.linkonce.armextab.*) *(.ARM.extab* .gnu.linkonce.armextab.*)

View File

@ -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();
}