Пример #1
0
/**
 * @brief Initialise the module
 *
 * @return -1 if initialisation failed on success
 */
static int32_t RadioComBridgeInitialize(void)
{
	// allocate and initialize the static data storage only if module is enabled
	data =
	    (RadioComBridgeData *) PIOS_malloc(sizeof(RadioComBridgeData));
	if (!data) {
		return -1;
	}
	// Initialize the UAVObjects that we use
	RFM22BStatusInitialize();
	ObjectPersistenceInitialize();
	RFM22BReceiverInitialize();
	RadioComBridgeStatsInitialize();

	// Initialise UAVTalk
	data->telemUAVTalkCon = UAVTalkInitialize(&UAVTalkSendHandler);
	data->radioUAVTalkCon = UAVTalkInitialize(&RadioSendHandler);

	// Initialize the queues.
	data->uavtalkEventQueue = PIOS_Queue_Create(EVENT_QUEUE_SIZE, sizeof(UAVObjEvent));
	data->radioEventQueue = PIOS_Queue_Create(EVENT_QUEUE_SIZE, sizeof(UAVObjEvent));

	// Initialize the statistics.
	data->telemetryTxRetries = 0;
	data->radioTxRetries = 0;

	data->parseUAVTalk = true;

	return 0;
}
Пример #2
0
/**
 * Initialize the module, called on startup.
 * \returns 0 on success or -1 if initialization failed
 */
int32_t SystemModInitialize(void)
{

	// Must registers objects here for system thread because ObjectManager started in OpenPilotInit
	SystemSettingsInitialize();
	SystemStatsInitialize();
	ObjectPersistenceInitialize();
#if defined(DIAGNOSTICS)
	TaskInfoInitialize();
	I2CStatsInitialize();
	WatchdogStatusInitialize();
#endif

	SystemModStart();

	return 0;
}
/**
 * Function used to initialize the first instance of each object.
 * This file is automatically updated by the UAVObjectGenerator.
 */
void UAVObjectsInitializeAll()
{
    ActuatorCommandInitialize();
    ActuatorDesiredInitialize();
    ActuatorSettingsInitialize();
    AHRSCalibrationInitialize();
    AHRSSettingsInitialize();
    AhrsStatusInitialize();
    AttitudeActualInitialize();
    AttitudeDesiredInitialize();
    AttitudeRawInitialize();
    AttitudeSettingsInitialize();
    BaroAltitudeInitialize();
    ExampleObject1Initialize();
    ExampleObject2Initialize();
    ExampleSettingsInitialize();
    FlightBatteryStateInitialize();
    FlightTelemetryStatsInitialize();
    GCSTelemetryStatsInitialize();
    GPSPositionInitialize();
    GPSSatellitesInitialize();
    GPSTimeInitialize();
    HomeLocationInitialize();
    ManualControlCommandInitialize();
    ManualControlSettingsInitialize();
    MixerSettingsInitialize();
    MixerStatusInitialize();
    ObjectPersistenceInitialize();
    PositionActualInitialize();
    StabilizationSettingsInitialize();
    SystemAlarmsInitialize();
    SystemSettingsInitialize();
    SystemStatsInitialize();
    TelemetrySettingsInitialize();
    VTOLSettingsInitialize();
    VTOLStatusInitialize();

}
Пример #4
0
/**
 * Initialize the module, called on startup.
 * \returns 0 on success or -1 if initialization failed
 */
int32_t SystemModInitialize(void)
{

	// Must registers objects here for system thread because ObjectManager started in OpenPilotInit
	SystemSettingsInitialize();
	SystemStatsInitialize();
	FlightStatusInitialize();
	ObjectPersistenceInitialize();
#if defined(DIAG_TASKS)
	TaskInfoInitialize();
#endif
#if defined(WDG_STATS_DIAGNOSTICS)
	WatchdogStatusInitialize();
#endif

	objectPersistenceQueue = PIOS_Queue_Create(1, sizeof(UAVObjEvent));
	if (objectPersistenceQueue == NULL)
		return -1;

	SystemModStart();

	return 0;
}