Update imu.c
Update imu.c
Update imu.c
Merge pull request #147 from bubi-007/master

bugfix pt1 element
fixed accz pt1 element bug
Merge pull request #148 from luggi/pt1fix

fixed accz pt1 element bug
CN - drv_timer.c changes.
Reduces the time spent in the interrupt handler.
Some variable types also changed from uint8_t to int or unsigned int to help improve code size/speed.
Rudimentary measurement of time spent in the handler seems to indicate a reduction from ~8us down to ~5us (excluding time spent in callbacks).
CN - Add support for using integer maths instead of floating point for motor mixing.
To use the integer math support, define the option MIXER_USES_INTEGER_MATH. There should be no loss of precision using this method.
CN - Fix divide with rounding macro
CN - Changed DIVIDE_WITH_ROUNDING to function
CN - Added integer sine (and cosine) approximation functions. About 15 times quicker than floating point methods, and with negligible loss of precision.
CN - Fix some typos.
CN - Replaced lrintf with non-standard version. The original rounds .5 values the wrong way (2.5 becomes 2, -2.5 becomes -2), is larger, and is slower.
CN - Fix divideWithRounding() function.
CN - And fix DIVIDE_WITH_ROUNDING macro to match function name.
CN - Added option to use integer approximations for cosf and sinf into board alignment functions. The integer approximation method loses practically no precision, and is around 15 times faster than the floating point method.
CN - Altered board rotation so that a rotation context is used.
Added in preparation for converting other similar code to use the same technique, doing away with floating point maths at the same time.
CN - Added support for converting raw gyro ADC values into degrees/sec x 10.
Will be using these values as source to rotation matrix.
CN - Work continuing on removal of floating point support in getEstimatedAttitude().
Added i64sqrt() function, which computes the square root of a 64 bit integer.
Will probably add a 32 bit version at some stage.
CN - Another fix for divide_with_rouunding(). Wasn't working with -ve values.