1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

Merge remote-tracking branch 'multiwii/master'

Conflicts:
	src/board.h
	src/drivers/adc_common.c
	src/drivers/pwm_common.c
	src/drivers/pwm_common.h
	src/main.c
	src/mw.c
	src/mw.h
	src/sensors.c
	src/utils.h
This commit is contained in:
Dominic Clifton 2014-05-03 22:48:41 +01:00
commit ee2140d324
10 changed files with 179 additions and 85 deletions

View file

@ -80,14 +80,15 @@ bool fakeAccDetect(acc_t *acc)
#ifdef FY90Q
// FY90Q analog gyro/acc
void sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, int16_t magDeclinationFromConfig)
bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, int16_t magDeclinationFromConfig)
{
memset(&acc, sizeof(acc), 0);
memset(&gyro, sizeof(gyro), 0);
adcSensorInit(&acc, &gyro);
return true;
}
#else
void sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, int16_t magDeclinationFromConfig)
bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t gyroLpf, uint8_t accHardwareToUse, int16_t magDeclinationFromConfig)
{
int16_t deg, min;
drv_adxl345_config_t acc_params;
@ -115,8 +116,7 @@ void sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint16_t
#endif
#endif
} else {
// if this fails, we get a beep + blink pattern. we're doomed, no gyro or i2c error.
failureMode(3);
return false;
}
// Accelerometer. Fuck it. Let user break shit.
@ -242,6 +242,8 @@ retry:
} else {
magneticDeclination = 0.0f; // TODO investigate if this is actually needed if there is no mag sensor or if the value stored in the config should be used.
}
return true;
}
#endif