Subversion Repositories FlightCtrl

Rev

Rev 436 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 436 Rev 437
Line 60... Line 60...
60
        {
60
        {
61
         if(PlatinenVersion == 10) PORTD &= ~(1<<2);
61
         if(PlatinenVersion == 10) PORTD &= ~(1<<2);
62
         else                      PORTC &= ~(1<<7);
62
         else                      PORTC &= ~(1<<7);
63
        }
63
        }
Line 64... Line 64...
64
 
64
 
65
 if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)
65
        if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)
66
 {
-
 
67
  if(PINC & 0x10)
-
 
68
   {
66
        {
69
    cntKompass++;
-
 
70
   }
-
 
71
  else
67
                timer0_MM3();           // Kompass auslesen
72
   {
68
 
73
    if((cntKompass) && (cntKompass < 4000))
69
                if (!cntKompass--)              // Aufruf mit 10 Hz
74
    {
70
                {
75
     KompassValue = cntKompass;
-
 
76
    }
71
                        int heading;
77
//     if(cntKompass < 10) cntKompass = 10;
72
                        heading = heading_MM3();
78
//     KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L;
73
                        KompassValue = (KompassValue * 3 + heading) / 4;                // Filtern
79
     KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
74
                        KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
80
    cntKompass = 0;
75
                        cntKompass = 980;
81
   }
76
                }
82
 }
77
        }
Line 83... Line 78...
83
}
78
}
84
 
79