Rev 903 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 903 | Rev 909 | ||
---|---|---|---|
Line 66... | Line 66... | ||
66 | #include "timer2.h" |
66 | #include "timer2.h" |
67 | #ifdef USE_KILLAGREG |
67 | #ifdef USE_KILLAGREG |
68 | #include "mm3.h" |
68 | #include "mm3.h" |
69 | #include "gps.h" |
69 | #include "gps.h" |
70 | #endif |
70 | #endif |
71 | #if !defined (USE_KILLAGREG) && !defined (USE_NAVICTRL) |
71 | #ifdef USE_MK3MAG |
72 | #include "mk3mag.h" |
72 | #include "mk3mag.h" |
- | 73 | #include "gps.h" |
|
73 | #endif |
74 | #endif |
74 | #include "led.h" |
75 | #include "led.h" |
Line 75... | Line 76... | ||
75 | 76 | ||
76 | volatile uint16_t I2CTimeout = 100; |
77 | volatile uint16_t I2CTimeout = 100; |
Line 702... | Line 703... | ||
702 | Reading_IntegralGyroRoll = 0; |
703 | Reading_IntegralGyroRoll = 0; |
703 | Reading_IntegralGyroPitch2 = IntegralPitch; |
704 | Reading_IntegralGyroPitch2 = IntegralPitch; |
704 | Reading_IntegralGyroRoll2 = IntegralRoll; |
705 | Reading_IntegralGyroRoll2 = IntegralRoll; |
705 | SumPitch = 0; |
706 | SumPitch = 0; |
706 | SumRoll = 0; |
707 | SumRoll = 0; |
707 | #ifdef USE_KILLAGREG |
708 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
708 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
709 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
709 | { |
710 | { |
710 | GPS_SetHomePosition(); |
711 | GPS_SetHomePosition(); |
711 | } |
712 | } |
712 | #endif |
713 | #endif |
Line 721... | Line 722... | ||
721 | if(++delay_stopmotors > 200) // not immediately (wait 200 loops = 200 * 2ms = 0.4 s) |
722 | if(++delay_stopmotors > 200) // not immediately (wait 200 loops = 200 * 2ms = 0.4 s) |
722 | { |
723 | { |
723 | delay_stopmotors = 0; // do not repeat if once executed |
724 | delay_stopmotors = 0; // do not repeat if once executed |
724 | Model_Is_Flying = 0; |
725 | Model_Is_Flying = 0; |
725 | MotorsOn = 0; |
726 | MotorsOn = 0; |
726 | #ifdef USE_KILLAGREG |
727 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
727 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
728 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
728 | { |
729 | { |
729 | GPS_ClearHomePosition(); |
730 | GPS_ClearHomePosition(); |
730 | } |
731 | } |
731 | #endif |
732 | #endif |
Line 1210... | Line 1211... | ||
1210 | BadCompassHeading = 250; |
1211 | BadCompassHeading = 250; |
1211 | } |
1212 | } |
1212 | } |
1213 | } |
1213 | } |
1214 | } |
Line 1214... | Line 1215... | ||
1214 | 1215 | ||
1215 | #ifdef USE_KILLAGREG |
1216 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
1216 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1217 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1217 | // GPS |
1218 | // GPS |
1218 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1219 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1219 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
1220 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |