mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +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:
parent
ac3cee7788
commit
8a5157db46
5 changed files with 25 additions and 37 deletions
4
src/mw.c
4
src/mw.c
|
@ -84,7 +84,6 @@ void blinkLED(uint8_t num, uint8_t wait, uint8_t repeat)
|
|||
|
||||
#define BREAKPOINT 1500
|
||||
|
||||
// this code is executed at each loop and won't interfere with control loop if it lasts less than 650 microseconds
|
||||
void annexCode(void)
|
||||
{
|
||||
static uint32_t calibratedAccTime;
|
||||
|
@ -147,7 +146,7 @@ void annexCode(void)
|
|||
tmp2 = tmp / 100;
|
||||
rcCommand[THROTTLE] = lookupThrottleRC[tmp2] + (tmp - tmp2 * 100) * (lookupThrottleRC[tmp2 + 1] - lookupThrottleRC[tmp2]) / 100; // [0;1000] -> expo -> [MINTHROTTLE;MAXTHROTTLE]
|
||||
|
||||
if(f.HEADFREE_MODE) {
|
||||
if (f.HEADFREE_MODE) {
|
||||
float radDiff = (heading - headFreeModeHold) * M_PI / 180.0f;
|
||||
float cosDiff = cosf(radDiff);
|
||||
float sinDiff = sinf(radDiff);
|
||||
|
@ -777,6 +776,7 @@ void loop(void)
|
|||
loopTime = currentTime + mcfg.looptime;
|
||||
|
||||
computeIMU();
|
||||
annexCode();
|
||||
// Measure loop rate just afer reading the sensors
|
||||
currentTime = micros();
|
||||
cycleTime = (int32_t)(currentTime - previousTime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue