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

disconnected magcal from core and put it all into hmc5883 driver. no need to keep track of it if driver does init by itself as well.

moved annexcode into mw.c instead of imu.c
hopefully didn't break anything.
NOT FLIGHT TESTED.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@405 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-09-19 15:07:48 +00:00
parent ac3cee7788
commit 8a5157db46
5 changed files with 25 additions and 37 deletions

View file

@ -366,14 +366,13 @@ void Gyro_getADC(void)
}
#ifdef MAG
static float magCal[3] = { 1.0f, 1.0f, 1.0f }; // gain for each axis, populated at sensor init
static uint8_t magInit = 0;
void Mag_init(void)
{
// initialize and calibration. turn on led during mag calibration (calibration routine blinks it)
LED1_ON;
hmc5883lInit(magCal);
hmc5883lInit();
LED1_OFF;
magInit = 1;
}
@ -392,10 +391,6 @@ int Mag_getADC(void)
// Read mag sensor
hmc5883lRead(magADC);
magADC[X] = magADC[X] * magCal[X];
magADC[Y] = magADC[Y] * magCal[Y];
magADC[Z] = magADC[Z] * magCal[Z];
if (f.CALIBRATE_MAG) {
tCal = t;
for (axis = 0; axis < 3; axis++) {