1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Initial support for FY90Q hardware

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@146 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop 2012-04-08 14:46:50 +00:00
parent cb334ecf47
commit d9920756d9
15 changed files with 6681 additions and 2147 deletions

View file

@ -19,6 +19,14 @@ extern uint8_t batteryCellCount;
sensor_t acc; // acc access functions
sensor_t gyro; // gyro access functions
#ifdef FY90Q
// FY90Q analog gyro/acc
void sensorsAutodetect(void)
{
adcSensorInit(&acc, &gyro);
}
#else
// AfroFlight32 i2c sensors
void sensorsAutodetect(void)
{
drv_adxl345_config_t acc_params;
@ -54,6 +62,7 @@ void sensorsAutodetect(void)
// todo: this is driver specific :(
mpu3050Config(cfg.gyro_lpf);
}
#endif
uint16_t batteryAdcToVoltage(uint16_t src)
{
@ -175,6 +184,7 @@ void ACC_getADC(void)
ACC_Common();
}
#ifdef BARO
static uint32_t baroDeadline = 0;
static uint8_t baroState = 0;
static uint16_t baroUT = 0;
@ -214,6 +224,7 @@ void Baro_update(void)
break;
}
}
#endif /* BARO */
static void GYRO_Common(void)
{
@ -278,6 +289,7 @@ void Gyro_getADC(void)
GYRO_Common();
}
#ifdef MAG
static float magCal[3] = { 1.0, 1.0, 1.0 }; // gain for each axis, populated at sensor init
static uint8_t magInit = 0;
@ -359,3 +371,4 @@ void Mag_getADC(void)
}
}
}
#endif