71,6 → 71,7 |
volatile int KompassValue = 0; |
volatile int KompassStartwert = 0; |
volatile int KompassRichtung = 0; |
uint8_t updKompass = 0; |
unsigned char MAX_GAS,MIN_GAS; |
unsigned char Notlandung = 0; |
unsigned char HoehenReglerAktiv = 0; |
656,7 → 657,15 |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
int w,v; |
static int SignalSchlecht = 0; |
static uint8_t SignalSchlecht = 0; |
|
if (!updKompass--) // Aufruf mit ~10 Hz |
{ |
KompassValue = heading_MM3(); |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
updKompass = 50; |
} |
|
w = abs(IntegralNick /1024); // mit zunehmender Neigung den Einfluss drosseln |
v = abs(IntegralRoll /1024); |
if(v > w) w = v; // grösste Neigung ermitteln |
674,7 → 683,7 |
ANALOG_ON; // ADC einschalten |
if(SignalSchlecht) SignalSchlecht--; |
} |
else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
else SignalSchlecht = 250; // so lange das Signal taub stellen --> ca. 1/2 sek |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |