/** * Initialise the module. Called before the start function * \returns 0 on success or -1 if initialisation failed */ int32_t SensorsInitialize(void) { GyroSensorInitialize(); AccelSensorInitialize(); MagSensorInitialize(); RevoCalibrationInitialize(); AttitudeSettingsInitialize(); rotate = 0; RevoCalibrationConnectCallback(&settingsUpdatedCb); AttitudeSettingsConnectCallback(&settingsUpdatedCb); return 0; }
/** * Initialise the module. Called before the start function * \returns 0 on success or -1 if initialisation failed */ int32_t SensorsInitialize(void) { source_data = (sensor_data *)pios_malloc(MAX_SENSOR_DATA_SIZE); GyroSensorInitialize(); AccelSensorInitialize(); MagSensorInitialize(); BaroSensorInitialize(); RevoCalibrationInitialize(); RevoSettingsInitialize(); AttitudeSettingsInitialize(); AccelGyroSettingsInitialize(); rotate = 0; RevoSettingsConnectCallback(&settingsUpdatedCb); RevoCalibrationConnectCallback(&settingsUpdatedCb); AttitudeSettingsConnectCallback(&settingsUpdatedCb); AccelGyroSettingsConnectCallback(&settingsUpdatedCb); return 0; }