Rev 483 | Rev 488 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 483 | Rev 487 | ||
---|---|---|---|
Line 76... | Line 76... | ||
76 | s32 EarthMagneticInclination = 0; |
76 | s32 EarthMagneticInclination = 0; |
77 | s32 EarthMagneticInclinationFiltered = 0; |
77 | s32 EarthMagneticInclinationFiltered = 0; |
78 | s32 EarthMagneticInclinationTheoretic = 0; |
78 | s32 EarthMagneticInclinationTheoretic = 0; |
79 | u8 ErrorDisturbedEarthMagnetField = 0; |
79 | u8 ErrorDisturbedEarthMagnetField = 0; |
80 | s16 EarthMagneticStrengthTheoretic = 0; // in mT (50 in Germany - 22 in Brazil) |
80 | s16 EarthMagneticStrengthTheoretic = 0; // in mT (50 in Germany - 22 in Brazil) |
- | 81 | u32 CompassValueErrorCount = 0; |
|
Line 81... | Line 82... | ||
81 | 82 | ||
82 | #define COMPASS_NONE 0 |
83 | #define COMPASS_NONE 0 |
83 | #define COMPASS_MK3MAG 1 |
84 | #define COMPASS_MK3MAG 1 |
84 | #define COMPASS_NCMAG 2 |
85 | #define COMPASS_NCMAG 2 |
Line 187... | Line 188... | ||
187 | if(!((old.X == MagVector.X) || (old.Y == MagVector.Y) || (old.Z == MagVector.Z))) check_value_counter = 0; // Values are normally changing |
188 | if(!((old.X == MagVector.X) || (old.Y == MagVector.Y) || (old.Z == MagVector.Z))) check_value_counter = 0; // Values are normally changing |
Line 188... | Line 189... | ||
188 | 189 | ||
189 | if(check_value_counter > 5000) |
190 | if(check_value_counter > 5000) |
190 | { |
191 | { |
- | 192 | Compass_Heading = -1; // values didn't change for 5 seconds -> probably a compass-fault |
|
191 | Compass_Heading = -1; // values didn't change for 5 seconds -> probably a compass-fault |
193 | CompassValueErrorCount = 35; |
192 | } |
194 | } |
Line 193... | Line 195... | ||
193 | else check_value_counter++; |
195 | else check_value_counter++; |
194 | 196 |