Rev 901 | Rev 911 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 901 | Rev 908 | ||
---|---|---|---|
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 687... | Line 688... | ||
687 | Reading_IntegralGyroRoll = 0; |
688 | Reading_IntegralGyroRoll = 0; |
688 | Reading_IntegralGyroPitch2 = IntegralPitch; |
689 | Reading_IntegralGyroPitch2 = IntegralPitch; |
689 | Reading_IntegralGyroRoll2 = IntegralRoll; |
690 | Reading_IntegralGyroRoll2 = IntegralRoll; |
690 | SumPitch = 0; |
691 | SumPitch = 0; |
691 | SumRoll = 0; |
692 | SumRoll = 0; |
692 | #ifdef USE_KILLAGREG |
693 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
693 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
694 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
694 | { |
695 | { |
695 | GPS_SetHomePosition(); |
696 | GPS_SetHomePosition(); |
696 | } |
697 | } |
697 | #endif |
698 | #endif |
Line 706... | Line 707... | ||
706 | if(++delay_stopmotors > 200) // not immediately (wait 200 loops = 200 * 2ms = 0.4 s) |
707 | if(++delay_stopmotors > 200) // not immediately (wait 200 loops = 200 * 2ms = 0.4 s) |
707 | { |
708 | { |
708 | delay_stopmotors = 200; // do not repeat if once executed |
709 | delay_stopmotors = 200; // do not repeat if once executed |
709 | Model_Is_Flying = 0; |
710 | Model_Is_Flying = 0; |
710 | MotorsOn = 0; |
711 | MotorsOn = 0; |
711 | #ifdef USE_KILLAGREG |
712 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
712 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
713 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
713 | { |
714 | { |
714 | GPS_ClearHomePosition(); |
715 | GPS_ClearHomePosition(); |
715 | } |
716 | } |
716 | #endif |
717 | #endif |
Line 1195... | Line 1196... | ||
1195 | BadCompassHeading = 250; |
1196 | BadCompassHeading = 250; |
1196 | } |
1197 | } |
1197 | } |
1198 | } |
1198 | } |
1199 | } |
Line 1199... | Line 1200... | ||
1199 | 1200 | ||
1200 | #ifdef USE_KILLAGREG |
1201 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
1201 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1202 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1202 | // GPS |
1203 | // GPS |
1203 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1204 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1204 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |
1205 | if(ParamSet.GlobalConfig & CFG_GPS_ACTIVE) |