imuboard: fix call to bootloader
[fpv.git] / imuboard / MadgwickAHRS.h
1 /*
2  * Copyright (c) 2014, Olivier MATZ <zer0@droids-corp.org>
3  * Copyright (c) 2011, SOH Madgwick
4  *
5  *  This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19
20 //=============================================================================
21 // MadgwickAHRS.h
22 //=============================================================================
23 //
24 // Implementation of Madgwick's IMU and AHRS algorithms.
25 // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
26 //
27 // Date                 Author          Notes
28 // 29/09/2011   SOH Madgwick    Initial release
29 // 02/10/2011   SOH Madgwick    Optimised for reduced CPU load
30 //
31 //=============================================================================
32
33 #ifndef MadgwickAHRS_h
34 #define MadgwickAHRS_h
35
36 #include "imu.h"
37
38 extern volatile float beta;  // algorithm gain
39
40 /* update quaternion structure using the new IMU infos */
41 void MadgwickAHRSupdate(const struct imu_info *imu, struct quaternion *quat);
42
43 /* update quaternion structure using the new IMU infos, without using magneto */
44 void MadgwickAHRSupdateIMU(const struct imu_info *imu, struct quaternion *quat);
45
46 #endif